Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1377619ybg; Wed, 29 Jul 2020 12:33:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNAn1c0upCUZFXjZHb8i2/01Y0BV7uplmPlW7KpaZuZjr+6Mu7dw3m82d9R2QHm7Dytoxx X-Received: by 2002:a17:906:a2c2:: with SMTP id by2mr4466795ejb.86.1596051219101; Wed, 29 Jul 2020 12:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596051219; cv=none; d=google.com; s=arc-20160816; b=oGVHP62zGd4plc7Y1RpCw1mZKMgmizIdjzC5xleFeLkBYjDUc8HoIWldSEthjq5ytA a1asTlQOZzqM0twmJSzpq9fxKQiZ7LOKw0q/8POho37Gcwho1wP0rxWdHW8CP95xjDqy /1deXDG4OeG90Y2nWaqRE4AQPJxp2rtYewx2FmU19i6oH/GMq2gfgV5nEi9GA7Ct6mAT 6sOYp673gIWzOiNlwQnUPtpLwAcKatbxPkm0x8GjCrhWtMN3kDqMTqIRHlpcKDoz6evx yp602YQFoXtUf+jAFTMjDUfV0ZHt/WZVMGO/KSWU6zaFldOA3gWn6/d2nuynazgOMyFi /wyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+zYmnCJfLxuJg2cwgFMdsSt40MEJjpsqqzfD7mnTbHI=; b=nIHwA2mXGTkjIrh2LSA+Tp3H20AsUDmXiSz8KR8BNQROxtOl1my8COw2SjG3Jfhr8t eMkJ5dIYoEtARDwaGSEOgRT7uzjw9xD9jTwWUjsLasSikEUjbZyR3Zf1E6MN8qs8hJ5c OS56Pw6bn31UDPIKdxJIb2mRhwHLWOrFliL+cTmCX/ZuDAIofZnR795OSLniZZ9nHPbc 3e/pqVM0jSi2G2P2rv9jJcViL0+C0jAh39AYySD348J8pfQ8BbhkNn8t/aFipaF91i1H jJnbPWIaPLpcBtJHsCcrjYc3kJsY/OJ/RzRW0D1+FshHJ+KsuZnFCfH1mpF0AR3wxThw vXFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="KppPfO/r"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si1977292edy.498.2020.07.29.12.33.16; Wed, 29 Jul 2020 12:33:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="KppPfO/r"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726774AbgG2TaZ (ORCPT + 99 others); Wed, 29 Jul 2020 15:30:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbgG2TaY (ORCPT ); Wed, 29 Jul 2020 15:30:24 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 950DCC061794 for ; Wed, 29 Jul 2020 12:30:24 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id b186so3212566pfb.9 for ; Wed, 29 Jul 2020 12:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+zYmnCJfLxuJg2cwgFMdsSt40MEJjpsqqzfD7mnTbHI=; b=KppPfO/rvMM9WWWE8xRY/rii5UYz5r2p8f0zpWnrZ9j8CgccRMK1cfeXC0e21JiJSV f2+Kq9IsIy9OB3Yix51SbciQafX0wVsWXxHlQ1qWpxsQwYdy0TyeJAYXEdOX9YWYUB58 FhPJaGVWzk3r+WCbKW9ChpVQevhPbiGke+mOk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+zYmnCJfLxuJg2cwgFMdsSt40MEJjpsqqzfD7mnTbHI=; b=SBfnKgpBdjDcxUH6OtNas3uJCerxBpguc5oFlcXY45+40YL9UzH09gTc7aFfZmteKB 5b7nCZ9dlygAkruLn1TlQVpqfOI6hhDukyO8bsBfaejdia/FmWqlxtT1Mha9cdpIYJJh 7gSELpXDsoCtJcIez05DnqdAsGjSIGXkdL2TpDkg6hnBWQ6O83Zaqw8jvkirkc6cjlos djuvO6eaBxnmVSj0jJGF2oulms/QSM490Ge4vhephYZNBzAa0n3f3Lomm4N7nR9QV21u 337aOKO9xJXIGXbPVddtiOJN1xuTJCC3IG34LD6IOMOUTBdwl/YjL6MrrwIovyxF1BFB vcZg== X-Gm-Message-State: AOAM533YXcL8RxeewiKZRX+a8pNDMhWB1+fBwvPWzK4T/jDoxosKSD8t CiJP5x57swDmHWZUD7x5Yfkd/w== X-Received: by 2002:a05:6a00:10:: with SMTP id h16mr30601057pfk.214.1596051024148; Wed, 29 Jul 2020 12:30:24 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id g18sm3387802pfk.40.2020.07.29.12.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jul 2020 12:30:23 -0700 (PDT) Date: Wed, 29 Jul 2020 12:30:22 -0700 From: Kees Cook To: peterz@infradead.org Cc: David Howells , Will Deacon , Xiaoming Ni , David Windsor , Hans Liljestrand , Elena Reshetova , Paul Moore , edumazet@google.com, paulmck@kernel.org, shakeelb@google.com, James Morris , alex.huangjianhui@huawei.com, dylix.dailei@huawei.com, chenzefeng2@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH] locking/refcount: Provide __refcount API to obtain the old value Message-ID: <202007291229.0305C794@keescook> References: <20200721195132.GJ10769@hirez.programming.kicks-ass.net> <202006142054.C00B3E9C9@keescook> <20200612183450.4189588-1-keescook@chromium.org> <7be4d56b-0406-099b-e505-02e074c5173e@huawei.com> <544539.1595328664@warthog.procyon.org.uk> <202007211144.A68C31D@keescook> <3211866.1595933798@warthog.procyon.org.uk> <20200729111120.GA2638@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200729111120.GA2638@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 29, 2020 at 01:11:20PM +0200, peterz@infradead.org wrote: > Subject: locking/refcount: Provide __refcount API to obtain the old value > From: Peter Zijlstra > Date: Wed Jul 29 13:00:57 CEST 2020 > > David requested means to obtain the old/previous value from the > refcount API for tracing purposes. > > Duplicate (most of) the API as __refcount*() with an additional > 'int *' argument into which, if !NULL, the old value will be stored. > > Requested-by: David Howells > Signed-off-by: Peter Zijlstra (Intel) This looks good to me. Thanks for poking at it! Reviewed-by: Kees Cook -- Kees Cook