mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@suse.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [rfc][patch 2/2] x86_64: FIFO ticket spinlocks
Date: Mon, 16 Jul 2007 12:18:28 +0200	[thread overview]
Message-ID: <20070716101828.GE21464@wotan.suse.de> (raw)
In-Reply-To: <20070716094940.GA23080@elte.hu>

On Mon, Jul 16, 2007 at 11:49:40AM +0200, Ingo Molnar wrote:
> 
> * Nick Piggin <npiggin@suse.de> wrote:
> 
> > On Mon, Jul 16, 2007 at 11:26:46AM +0200, Ingo Molnar wrote:
> > > 
> > > * Nick Piggin <npiggin@suse.de> wrote:
> > > 
> > > > [...] trylock is more significantly slower, but they are relatively 
> > > > rare.
> > > 
> > > trylock is the main thing that the spinlock debugging code uses, and 
> > > SPINLOCK_DEBUG is frequently enabled by distro kernels. OTOH, the cost 
> > > looks like to be +5 instructions, right? Still ...
> > 
> > Which trylocks do you mean? The lockbreak spinlocks use trylock, but 
> > those are not used with the ticket version.
> 
> the trylocks in lib/spinlock-debug.c:
> 
>  static void __spin_lock_debug(spinlock_t *lock)
>  {
>  ...
>                          if (__raw_spin_trylock(&lock->raw_lock))
>                                  return;
>  ...
>  void _raw_spin_lock(spinlock_t *lock)
>  {
>          debug_spin_lock_before(lock);
>          if (unlikely(!__raw_spin_trylock(&lock->raw_lock)))
>                  __spin_lock_debug(lock);
>          debug_spin_lock_after(lock);
>  }
> 
> am i missing something?

No, I missed that. Yeah, that would get a bit slower, but I'm not sure
if it would be a problem on a kernel where you have spinlock debuggin
on anyway.

If it becomes a problem, we could perhaps do a version for ticket locks
that first takes a ticket, and then is for up to a second before
printing the stuck lock message. That would make the performance hit go away.


  reply	other threads:[~2007-07-16 10:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-16  4:59 [rfc][patch 1/2] spinlock: lockbreak cleanups Nick Piggin
2007-07-16  5:01 ` [rfc][patch 2/2] x86_64: FIFO ticket spinlocks Nick Piggin
2007-07-16  9:16   ` Alan Cox
2007-07-16  9:24     ` Nick Piggin
2007-07-16  9:26   ` Ingo Molnar
2007-07-16  9:45     ` Nick Piggin
2007-07-16  9:49       ` Ingo Molnar
2007-07-16 10:18         ` Nick Piggin [this message]
2007-07-17 14:25   ` Andi Kleen
2007-07-17 15:08     ` Nick Piggin

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=20070716101828.GE21464@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.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®