lkml.org 
[lkml]   [2008]   [Nov]   [14]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 14 Nov 2008 21:21:02 +0000
FromAlan Cox <>
SubjectRe: Active waiting with yield()
> If I have a race condition that gets triggered just for one user in the 
> world when repeatedly loading & unloading a driver for an hour, and I use 
> yield() to solve it, what's wrong with it? A wait queue increases cache 
> footprint for every user. (even if I use preallocated hashed wait queue, 
> it still eats a cacheline to access it and find out that it's empty)

Reread what I wrote.

You don't need to use a hashed queue, you don't need to even reference
the queue in the normal case. You cost is one variable, which you can
probably sensibly locate, and a predicted jump.

For that you get proper sleeping behaviour, CPU used by other tasks or
guests and you don't hang on hard real time tasks.


\
 
 \ /
  Last update: 2008-11-14 22:23    [from the cache]
©2003-2008