From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752528AbdIAVPn (ORCPT ); Fri, 1 Sep 2017 17:15:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44090 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752397AbdIAVPl (ORCPT ); Fri, 1 Sep 2017 17:15:41 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8C97E806B8 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dhowells@redhat.com Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20170901164233.wu4fdljpivzf5idb@hirez.programming.kicks-ass.net> References: <20170901164233.wu4fdljpivzf5idb@hirez.programming.kicks-ass.net> <150428045304.25051.1778333106306853298.stgit@warthog.procyon.org.uk> <150428046185.25051.3518486828049323804.stgit@warthog.procyon.org.uk> To: Peter Zijlstra Cc: dhowells@redhat.com, linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, Kees Cook , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 02/11] refcount: Implement inc/decrement-and-return functions MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3695.1504300539.1@warthog.procyon.org.uk> Date: Fri, 01 Sep 2017 22:15:39 +0100 Message-ID: <3696.1504300539@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 01 Sep 2017 21:15:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter Zijlstra wrote: > > unsigned int refcount_dec_return(refcount_t *r); > > unsigned int refcount_inc_return(refcount_t *r); > > > > I'm not immediately seeing how wanting 1 to mean unused leads to > requiring these two functions. Did you read the other other part of the description? Further, both functions can be used to accurately trace the refcount (refcount_inc() followed by refcount_read() can't be considered accurate). > If you'll remember, I did that for inode_count and only needed > dec_unless(). I don't remember. inode_count? I can't find such a thing - did you mean i_count? I don't find anything matching "dec_unless.*i_count" either. David