From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbdIAWDu (ORCPT ); Fri, 1 Sep 2017 18:03:50 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:45029 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752564AbdIAWDs (ORCPT ); Fri, 1 Sep 2017 18:03:48 -0400 Date: Sat, 2 Sep 2017 00:03:46 +0200 From: Peter Zijlstra To: David Howells Cc: 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 Message-ID: <20170901220346.GC439@worktop> References: <20170901164233.wu4fdljpivzf5idb@hirez.programming.kicks-ass.net> <150428045304.25051.1778333106306853298.stgit@warthog.procyon.org.uk> <150428046185.25051.3518486828049323804.stgit@warthog.procyon.org.uk> <3696.1504300539@warthog.procyon.org.uk> <20170901215003.GA17526@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170901215003.GA17526@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 01, 2017 at 11:50:03PM +0200, Peter Zijlstra wrote: > > 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). > > I must admit to having overlooked that. But can we treat the two issues > separately? They are quite distinct. So for tracing purposes inc_return/dec_return don't cover the full set. In particular: inc_not_zero, dec_not_one and dec_and_*lock are not covered. dec_if_one I suppose we only care about the success case, in which case we knew it was one by inference.