The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Nick Piggin <npiggin@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: queued spinlock code and results
Date: 08 Jul 2007 13:18:10 +0200	[thread overview]
Message-ID: <p733azz16vh.fsf@bingen.suse.de> (raw)
In-Reply-To: <20070708043228.GB22397@wotan.suse.de>

Nick Piggin <npiggin@suse.de> writes:

> I made some tests of the queued spinlock code using userspace test code on
> 64-bit processors. I believe the xadd based code no longer has any theoretical
> memory ordering problems.

Linus, the background of this is that on 8 socket Opteron systems
the current spinlocks can become very unfair to the point of severe 
starvation. These boxes are becomming more common.

> The threaded results also attempt to have an unfairness count, which is the
> max number of times in a row that a lock is acquired,  when all other threads
> are also executing in the loop -- the reason xadd for example is not always
> 0 there is because the other threads may not have reached the lock before
> the current thread was able to get it several times (eg. if an interrupt
> comes in, this could happen).

Interesting. I was also thinking about switching the lock types
at boot time. Since all the lock calls are out of line this would
be reasonably easy.

I would say the main drawback of switchable and queued locks 
would be also that they require a larger spinlock_t thus increasing
cache usage

e.g. it would probably hurt for the large spinlock tables used 
by TCP, but then those should be fixed anyways to be smaller.

-Andi


  reply	other threads:[~2007-07-08 10:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08  4:32 queued spinlock code and results Nick Piggin
2007-07-08 11:18 ` Andi Kleen [this message]
2007-07-08 10:40   ` Nick Piggin
2007-07-08 16:49   ` Linus Torvalds
2007-07-10 20:52   ` Christoph Lameter
2007-07-11  2:06     ` Nick Piggin
2007-07-11  2:26       ` Christoph Lameter
2007-07-11  4:51         ` Nick Piggin
2007-07-09 19:01 ` Davide Libenzi
2007-07-09 19:16   ` Davide Libenzi
2007-07-09 19:26   ` Linus Torvalds
2007-07-09 19:47     ` Davide Libenzi
2007-07-09 19:55       ` Linus Torvalds
2007-07-09 20:08         ` Linus Torvalds

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=p733azz16vh.fsf@bingen.suse.de \
    --to=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@suse.de \
    --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