From: Nicholas Mc Guire Date: Fri, 23 Jan 2015 11:41:47 +0000 (+0100) Subject: sched/completion: Add lock-free checking of the blocking case X-Git-Tag: omap-for-v4.1/prcm-dts-mfd-syscon-fix~165^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c34e3180a01c800a40bc8535654d5735802fc1b;p=pandora-kernel.git 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 Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Link: http://lkml.kernel.org/r/1422013307-13200-1-git-send-email-der.herr@hofr.at Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed