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

From: William Lee Irwin III (wli_at_holomorphy.com)
Date: 09/03/04

  • Next message: Gerd Knorr: "Re: [patch 3/4] v4l: bttv driver update."
    Date:	Fri, 3 Sep 2004 02:42:47 -0700
    To: Martin Wilck <martin.wilck@fujitsu-siemens.com>
    
    

    William Lee Irwin III wrote:
    >>+ prepare_to_wait(wqh, &wait.wait, TASK_UNINTERRUPTIBLE);
    >>+ if (buffer_locked(bh)) {
    >>+ sync_buffer(bh);
    >>+ io_schedule();
    >>+ }
    >> finish_wait(wqh, &wait.wait);
    >> }

    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.

    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.

    These two aspects of wake-one semantics give it highly attractive
    performance characteristics.

    -- wli
    -
    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/


  • Next message: Gerd Knorr: "Re: [patch 3/4] v4l: bttv driver update."

    Relevant Pages

    • Re: [1/4] standardize bit waiting data type
      ... > Part of the point of filtered waitqueues is to reestablish wake-one ... > semantics. ... > those waiting merely for a bit to clear with no need to set it, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Hutch, give it up.
      ... > accept that thinking of the Windows message loop in polling terms is ... dozens of posts discussing the semantics of polling, ... a semantics nazi, the IMPORTANT thing is that it blocks waiting, not ...
      (alt.lang.asm)
    • Re: Implementing Java like synchronization with the OS/2 API in C++
      ... >> distinguish which one of these two semantics is assumed. ... > The second problem is between waitand wait- because I ... > not wake up threads that are not already waiting for the event. ... You mean those which are waiting for the syncronization context? ...
      (comp.os.os2.programmer.misc)
    • [PATCH] Fix x86_64 _spin_lock_irqsave()
      ... semantics on x86_64 as it does on i386 and does *not* have interrupts disabled while it is waiting for the lock. ... This fix is courtesy of Michael Davidson ...
      (Linux-Kernel)