Quantcast
Channel: lkml.org : Shesha Sreenivasamurthy
Viewing all articles
Browse latest Browse all 1267

Re: [PATCH 2/2 v2] sched/wait: Introduce lock breaker in wake_up_p ...

$
0
0
Linus Torvalds writes: (Summary) It's wrong for several reasons:
It's wrong for several reasons:
- because it's unfair: threads that want to lock get put behind threads that just want to see the unlocked state.
threads that just want to see the unlocked state.
- because it's stupid: our non-locking waiters will end up waiting again if the page got locked, so waking up a locker *and* a lot of non-locking waiters will just cause them to go back to sleep anyway non-locking waiters will just cause them to go back to sleep anyway - because it causes us to walk longer lists: we stop walking when we wake up the exclusive waiter, but because we always put the non-exclusive waiters in there first, we always walk the long list of non-exclusive waiters even if we could just stop walking because we woke up an exclusive one.
woke up an exclusive one.
Now the reason we do this seems to be entirely random: for a *normal* wait queue, you really want to always wake up all the non-exclusive waiters, because exclusive waiters

Viewing all articles
Browse latest Browse all 1267

Trending Articles