Re: [1/4] standardize bit waiting data type

From: William Lee Irwin III
Date: Fri Sep 03 2004 - 05:29:23 EST


On Fri, Sep 03, 2004 at 11:53:55AM +0200, Martin Wilck wrote:
>> Why don't you need a do..while loop any more ?
>> There is also no loop in __wait_on_bit() in the completed patch series.

On Fri, Sep 03, 2004 at 02:42:47AM -0700, William Lee Irwin III wrote:
> Part of the point of filtered waitqueues is to reestablish wake-one
> semantics. This means two things:
> (a) those waiting merely for a bit to clear with no need to set it,
> i.e. all they want is to know a transition from set to
> clear occurred, are only woken once and don't need to loop
> waking and sleeping
> (b) Of those tasks waiting for a bit to clear so they can set it
> exclusively, only one needs to be woken, and after the first
> is woken, it promises to clear the bit again, so there is no
> need to wake more tasks.

Also, (a) still works in the presence of signals with interruptible
waits (which the VM and VFS do not now use); the sleeping function is
required to return -EINTR or some other nonzero value to indicate
abnormal termination, which in turn must be checked by the caller.


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