linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: bigeasy@linutronix.de,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	daniel.wagner@siemens.com, Will Deacon <will.deacon@arm.com>,
	x86@kernel.org, Linus Torvalds <torvalds@linux-foundation.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	boqun.feng@gmail.com, Paul McKenney <paulmck@linux.vnet.ibm.com>
Subject: Re: [Problem] Cache line starvation
Date: Wed, 3 Oct 2018 10:23:04 +0200	[thread overview]
Message-ID: <20181003082304.GL26858@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAHkRjk4Vvv5rc+habecu2xPiFGZ37onRzy1kCnFcBH2115U8jQ@mail.gmail.com>

On Wed, Oct 03, 2018 at 08:51:50AM +0100, Catalin Marinas wrote:
> On Fri, 21 Sep 2018 at 13:22, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Fri, Sep 21, 2018 at 02:02:26PM +0200, Sebastian Andrzej Siewior wrote:
> > > We reproducibly observe cache line starvation on a Core2Duo E6850 (2
> > > cores), a i5-6400 SKL (4 cores) and on a NXP LS2044A ARM Cortex-A72 (4
> > > cores).
> > >
> > > The problem can be triggered with a v4.9-RT kernel by starting
> >
> > > Daniel reported that disabling ticket locks on 4.4 makes the problem go
> > > away, but he hasn't run a long time test yet and as we saw with 4.14 it can
> > > take quite a while.
> >
> > On 4.4 and 4.9 ARM64 still uses ticket locks. So I'm very interested to
> > know if the ticket locks on x86 really fix or just make it harder.
> >
> > I've been looking at qspinlock in the light of this and there is indeed
> > room for improvement. The ticket lock certainly is much simpler.
> 
> FWIW, in the qspinlock TLA+ model [1], if I replace the
> atomic_fetch_or() model with a try_cmpxchg loop, it violates the
> liveness properties with only 2 CPUs as one keeps locking/unlocking,
> hence changing the lock value, while the other repeatedly fails the
> cmpxchg. Your latest qspinlock patches seem to address this (couldn't
> get it to fail but the model is only sequentially consistent). Not
> sure that's what Sebastian is seeing but without your proposed
> qspinlock changes, ticket spinlocks may be a better bet for RT.

Right, and agreed. I did raise that point when you initially proposed
that fetch_or() for liveliness.


  parent reply	other threads:[~2018-10-03  8:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21 12:02 [Problem] Cache line starvation Sebastian Andrzej Siewior
2018-09-21 12:13 ` Thomas Gleixner
2018-09-21 12:50   ` Sebastian Andrzej Siewior
2018-09-21 12:20 ` Peter Zijlstra
2018-09-21 12:54   ` Thomas Gleixner
2018-10-03  7:51   ` Catalin Marinas
2018-10-03  8:07     ` Thomas Gleixner
2018-10-03  8:28       ` Peter Zijlstra
2018-10-03 10:43         ` Thomas Gleixner
2018-10-03  8:23     ` Peter Zijlstra [this message]
2018-09-26  7:34 ` Peter Zijlstra
2018-09-26  8:04   ` Thomas Gleixner
2018-09-26 12:53 ` Will Deacon
2018-09-27 14:25   ` Kurt Kanzenbach
2018-09-27 14:41     ` Kurt Kanzenbach
2018-09-27 14:47       ` Thomas Gleixner
2018-09-28  9:05         ` Kurt Kanzenbach
2018-09-28 15:26           ` Kurt Kanzenbach
2018-09-28 19:26         ` Sebastian Andrzej Siewior
2018-09-28 19:34           ` Thomas Gleixner
2018-10-02  6:31 ` Daniel Wagner

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=20181003082304.GL26858@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bigeasy@linutronix.de \
    --cc=boqun.feng@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=daniel.wagner@siemens.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=torvalds@linux-foundation.org \
    --cc=will.deacon@arm.com \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).