From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751430AbcEIOaB (ORCPT ); Mon, 9 May 2016 10:30:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:43389 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbcEIOaA (ORCPT ); Mon, 9 May 2016 10:30:00 -0400 Date: Mon, 9 May 2016 07:29:23 -0700 From: Davidlohr Bueso To: Peter Hurley Cc: mingo@kernel.org, peterz@infradead.org, tglx@linutronix.de, Waiman.Long@hpe.com, jason.low2@hp.com, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH 1/4] locking/rwsem: Avoid stale ->count for rwsem_down_write_failed() Message-ID: <20160509142923.GA29630@linux-uzut.site> References: <1462769770-29363-1-git-send-email-dave@stgolabs.net> <1462769770-29363-2-git-send-email-dave@stgolabs.net> <573021D5.4070406@hurleysoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <573021D5.4070406@hurleysoftware.com> 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 Sun, 08 May 2016, Peter Hurley wrote: >On 05/08/2016 09:56 PM, Davidlohr Bueso wrote: >> The field is obviously updated w.o the lock and needs a READ_ONCE >> while waiting for lock holder(s) to go away, just like we do with >> all other ->count accesses. > >This isn't actually fixing a bug because it's passed through >several full barriers which will force reloading from sem->count. Yes. > >I think the patch is ok if you want it just for consistency anyway, >but please change $subject and changelog. Yeah, I wasn't actually concerned about a specific bug, it was more just for documentation and consistency. This code has been like this for ever, but it would still be good to have the READ_ONCE. It is slightly suboptimal to use, but I do not see any real impact either. Thanks, Davidlohr