mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 2.6.13-rc1 CONFIG_DEBUG_SPINLOCK is useless on SMP
@ 2005-07-01  4:38 Keith Owens
  2005-07-01  6:57 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Keith Owens @ 2005-07-01  4:38 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel

2.6.13-rc1 built with SMP=Y and DEBUG_SPINLOCK=y.  That uses
kernel/spinlock.c instead of the inline definitions of the spinlock
functions.  Alas only the inline definitions test for DEBUG_SPINLOCK=y,
none of the code in in spinlock.c has any debug facilities.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 2.6.13-rc1 CONFIG_DEBUG_SPINLOCK is useless on SMP
  2005-07-01  4:38 2.6.13-rc1 CONFIG_DEBUG_SPINLOCK is useless on SMP Keith Owens
@ 2005-07-01  6:57 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2005-07-01  6:57 UTC (permalink / raw)
  To: Keith Owens; +Cc: linux-kernel, Andrew Morton


* Keith Owens <kaos@ocs.com.au> wrote:

> 2.6.13-rc1 built with SMP=Y and DEBUG_SPINLOCK=y.  That uses 
> kernel/spinlock.c instead of the inline definitions of the spinlock 
> functions.  Alas only the inline definitions test for 
> DEBUG_SPINLOCK=y, none of the code in in spinlock.c has any debug 
> facilities.

the spinlock cleanups in -mm (not yet in -git) obsolete most of the 
debugging approach of the current kernel.

but even in terms of 2.6.13-rc1, i'm not completely sure what you mean.
Yes, there's no debugging code in kernel/spinlock.c because much of the
DEBUG_SPINLOCK code (under the old method) is located in the arch
spinlock.h files. I.e. on x86 you'll get SMP spinlock debugging from
asm-i386/spinlock.h:

 static inline void _raw_spin_lock(spinlock_t *lock)
 {
 #ifdef CONFIG_DEBUG_SPINLOCK
         if (unlikely(lock->magic != SPINLOCK_MAGIC)) {
                 printk("eip: %p\n", __builtin_return_address(0));
                 BUG();
         }
 #endif

the only practical exception is when CONFIG_PREEMPT is enabled: the arch 
level trylock, upon which the PREEMPT spinlocks rely on heavily, has no 
meaningful DEBUG_SPINLOCK checks. (but PREEMPT has other checks which 
partly offset this.) In any case, this too is fixed by my spinlock 
cleanups - there all debugging is done centrally in 
lib/spinlock_debug.c.

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-07-01  6:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-01  4:38 2.6.13-rc1 CONFIG_DEBUG_SPINLOCK is useless on SMP Keith Owens
2005-07-01  6:57 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®