public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Keith Owens <kaos@sgi.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	Linus Torvalds <torvalds@osdl.org>
Subject: Re: 2.6.14-rc1 BUG: spinlock wrong owner on CPU#0
Date: Tue, 13 Sep 2005 11:17:59 +0200	[thread overview]
Message-ID: <20050913091759.GA11485@elte.hu> (raw)
In-Reply-To: <26068.1126598310@kao2.melbourne.sgi.com>


* Keith Owens <kaos@sgi.com> 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 <mingo@elte.hu>

--- 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 <manfred@colorfullife.com>
 	 */
 	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)

  reply	other threads:[~2005-09-13  9:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13  7:58 2.6.14-rc1 BUG: spinlock wrong owner on CPU#0 Keith Owens
2005-09-13  9:17 ` Ingo Molnar [this message]
2005-09-13  9:45   ` Keith Owens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050913091759.GA11485@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=kaos@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox