Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit eb8b36f3 authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by alexax66
Browse files

sched/completion: Add lock-free checking of the blocking case



The "thread would block" case can be checked without grabbing ->wait.lock.

[ If the check does not return early then grab the lock and recheck.
  A memory barrier is not needed as complete() and complete_all() imply
  a barrier.

  The ACCESS_ONCE() is needed for calls in a loop that, if inlined, could
  optimize out the re-fetching of x->done. ]

Signed-off-by: default avatarNicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1422013307-13200-1-git-send-email-der.herr@hofr.at


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarXileForce <rdaguiar360@gmail.com>

Original commit: https://github.com/ktoonsez/KTSGS6/commit/568b7f0dacdab10904ffc0898ccfda02ffab262b
parent ebe3d638
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment