Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp680782ybv; Wed, 19 Feb 2020 07:08:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzUuHOa2sPl/ggujDR/YS89IXjpklnXIdlWqQPU5je22WVNh/a05DSqJsA7rG5QQrdbVjk5 X-Received: by 2002:aca:4a0b:: with SMTP id x11mr4734422oia.37.1582124889857; Wed, 19 Feb 2020 07:08:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582124889; cv=none; d=google.com; s=arc-20160816; b=rwtPsLLeaVYAokDUM7tHsoMFW3F0Gaw9M2tTlu2Yf0yWdaDI7ukq9QgJdcMO4WSZOu /7526+loj3V38Okw+fRUoLYKLZeAIyGId5Jd5rraCT1OT/PSELWvQrFXHlocnpRQNiyy bUlfZ7K+a/3RM8iNGbw/PLoJnaAbH+jic2N29kUXr6TAEbQfnRxH9bA+ldOrPZMMA8fe o7ab3o2j7HOV8AFltlDhwWnzhezLNEj4EiwRrivHUVW1LBSr8g6glco6PIBPcRi7VEBO yo8PZbeN6azndst8xyRuaIcu6y+FrOl8nCt8OjApxViZAyQyiE5wNPHnKFk8ZdP/sDDG oMDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=2uSO3tdDjie9zJOJApoUJrNtF9zz5bpjxuqvOnIT+IE=; b=qRAlKiEzUU8pLmIGGcc2e3oiC2nUj8z4YV23q9EojB1hTNQYqI6aVHT36L/PCVKPIg NaQmNzapxVxhNO/o8ivUjyLJ3VCebKcTTy7Ja/3Fv6QOCBmCWKaZj/7hp+SRCdN+y1JA hMD83UYxlG6lt4OLcxWhmiU9uMapQMsQgyE+N3jSab5bt9G2Fz6FlzB7oSbObSRjRV5F IzaM/83V6x7g/eAEB1IMQg05XkoEmZAPbG821FbIPDukGiXNfv8ta0KxK5PxNtng7KO5 yMRjzGxk6TJQJLevwplSOxj/kAzL4AzQwZKpq/jG3KqLo4tI1VqlZjSmN3yaQF7MhCls G8IA== ARC-Authentication-Results: i=1; mx.google.com; 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 b191si9077745oii.266.2020.02.19.07.07.49; Wed, 19 Feb 2020 07:08:09 -0800 (PST) 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; 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 S1726829AbgBSPHL (ORCPT + 99 others); Wed, 19 Feb 2020 10:07:11 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:56596 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726821AbgBSPHL (ORCPT ); Wed, 19 Feb 2020 10:07:11 -0500 Received: (qmail 1616 invoked by uid 2102); 19 Feb 2020 10:07:09 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 19 Feb 2020 10:07:09 -0500 Date: Wed, 19 Feb 2020 10:07:09 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Boqun Feng cc: linux-kernel@vger.kernel.org, Andrea Parri , Will Deacon , Peter Zijlstra , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Jonathan Corbet , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , Greg Kroah-Hartman , Jonathan Cameron , , Subject: Re: [RFC v2 3/4] Documentation/locking/atomic: Add a litmus test for atomic_set() In-Reply-To: <20200219062627.104736-4-boqun.feng@gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Feb 2020, Boqun Feng wrote: > We already use a litmus test in atomic_t.txt to describe the behavior of > an atomic_set() with the an atomic RMW, so add it into atomic-tests > directory to make it easily accessible for anyone who cares about the > semantics of our atomic APIs. > > Additionally, change the sentences describing the test in atomic_t.txt > with better wording. One very minor point about the new working in atomic_t.txt: > diff --git a/Documentation/atomic_t.txt b/Documentation/atomic_t.txt > index ceb85ada378e..d30cb3d87375 100644 > --- a/Documentation/atomic_t.txt > +++ b/Documentation/atomic_t.txt > @@ -85,10 +85,10 @@ smp_store_release() respectively. Therefore, if you find yourself only using > the Non-RMW operations of atomic_t, you do not in fact need atomic_t at all > and are doing it wrong. > > -A subtle detail of atomic_set{}() is that it should be observable to the RMW > -ops. That is: > +A note for the implementation of atomic_set{}() is that it cannot break the > +atomicity of the RMW ops. That is: This would be slightly better if you changed it to: "it must not break". The comments in the litmus test and README file are okay as they stand. Alan