On 17 Sep 2002, Michel D�nzer wrote:
> 
> AFAIUI (a kernel guru please correct me if I'm wrong),
> wake_up_interruptible() only wakes up one process (probably FIFO?) on
> the queue, whereas wake_up_interruptible_all() wakes up all of them.

Close, but no cigar.

Both interfaces wake up all non-exclusive waiters on the wakeup queue.

The difference really comes into play only if you have exclusive waiters 
(ie somebody has explicitly asked the wakeup logic to not wake up other 
exclusive waiters). In that case the *_all() functions ignore the 
exclusivity logic.

I doubt the DRI layer uses exclusive sleepers, at least not intentially.  
They are very convenient for mutual exclusion things (ie when a semaphore
is made available, you don't want to wake up _everybody_ who waits on the
semaphore, you want to wake up only _one_ waiter, since otherwise you just
get the old thundering herd scheduling problem), but they are usually only
used when you have seen contention and the thundering herd problem in
practice.

Thus, for DRI there should be no practical difference between
wake_up_interruptible() and wake_up_interruptible_all(). I would 
personally suggest avoiding the "*_all()" functions myself, since it just 
shows that somebody has done something stupid with an exclusive waiter 
that wasn't really exclusive in the first place.

(The main reason for xxx_all() is to test for bugs. If using it changes
behavior of the code, the waiters did something wrong. I suspect all
existing uses are really just confused.)

                Linus



-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to