aboutsummaryrefslogtreecommitdiff
path: root/kernel/rtmutex.c
diff options
context:
space:
mode:
authorNicholas Mc Guire <der.herr@hofr.at>2015-01-23 12:41:47 +0100
committerMoyster <oysterized@gmail.com>2016-08-26 20:20:23 +0200
commitc941b10f69f31a4fbbbaf99d8161062b65a911a0 (patch)
tree2d2950f5fc65d8438c55216dc43f261b4c293964 /kernel/rtmutex.c
parent478c700c01cb041a95a4540915717c3012d1e5b2 (diff)
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: Nicholas Mc Guire <der.herr@hofr.at> Signed-off-by: Peter 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: Ingo Molnar <mingo@kernel.org> Signed-off-by: Stefan Guendhoer <stefan@guendhoer.com>
Diffstat (limited to 'kernel/rtmutex.c')
0 files changed, 0 insertions, 0 deletions