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

locking/mutex: Move MCS related comments to proper location

It serves much better if the comments are right before the osq_lock() call.
Also delete a useless comment.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1420573509-24774-3-git-send-email-dave@stgolabs.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Davidlohr Bueso and committed by
Ingo Molnar
e42f678a 63dc47e9

+5 -11
+5 -11
kernel/locking/mutex.c
··· 193 193 194 194 195 195 #ifdef CONFIG_MUTEX_SPIN_ON_OWNER 196 - /* 197 - * In order to avoid a stampede of mutex spinners from acquiring the mutex 198 - * more or less simultaneously, the spinners need to acquire a MCS lock 199 - * first before spinning on the owner field. 200 - * 201 - */ 202 - 203 - /* 204 - * Mutex spinning code migrated from kernel/sched/core.c 205 - */ 206 - 207 196 static inline bool owner_running(struct mutex *lock, struct task_struct *owner) 208 197 { 209 198 if (lock->owner != owner) ··· 296 307 if (!mutex_can_spin_on_owner(lock)) 297 308 goto done; 298 309 310 + /* 311 + * In order to avoid a stampede of mutex spinners trying to 312 + * acquire the mutex all at once, the spinners need to take a 313 + * MCS (queued) lock first before spinning on the owner field. 314 + */ 299 315 if (!osq_lock(&lock->osq)) 300 316 goto done; 301 317