public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rik van Riel <riel@redhat.com>,
	Gregory Haskins <gregory.haskins.ml@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@suse.de>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [patch 1/4] x86: FIFO ticket spinlocks
Date: Fri, 2 Nov 2007 07:42:20 +0100	[thread overview]
Message-ID: <20071102064220.GC20967@wotan.suse.de> (raw)
In-Reply-To: <alpine.LFD.0.999.0711011819110.3342@woody.linux-foundation.org>

On Thu, Nov 01, 2007 at 06:19:41PM -0700, Linus Torvalds wrote:
> 
> 
> On Thu, 1 Nov 2007, Rik van Riel wrote:
> > 
> > Larry Woodman managed to wedge the VM into a state where, on his
> > 4x dual core system, only 2 cores (on the same CPU) could get the
> > zone->lru_lock overnight.  The other 6 cores on the system were
> > just spinning, without being able to get the lock.

That's quite incredible, considering that the CPUs actually _taking_
the locks also drop the locks and do quite a bit of work before taking
them again (ie. they take them to pull pages off the LRU, but then
do a reasonable amount of work to remove each one from pagecache before
refilling from the LRU).

Possibly actually that is a *more* difficult case for the HW to handle:
once the CPU actually goes away and operates on other cachelines, it 
may get a little more difficult to detect that it is causing starvation
issues.


> .. and this is almost always the result of a locking *bug*, not unfairness 
> per se. IOW, unfairness just ends up showing the bug in the first place.

I'd almost agree, but there are always going to be corner cases where
we get multiple contentions on a spinlock -- the fact that a lock is
needed at all obviously suggests that it can be contended. The LRU locking
could be improved, but you could have eg. scheduler runqueue lock starvation
if the planets lined up just right, and it is a little more difficult to
improve on runqueue locking.

Anyway, I also think this is partially a hardware issue, and as muliple
cores, threads, and sockets get more common, I hope it will improve (it
affects Intel CPUs as well as AMD). So it is possible to have an option
to switch between locks if the hardware is fairer, but I want to get
as much exposure with this locking as possible for now, to see if there
is any funny performance corner cases exposed (which quite possibly will
turn out to be caused by suboptimal locking itself).

Anyway, if this can make its way to the x86 tree, I think it will get
pulled into -mm (?) and get some exposure...


  parent reply	other threads:[~2007-11-02  6:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 14:01 [patch 0/4] ticket spinlocks for x86 Nick Piggin
2007-11-01 14:02 ` [patch 1/4] spinlock: lockbreak cleanup Nick Piggin
2007-11-01 14:06   ` Peter Zijlstra
2007-11-01 14:29     ` Nick Piggin
2007-11-01 15:39       ` Lee Schermerhorn
2007-11-01 15:46         ` Ingo Molnar
2007-11-01 15:53           ` Nick Piggin
2007-11-01 14:03 ` [patch 1/4] x86: FIFO ticket spinlocks Nick Piggin
2007-11-01 14:40   ` Gregory Haskins
2007-11-01 16:38     ` Linus Torvalds
2007-11-02  0:35       ` Rik van Riel
2007-11-02  1:19         ` Linus Torvalds
2007-11-02  2:01           ` Rik van Riel
2007-11-02  6:42           ` Nick Piggin [this message]
2007-11-02 14:05             ` Rik van Riel
2007-11-02 22:37               ` Nick Piggin
2007-11-02 15:33             ` Ingo Molnar
2007-11-07  8:46               ` Nick Piggin
2007-11-02 14:24       ` Gregory Haskins
2007-11-01 20:01   ` Chuck Ebbert
2007-11-02  0:00     ` Nick Piggin
2007-11-02 16:22   ` Chuck Ebbert
2007-11-02 16:51     ` Linus Torvalds
2007-11-02 23:01       ` Nick Piggin
2007-11-03  0:56         ` Chuck Ebbert
2007-11-03  3:41           ` Nick Piggin
2007-11-01 14:04 ` [patch 3/4] x86: spinlock.h merge prep Nick Piggin
2007-11-01 14:05 ` [patch 4/4] x86: spinlock.h merge Nick Piggin
2007-11-03 22:36 ` [patch 0/4] ticket spinlocks for x86 Jeremy Fitzhardinge

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=20071102064220.GC20967@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=ak@suse.de \
    --cc=gregory.haskins.ml@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=riel@redhat.com \
    --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