mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Keith Owens <kaos@ocs.com.au>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: 2.6.13-rc1 CONFIG_DEBUG_SPINLOCK is useless on SMP
Date: Fri, 1 Jul 2005 08:57:21 +0200	[thread overview]
Message-ID: <20050701065721.GA17321@elte.hu> (raw)
In-Reply-To: <6140.1120192710@kao2.melbourne.sgi.com>


* 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

      reply	other threads:[~2005-07-01  6:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-01  4:38 Keith Owens
2005-07-01  6:57 ` Ingo Molnar [this message]

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=20050701065721.GA17321@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®