Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751967AbbH2BdR (ORCPT ); Fri, 28 Aug 2015 21:33:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:55699 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751365AbbH2BdQ (ORCPT ); Fri, 28 Aug 2015 21:33:16 -0400 Message-ID: <1440811986.1831.9.camel@stgolabs.net> Subject: Re: futex atomic vs ordering constraints From: Davidlohr Bueso To: Peter Zijlstra Cc: Thomas Gleixner , Linus Torvalds , Oleg Nesterov , Paul McKenney , Ingo Molnar , mtk.manpages@gmail.com, dvhart@infradead.org, Vineet.Gupta1@synopsys.com, ralf@linux-mips.org, ddaney@caviumnetworks.com, Will Deacon , linux-kernel@vger.kernel.org Date: Fri, 28 Aug 2015 18:33:06 -0700 In-Reply-To: <20150826181659.GW16853@twins.programming.kicks-ass.net> References: <20150826181659.GW16853@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1168 Lines: 27 On Wed, 2015-08-26 at 20:16 +0200, Peter Zijlstra wrote: > Of course, if anything else prior to futex_atomic_op_inuser() implies an > (RCsc) RELEASE or stronger the primitive can do without providing > anything itself. > > This turns out to be the case, a successful get_futex_key() implies a > full memory barrier; recent: 1d0dcb3ad9d3 ("futex: Implement lockless > wakeups"). Hmm while it is certainly true that get_futex_key() implies a full barrier, I don't see why you're referring to the recent wake_q stuff; where the futex "wakeup" is done much after futex_atomic_op_inuser. Yes, that too implies a barrier, but not wrt get_futex_key() -- which fundamentally relies on get_futex_key_refs(). > > And since get_futex_key() is fundamental to doing _anything_ with a > futex, I think its semi-sane to rely on this. Right, and it wouldn't be the first thing that relies on get_futex_key() implying a full barrier. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/