From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751829AbdAaTR2 (ORCPT ); Tue, 31 Jan 2017 14:17:28 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:45826 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751459AbdAaTR1 (ORCPT ); Tue, 31 Jan 2017 14:17:27 -0500 Date: Tue, 31 Jan 2017 20:17:22 +0100 From: Peter Zijlstra To: Fabian Frederick Cc: Andrew Morton , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/14] locking/atomic: import atomic_dec_not_zero() Message-ID: <20170131191722.GR6515@twins.programming.kicks-ass.net> References: <20170130183938.12702-1-fabf@skynet.be> <20170131104154.GO6515@twins.programming.kicks-ass.net> <320001703.34628.1485884488784.open-xchange@webmail.nmp.proximus.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <320001703.34628.1485884488784.open-xchange@webmail.nmp.proximus.be> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 31, 2017 at 06:41:28PM +0100, Fabian Frederick wrote: > > > > On 31 January 2017 at 11:41 Peter Zijlstra wrote: > > > > > > On Mon, Jan 30, 2017 at 07:39:38PM +0100, Fabian Frederick wrote: > > > complementary definition to atomic_inc_not_zero() featured in > > > lib/fault-inject.c > > > > Why? > > Maybe this commit message should be ok ? > > complementary definition to atomic_inc_not_zero() featured in lib/fault-inject.c > and is more readable than atomic_add_unless((v), -1, 0) used in different > places. I still don't see why such a primitive makes sense. Yes there's a few usage sites, but from them I don't see a sensible pattern. What sane pattern desires this?