public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Davidlohr Bueso <davidlohr@hp.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Darren Hart <dvhart@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Paul McKenney <paulmck@linux.vnet.ibm.com>,
	Mike Galbraith <efault@gmx.de>, Jeff Mahoney <jeffm@suse.com>,
	Jason Low <jason.low2@hp.com>, Waiman Long <Waiman.Long@hp.com>,
	Tom Vaden <tom.vaden@hp.com>,
	"Norton, Scott J" <scott.norton@hp.com>,
	"Chandramouleeswaran, Aswin" <aswin@hp.com>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH v3 4/4] futex: Avoid taking hb lock if nothing to wakeup
Date: Fri, 20 Dec 2013 09:54:26 +0100	[thread overview]
Message-ID: <20131220085426.GZ21999@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CA+55aFyrZmG6rNpY22OK3UQi18e=4UQyh8a3tpxY+QVCbNxXkw@mail.gmail.com>

On Thu, Dec 19, 2013 at 07:13:09PM -0800, Linus Torvalds wrote:
> I think we might have to order the two reads with an smp_rmb - making
> sure that we check the lock state first - but I think it should be
> otherwise pretty solid.

> Yeah, I said "spin_contended()" myself initially, but it needs to be
> "spin_is_locked()". It's hopefully unlikely to ever actually be
> contended (which in ticket lock terms is "head is _more_ than one away
> from the tail").


Right, which would give us something like:

  LOCK m		is_locked m
  list_{add,del}	RMB
  UNLOCK m		list_empty

Where the rmb matches the release/unlock. This guarantees that when we
see the unlock we must also see the list modification.



  parent reply	other threads:[~2013-12-20  8:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-19 18:45 [PATCH v3 0/4] futex: Wakeup optimizations Davidlohr Bueso
2013-12-19 18:45 ` [PATCH v3 1/4] futex: Misc cleanups Davidlohr Bueso
2013-12-19 18:45 ` [PATCH v3 2/4] futex: Larger hash table Davidlohr Bueso
2013-12-19 18:45 ` [PATCH v3 3/4] futex: Document ordering guarantees Davidlohr Bueso
2013-12-19 18:45 ` [PATCH v3 4/4] futex: Avoid taking hb lock if nothing to wakeup Davidlohr Bueso
2013-12-19 19:25   ` Ingo Molnar
2013-12-19 19:29     ` Davidlohr Bueso
2013-12-19 19:42       ` Ingo Molnar
2013-12-19 22:35         ` Joe Perches
2013-12-20  9:11           ` Peter Zijlstra
2013-12-20 10:27             ` Ingo Molnar
2013-12-19 23:14   ` Linus Torvalds
2013-12-19 23:42     ` Davidlohr Bueso
2013-12-19 23:53       ` Linus Torvalds
2013-12-20  0:04         ` Linus Torvalds
2013-12-20  0:26           ` Darren Hart
2013-12-20  0:12         ` Linus Torvalds
2013-12-20  2:22         ` Davidlohr Bueso
2013-12-20  3:13           ` Linus Torvalds
2013-12-20  6:13             ` Davidlohr Bueso
2013-12-20  8:54             ` Peter Zijlstra [this message]
2013-12-20 19:30     ` Davidlohr Bueso
2013-12-20 19:54       ` Linus Torvalds
2013-12-21  5:57         ` Davidlohr Bueso
2013-12-21  1:36     ` Davidlohr Bueso
2013-12-21  2:34       ` Darren Hart
2013-12-21  3:08         ` Davidlohr Bueso
2013-12-25  3:13       ` Waiman Long
2014-01-02 11:37         ` Davidlohr Bueso
  -- strict thread matches above, loose matches on Subject: below --
2013-12-03  9:45 [PATCH v2 0/4] futex: Wakeup optimizations Davidlohr Bueso
2013-12-03  9:45 ` [PATCH v2 4/4] futex: Avoid taking hb lock if nothing to wakeup Davidlohr Bueso
2013-12-10 18:10   ` [PATCH v3 " Davidlohr Bueso

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=20131220085426.GZ21999@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Waiman.Long@hp.com \
    --cc=aswin@hp.com \
    --cc=davidlohr@hp.com \
    --cc=dvhart@linux.intel.com \
    --cc=efault@gmx.de \
    --cc=jason.low2@hp.com \
    --cc=jeffm@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=scott.norton@hp.com \
    --cc=tglx@linutronix.de \
    --cc=tom.vaden@hp.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