From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756212AbcE0QwS (ORCPT ); Fri, 27 May 2016 12:52:18 -0400 Received: from Chamillionaire.breakpoint.cc ([80.244.247.6]:35211 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755851AbcE0QwR convert rfc822-to-8bit (ORCPT ); Fri, 27 May 2016 12:52:17 -0400 Date: Fri, 27 May 2016 18:52:11 +0200 From: Sebastian Andrzej Siewior To: Peter Zijlstra Cc: Thomas Gleixner , LKML , Sebastian Andrzej Siewior , Linus Torvalds , Darren Hart , Ingo Molnar , Michael Kerrisk , Davidlohr Bueso , Chris Mason , "Carlos O'Donell" , Torvald Riegel , Eric Dumazet Subject: Re: [patch V2 2/7] futex: Hash private futexes per process Message-ID: <20160527165211.GB28561@breakpoint.cc> References: <20160505204230.932454245@linutronix.de> <20160505204353.973009518@linutronix.de> <20160519122148.GZ3192@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20160519122148.GZ3192@twins.programming.kicks-ass.net> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016-05-19 14:21:48 [+0200], Peter Zijlstra wrote: > > +static void futex_populate_hash(unsigned int hash_bits) > > +{ … > > + raw_spin_lock(&mm->futex_hash.lock); > > + /* We might have raced with another task allocating the hash. */ > > + if (!mm->futex_hash.hash) { > > + mm->futex_hash.hash_bits = hash_bits; > > + /* > > + * Ensure that the above is visible before we store > > + * the pointer. > > + */ > > + smp_wmb(); /* (A0) Pairs with (B) */ > > + mm->futex_hash.hash = hb; > > smp_store_release(&mm->futex_hash.hash, hb); ? just to be clear: You suggest to use "smp_store_release()" instead smp_wmb() followed by the assignment? Sebastian