From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758145AbcBDRva (ORCPT ); Thu, 4 Feb 2016 12:51:30 -0500 Received: from www.linutronix.de ([62.245.132.108]:40419 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756784AbcBDRv2 (ORCPT ); Thu, 4 Feb 2016 12:51:28 -0500 Date: Thu, 4 Feb 2016 18:50:07 +0100 (CET) From: Thomas Gleixner To: Davidlohr Bueso cc: Mel Gorman , Peter Zijlstra , Ingo Molnar , Sebastian Andrzej Siewior , Chris Mason , Darren Hart , Hugh Dickins , linux-kernel@vger.kernel.org, Davidlohr Bueso , Mel Gorman Subject: Re: [PATCH v5] futex: Remove requirement for lock_page in get_futex_key In-Reply-To: <20160204174343.GA12375@linux-uzut.site> Message-ID: References: <1454567326-16114-1-git-send-email-dave@stgolabs.net> <20160204174343.GA12375@linux-uzut.site> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 4 Feb 2016, Davidlohr Bueso wrote: > On Thu, 04 Feb 2016, Thomas Gleixner wrote: > > > On Wed, 3 Feb 2016, Davidlohr Bueso wrote: > > > + * We are not calling into get_futex_key_refs() in file-backed > > > + * cases, therefore a successful atomic_inc return below will > > > + * guarantee that get_futex_key() will continue to imply MB > > > (B). > > > > Can you please make that "MB (B)" part a bit more outstanding. I really had > > to > > search for it. > > Hmm as you know this is mostly explained at the begining of the file, and we > sprinkle MB (B) around the code based on that description. So I'm a bit > confused > as to why you don't like like that comment. The other "MB (B)" places are more outstanding. It did not spring in my eye immideately. So it's a pure cosmetic issue. > > > + */ > > > + if (WARN_ON_ONCE(!atomic_inc_not_zero(&inode->i_count))) { > > > + rcu_read_unlock(); > > > + put_page(page); > > > + > > > + goto again; > > > + } > > > > Don't we need > > > > smp_mb__after_atomic(); > > > > here to make it a full barrier on all architectures? > > I had this initially but, as Peter mentioned, we get that barrier with the > successful atomic_inc_not_zero call anyway. Or is it something else you had > in mind? Oh. I missed that comment from Peter. And yes, I missed that atomic_inc_not_zero() already has the barrier in the success case. :( Thanks, tglx