Re: signal queue resource - Posix timers

Jim Houston (jim.houston@attbi.com)
Wed, 28 May 2003 19:14:30 -0400


Ulrich Drepper wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> > Posix timers are required to fail the
> > timer_create with EAGAIN if "the system lacks sufficient signal queuing
> > resources to honor the request." The current Linux posix-timers
> > implementation doesn't do this.
>
> That's not really how you can interpret this. At the time timer_create
> is it is not know when the timer expires and whether it's a repeating
> timer. Therefore it is not correct to assume that if timer_create
> succeeds the resources to always deliver the signal are available.

Hi Ulrich,

My intention is to allocate a sigqueue structure in the kernel as part
of the timer_create call. Later on in timer completion, I will use this
preallocated sigqueue entry to queue the siginfo_t for the timer completion.
The Posix timers specification guarantees that there can only be a single
signal pending for a given timer so preallocating one sigqueue structure
for each timer is sufficient.

Perhaps I should have tracked down the appropriate "shall deliver the
signal on timer completion" and quoted it instead. The point is that
the current Linux implementation will fail to deliver the signal at the
whim of other programs which might consume the limited signal queue
resource.

I saw your post on the posixtest-discuss which complained about the test suite
trying to force this condition. I agree that this is a bad test. When I preallocate
this resource, I may happily wait for a sigqueue entry to be available
and never return this failure.

Have a look at the Rationale and Notes section B.14.2.2 Create a Per-Process
Timer. It is fairly clear that it expects signal queuing resources to
be allocated at timer_create time and that failing to deliver a completion
signal is never acceptable.

Jim Houston - Concurrent Computer Corp.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/