Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1823059ybh; Sun, 8 Mar 2020 14:08:32 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuT2yDd+BRDbzRHApfl+mRMelpf8rzDjmwOEJlSx5agHRfV8d3cEYpnb1Zk1yuhHtYY2kDw X-Received: by 2002:a9d:76d6:: with SMTP id p22mr11162829otl.37.1583701712541; Sun, 08 Mar 2020 14:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583701712; cv=none; d=google.com; s=arc-20160816; b=y4Zcudkwnr5pm6+2IrnaeJs9th8HvB8Nhz2NhXCDj/kH1An3jUySoeZlU9vpFMJvmV HcFCBrUIAMqfEve20dj0LJTjtFmUtrxhSDrxnw3t8/L5AhWulmA0EczWy0fV9JLPUvfY XKZ2vvNQve3xZWHAIrA33bc1SuLxC6mY0xymvEVYD3OpKdJV2TaefB1wQxbL79JKN3Fn QWirOs/b1ZKc80fPRtZKqKZ9aBRTfkacXxK0DyetBvMFA0QcvbeUKP5tR4FLvlaAYdJA VaauwNNEPY2I/Af34p8VNKnpZNCKDuUaI/3eRUjgYA2RMEbGqZiYlvlJ1wLV0GSf5agF BPtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=uknyb3K6/aEI19vxksEpU8BoggXIZiQ7mHKdOw5rH4M=; b=IUow1tpxtQfnEf+coAu37gcR3NqVn/7mgMaicH0zb4CLp+0YzbAYzLbcNWHWOp1Ua/ /sRrYRlhixwvYyqnvZ4ZS4B87MlGsvPjpPAw3fHmTLPUg6meQ2FFGKOPC333c5S8BcC5 06pAeOpCWYeH3F2/fwvpBhpbLFyjmJH7dMhhS9t0jFGCqCOnAgtnuep5QtyDxLH59iNn BTfEeJYuOG+2XnUPv01IVfB3slHxnmK48oLvXigyhjz1tnlrFmohI/whnknhoP9qDw9W 5Hp+dRQn45oZ3iuqfD5Rm+DO8MzM5koHsS42Kfax5gjx7yEApYi2gL693QoJ1/cVEk2C qAlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (dns failure for signature) header.i=@infradead.org header.s=bombadil.20170209 header.b=Gn4dfqaT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w81si3270745oia.48.2020.03.08.14.08.19; Sun, 08 Mar 2020 14:08:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (dns failure for signature) header.i=@infradead.org header.s=bombadil.20170209 header.b=Gn4dfqaT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726384AbgCHVHz (ORCPT + 99 others); Sun, 8 Mar 2020 17:07:55 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60290 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbgCHVHy (ORCPT ); Sun, 8 Mar 2020 17:07:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=uknyb3K6/aEI19vxksEpU8BoggXIZiQ7mHKdOw5rH4M=; b=Gn4dfqaTNdJHonnAIEpZBZf9oe aHSGOBv4a7QjSBbe8he0j0YJ1Dpvqe4tmB9zD25qeXHdP9oUJXJC6eiDHHU7kQ7li6cyjg+hcw2Gy NxvQvWEPxOlw2eI0CRrsgqqMyEG4nqzovbgNDBc+qGrYTPgZmqRNVvogdRIQ/4Vu5Yxy82wGogc4q Pf9w35UoTDRyC6bAP7rbX4cFkUh1CjjTuRCtarOo1GJxzujSxHCRykoJISTpdZkA0PDLxeTByUxSK toG+uEDphqI1AJ4O8S/YzqyIzvlHR/nqchYLkZP02YIJAsN5iq4iIxW6z9NT4mYOhcyAe4RziRlHD w8ueLPlA==; Received: from [2601:1c0:6280:3f0::19c2] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jB39K-0004lS-2N; Sun, 08 Mar 2020 21:07:50 +0000 Subject: Re: [PATCH 3/3] docs: atomic_ops: Steer readers towards using refcount_t for reference counts To: =?UTF-8?Q?Jonathan_Neusch=c3=a4fer?= , linux-doc@vger.kernel.org Cc: Alan Stern , Andrea Parri , Will Deacon , Peter Zijlstra , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org References: <20200308195618.22768-1-j.neuschaefer@gmx.net> <20200308200007.23314-1-j.neuschaefer@gmx.net> From: Randy Dunlap Message-ID: <7ff7dc4e-d606-e2a1-edce-a0485e948e48@infradead.org> Date: Sun, 8 Mar 2020 14:07:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200308200007.23314-1-j.neuschaefer@gmx.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/8/20 1:00 PM, Jonathan Neuschäfer wrote: > Signed-off-by: Jonathan Neuschäfer > --- > Documentation/core-api/atomic_ops.rst | 6 ++++++ > Documentation/core-api/refcount-vs-atomic.rst | 2 ++ > 2 files changed, 8 insertions(+) > > diff --git a/Documentation/core-api/atomic_ops.rst b/Documentation/core-api/atomic_ops.rst > index 73033fc954ad..37a0ffe1a9f1 100644 > --- a/Documentation/core-api/atomic_ops.rst > +++ b/Documentation/core-api/atomic_ops.rst > @@ -392,6 +392,12 @@ be guaranteed that no other entity can be accessing the object:: > memory barriers in kfree_skb() that exposed the atomic_t memory barrier > requirements quite clearly. > > +.. note:: > + > + More recently, reference counts are implement using the implemented > + :ref:`refcount_t ` type, which works like > + atomic_t but protects against wraparound. > + > Given the above scheme, it must be the case that the obj->active > update done by the obj list deletion be visible to other processors > before the atomic counter decrement is performed. -- ~Randy