Re: 2.6.14-rc1 BUG: spinlock wrong owner on CPU#0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Keith Owens <[email protected]> wrote:

> Booting 2.6.14-rc1 on ia64, I sometimes get
> 
> BUG: spinlock wrong owner on CPU#0, swapper/1
>  lock: e000003003014940, .magic: dead4ead, .owner: pdflush/75, .owner_cpu: 0

hm, ia64 uses __ARCH_WANT_UNLOCKED_CTXSW and thus it releases the 
runqueue lock early - so a certain assumption in the new, improved 
spinlock debugging code does not apply. Does the patch below help?

	Ingo

----

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 <[email protected]>

--- kernel/sched.c.orig
+++ kernel/sched.c
@@ -294,6 +294,10 @@ static inline void prepare_lock_switch(r
 
 static inline void finish_lock_switch(runqueue_t *rq, task_t *prev)
 {
+#ifdef CONFIG_DEBUG_SPINLOCK
+	/* this is a valid case when another task releases the spinlock */
+	rq->lock.owner = current;
+#endif
 	spin_unlock_irq(&rq->lock);
 }
 
@@ -1529,10 +1533,6 @@ static inline void finish_task_switch(ru
 	 *		Manfred Spraul <[email protected]>
 	 */
 	prev_task_flags = prev->flags;
-#ifdef CONFIG_DEBUG_SPINLOCK
-	/* this is a valid case when another task releases the spinlock */
-	rq->lock.owner = current;
-#endif
 	finish_arch_switch(prev);
 	finish_lock_switch(rq, prev);
 	if (mm)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux