From: Ingo Molnar <mingo@elte.hu>
To: Nathan Lynch <ntl@pobox.com>
Cc: Andrew Morton <akpm@osdl.org>,
anton@au1.ibm.com, linux-kernel@vger.kernel.org,
michael@ellerman.id.au, linuxppc64-dev@ozlabs.org,
serue@us.ibm.com, paulus@au1.ibm.com
Subject: Re: 2.6.15-mm4 failure on power5
Date: Wed, 18 Jan 2006 08:07:34 +0100 [thread overview]
Message-ID: <20060118070734.GB24378@elte.hu> (raw)
In-Reply-To: <20060118064050.GQ2846@localhost.localdomain>
* Nathan Lynch <ntl@pobox.com> wrote:
> Dave C Boutcher wrote:
> > On Tue, Jan 17, 2006 at 10:52:44AM -0600, Dave C Boutcher wrote:
> > > Well, it turns out that I've been running with CONFIG_DEBUG_MUTEXES all
> > > along...so no noise. My console output is a little different that
> > > Serge's, so I think this is timing related. Also note that I'm dying in
> > > the timer interrupt...
> >
> > duh... here's the backtrace
> > 0:mon> t
> > [c000000000577890] c0000000000034b4 decrementer_common+0xb4/0x100
> > --- Exception: 901 (Decrementer) at c0000000004627ec
> > .__mutex_lock_interruptible_slowpath+0x3bc/0x4c4
> > [c000000000577c60] c000000000075064 .__lock_cpu_hotplug+0x44/0xa8
> > [c000000000577ce0] c000000000075600 .register_cpu_notifier+0x24/0x68
> > [c000000000577d70] c00000000052cd7c .do_init_bootmem+0x68c/0xab0
> > [c000000000577e50] c000000000522c84 .setup_arch+0x21c/0x2c0
> > [c000000000577ef0] c00000000051a538 .start_kernel+0x40/0x280
> > [c000000000577f90] c000000000008574 .hmt_init+0x0/0x8c
>
> The mutex debug code (debug_spin_unlock in kernel/mutex-debug.h) is
> doing a local_irq_enable way before we're ready.
>
> BTW: I couldn't build powerpc without mutex debugging until I changed
> the SYNC_ON_SMP in include/asm-powerpc/mutex.h:__mutex_fastpath_unlock
> to ISYNC_ON_SMP.
>
> With that change, I was able to boot semi-successfully with mutex
> debugging off -- the system got hung up when udev started, apparently
> (or maybe I was too impatient).
ugh! Does the patch below get you a working system with DEBUG_MUTEXES=n?
Ingo
--
revert the ppc64 mutex fastpath assembly optimizations for now.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
----
include/asm-powerpc/mutex.h | 85 ++------------------------------------------
1 files changed, 5 insertions(+), 80 deletions(-)
Index: linux/include/asm-powerpc/mutex.h
===================================================================
--- linux.orig/include/asm-powerpc/mutex.h
+++ linux/include/asm-powerpc/mutex.h
@@ -1,84 +1,9 @@
/*
- * include/asm-powerpc/mutex.h
+ * Pull in the generic implementation for the mutex fastpath.
*
- * PowerPC optimized mutex locking primitives
- *
- * Please look into asm-generic/mutex-xchg.h for a formal definition.
- * Copyright (C) 2006 Joel Schopp <jschopp@austin.ibm.com>, IBM
+ * TODO: implement optimized primitives instead, or leave the generic
+ * implementation in place, or pick the atomic_xchg() based generic
+ * implementation. (see asm-generic/mutex-xchg.h for details)
*/
-#ifndef _ASM_MUTEX_H
-#define _ASM_MUTEX_H
-#define __mutex_fastpath_lock(count, fail_fn)\
-do{ \
- int tmp; \
- __asm__ __volatile__( \
-"1: lwarx %0,0,%1\n" \
-" addic %0,%0,-1\n" \
-" stwcx. %0,0,%1\n" \
-" bne- 1b\n" \
- ISYNC_ON_SMP \
- : "=&r" (tmp) \
- : "r" (&(count)->counter) \
- : "cr0", "memory"); \
- if (unlikely(tmp < 0)) \
- fail_fn(count); \
-} while (0)
-
-#define __mutex_fastpath_unlock(count, fail_fn)\
-do{ \
- int tmp; \
- __asm__ __volatile__(SYNC_ON_SMP\
-"1: lwarx %0,0,%1\n" \
-" addic %0,%0,1\n" \
-" stwcx. %0,0,%1\n" \
-" bne- 1b\n" \
- : "=&r" (tmp) \
- : "r" (&(count)->counter) \
- : "cr0", "memory"); \
- if (unlikely(tmp <= 0)) \
- fail_fn(count); \
-} while (0)
-
-
-static inline int
-__mutex_fastpath_trylock(atomic_t* count, int (*fail_fn)(atomic_t*))
-{
- int tmp;
- __asm__ __volatile__(
-"1: lwarx %0,0,%1\n"
-" cmpwi 0,%0,1\n"
-" bne- 2f\n"
-" addic %0,%0,-1\n"
-" stwcx. %0,0,%1\n"
-" bne- 1b\n"
-" isync\n"
-"2:"
- : "=&r" (tmp)
- : "r" (&(count)->counter)
- : "cr0", "memory");
-
- return (int)tmp;
-
-}
-
-#define __mutex_slowpath_needs_to_unlock() 1
-static inline int
-__mutex_fastpath_lock_retval(atomic_t* count, int (*fail_fn)(atomic_t *))
-{
- int tmp;
- __asm__ __volatile__(
-"1: lwarx %0,0,%1\n"
-" addic %0,%0,-1\n"
-" stwcx. %0,0,%1\n"
-" bne- 1b\n"
-" isync \n"
- : "=&r" (tmp)
- : "r" (&(count)->counter)
- : "cr0", "memory");
- if (unlikely(tmp < 0))
- return fail_fn(count);
- else
- return 0;
-}
-#endif
+#include <asm-generic/mutex-dec.h>
next prev parent reply other threads:[~2006-01-18 7:07 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-16 6:35 2.6.15-mm4 failure on power5 Serge E. Hallyn
2006-01-16 7:05 ` Andrew Morton
2006-01-16 13:00 ` Michael Ellerman
2006-01-16 15:37 ` Serge E. Hallyn
2006-01-16 21:52 ` Dave C Boutcher
2006-01-17 1:09 ` Andrew Morton
2006-01-17 8:17 ` Ingo Molnar
2006-01-17 8:47 ` Andrew Morton
2006-01-17 16:52 ` Dave C Boutcher
2006-01-17 16:55 ` Dave C Boutcher
2006-01-18 6:40 ` Nathan Lynch
2006-01-18 7:07 ` Ingo Molnar [this message]
2006-01-18 7:53 ` Nathan Lynch
2006-01-18 8:08 ` Nathan Lynch
2006-01-17 12:22 ` Serge E. Hallyn
2006-01-17 13:32 ` Michael Ellerman
2006-01-17 14:00 ` Ingo Molnar
2006-01-18 0:19 ` Michael Ellerman
2006-01-18 3:32 ` Dave C Boutcher
2006-01-18 6:37 ` Ingo Molnar
2006-01-18 6:53 ` Andrew Morton
2006-01-18 7:04 ` Ingo Molnar
2006-01-18 7:28 ` Nathan Lynch
2006-01-18 7:37 ` Andrew Morton
2006-01-18 8:08 ` Ingo Molnar
2006-01-18 8:24 ` Andrew Morton
2006-01-18 9:02 ` [patch] work around ppc64 bootup bug by making mutex-debugging save/restore irqs Ingo Molnar
2006-01-18 9:18 ` [patch] turn on might_sleep() in early bootup code too Ingo Molnar
2006-01-18 10:35 ` Andrew Morton
2006-01-18 10:43 ` Ingo Molnar
2006-01-18 11:15 ` [patch] make bug messages more consistent Ingo Molnar
2006-01-19 4:39 ` [patch] turn on might_sleep() in early bootup code too Zwane Mwaikambo
2006-01-18 10:46 ` Nick Piggin
2006-01-18 11:07 ` Ingo Molnar
2006-01-18 12:53 ` [patch] add trylock_kernel() Ingo Molnar
2006-01-18 7:38 ` 2.6.15-mm4 failure on power5 Arjan van de Ven
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=20060118070734.GB24378@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=anton@au1.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc64-dev@ozlabs.org \
--cc=michael@ellerman.id.au \
--cc=ntl@pobox.com \
--cc=paulus@au1.ibm.com \
--cc=serue@us.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).