From: Davidlohr Bueso <dave@stgolabs.net>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <umgwanakikbuti@gmail.com>,
Petros Koutoupis <petros@petroskoutoupis.com>,
linux-kernel@vger.kernel.org,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
catalin.marinas@arm.com, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: futex: clarification needed with drop_futex_key_refs and memory barriers
Date: Fri, 1 Apr 2016 23:39:19 -0700 [thread overview]
Message-ID: <20160402063919.GD5329@linux-uzut.site> (raw)
In-Reply-To: <20160329095039.GE3408@twins.programming.kicks-ass.net>
On Tue, 29 Mar 2016, Peter Zijlstra wrote:
>In any case; the below (completely irrelevant patch for you) is
>something I would propose. It gives hb_waiter_dec() RELEASE like
>semantics and ensures it cannot creep into the lock sections its
>typically behind. Although strictly speaking I think it being inside
>that lock region is sufficient.
Indeed, it should be sufficient. Racing with waiter decrements
(leaking into the hb critical region) is perfectly ok as the
consequence is that the reader thread will simply go take the lock
by not seeing the 1->0 dec, and therefore no harm done. Something that
0->1 cannot afford to rely on, obviously. So I think we can save the extra
barrier for the release semantics and keep the call relaxed, as the
performance penalty would be higher. Or are you referring to something else?
>
>It also re-orders the increment in requeue to happen before we add to
>the list (as is the proper order)
ack to this part -- should be a separate patch.
Thanks,
Davidlohr
prev parent reply other threads:[~2016-04-02 6:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-26 15:56 futex: clarification needed with drop_futex_key_refs and memory barriers Petros Koutoupis
2016-03-27 6:25 ` Mike Galbraith
2016-03-29 9:50 ` Peter Zijlstra
2016-03-31 1:45 ` Petros Koutoupis
2016-03-31 7:36 ` Peter Zijlstra
2016-04-02 6:39 ` Davidlohr Bueso [this message]
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=20160402063919.GD5329@linux-uzut.site \
--to=dave@stgolabs.net \
--cc=catalin.marinas@arm.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=petros@petroskoutoupis.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=umgwanakikbuti@gmail.com \
/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