Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

futex: Enhance comments in futex_lock_pi() for blocking paths

... serves a bit better to clarify between blocking
and non-blocking code paths.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Darren Hart <darren@dvhart.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Link: http://lkml.kernel.org/r/1435645562-975-2-git-send-email-dave@stgolabs.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Davidlohr Bueso and committed by
Thomas Gleixner
767f509c 0e06e5be

+9 -2
+9 -2
kernel/futex.c
··· 2268 2268 /* 2269 2269 * Userspace tried a 0 -> TID atomic transition of the futex value 2270 2270 * and failed. The kernel side here does the whole locking operation: 2271 - * if there are waiters then it will block, it does PI, etc. (Due to 2272 - * races the kernel might see a 0 value of the futex too.) 2271 + * if there are waiters then it will block as a consequence of relying 2272 + * on rt-mutexes, it does PI, etc. (Due to races the kernel might see 2273 + * a 0 value of the futex too.). 2274 + * 2275 + * Also serves as futex trylock_pi()'ing, and due semantics. 2273 2276 */ 2274 2277 static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, 2275 2278 ktime_t *time, int trylock) ··· 2303 2300 2304 2301 ret = futex_lock_pi_atomic(uaddr, hb, &q.key, &q.pi_state, current, 0); 2305 2302 if (unlikely(ret)) { 2303 + /* 2304 + * Atomic work succeeded and we got the lock, 2305 + * or failed. Either way, we do _not_ block. 2306 + */ 2306 2307 switch (ret) { 2307 2308 case 1: 2308 2309 /* We got the lock. */