[PATCH] Fix spinlock owner debugging

fix up the runqueue lock owner only if we truly did a context-switch
with the runqueue lock held. Impacts ia64, mips, sparc64 and arm.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Ingo Molnar and committed by Linus Torvalds da04c035 33333373

+4 -4
+4 -4
kernel/sched.c
··· 294 295 static inline void finish_lock_switch(runqueue_t *rq, task_t *prev) 296 { 297 spin_unlock_irq(&rq->lock); 298 } 299 ··· 1533 * Manfred Spraul <manfred@colorfullife.com> 1534 */ 1535 prev_task_flags = prev->flags; 1536 - #ifdef CONFIG_DEBUG_SPINLOCK 1537 - /* this is a valid case when another task releases the spinlock */ 1538 - rq->lock.owner = current; 1539 - #endif 1540 finish_arch_switch(prev); 1541 finish_lock_switch(rq, prev); 1542 if (mm)
··· 294 295 static inline void finish_lock_switch(runqueue_t *rq, task_t *prev) 296 { 297 + #ifdef CONFIG_DEBUG_SPINLOCK 298 + /* this is a valid case when another task releases the spinlock */ 299 + rq->lock.owner = current; 300 + #endif 301 spin_unlock_irq(&rq->lock); 302 } 303 ··· 1529 * Manfred Spraul <manfred@colorfullife.com> 1530 */ 1531 prev_task_flags = prev->flags; 1532 finish_arch_switch(prev); 1533 finish_lock_switch(rq, prev); 1534 if (mm)