Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752324AbdHIGtX (ORCPT ); Wed, 9 Aug 2017 02:49:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:47744 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751974AbdHIGtW (ORCPT ); Wed, 9 Aug 2017 02:49:22 -0400 Date: Tue, 8 Aug 2017 23:49:11 -0700 From: Davidlohr Bueso To: Mel Gorman Cc: Thomas Gleixner , Mark Rutland , Linus Torvalds , Ingo Molnar , Davidlohr Bueso , Hugh Dickins , Peter Zijlstra , Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org Subject: Re: [PATCH] futex: Remove unnecessary warning from get_futex_key Message-ID: <20170809064911.GA31085@linux-80c1.suse> References: <20170809062146.yqvn35t2jags65f3@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20170809062146.yqvn35t2jags65f3@suse.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1251 Lines: 32 On Wed, 09 Aug 2017, Mel Gorman wrote: >@@ -676,7 +676,7 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw) > * cases, therefore a successful atomic_inc return below will > * guarantee that get_futex_key() will still imply smp_mb(); (B). You missed the comment above. diff --git a/kernel/futex.c b/kernel/futex.c index 16dbe4c93895..6b4a6a7cad3d 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -670,13 +670,14 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw) * this reference was taken by ihold under the page lock * pinning the inode in place so i_lock was unnecessary. The * only way for this check to fail is if the inode was - * truncated in parallel so warn for now if this happens. + * truncated in parallel -- which is a bizarre scenario, in + * any case, just retry. * * 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 still imply smp_mb(); (B). */ - if (WARN_ON_ONCE(!atomic_inc_not_zero(&inode->i_count))) { + if (!atomic_inc_not_zero(&inode->i_count)) { rcu_read_unlock(); put_page(page); Thanks, Davidlohr