Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1803165ybb; Sat, 4 Apr 2020 12:58:34 -0700 (PDT) X-Google-Smtp-Source: APiQypJCmvltzUf4q/ZlcX4IhIY2ZrCCdqPe8NE01lEoym+UrXSUDMuWkZo+fh0KgncvD70jJloN X-Received: by 2002:aca:3b41:: with SMTP id i62mr7249507oia.55.1586030314544; Sat, 04 Apr 2020 12:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586030314; cv=none; d=google.com; s=arc-20160816; b=pF7tucUWWneflHRoehufePLjQfwi2iiz9v6JpU19RRRYbyBpmoUS8AeLzyQqNbFQW6 /Gyx+wvHxqDT5UAk8ECenFvdcOf0F1Bwh6VsggIdss0GaUfBFWGIGZeI8fE2ktUsI4jT A/PMEshkdCmte0UKysF73GKF+Ti8JY4cT8XTVfG9vh75OVcQn2ls3rT6LQd+drR1z1xC dzJfg6mRJ/WyLNsLxyQSNaRFXDNB/IH13MfO44O4IAyFlaEF+xjgQdkOeGJDUOmoQ0N8 IqC3v5+q/SjVQt8EnhELThJ2xYXB1PG8edq2C3bq+TMfS8ZJuntc08n9Xim749ePWJpl Vhqw== 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=9CbVDZTIMk5DedKHwOhqZguosZYkuF+efmzxSvwSHmA=; b=b2EepXfYOU+2HCIeb0vgN/URBgev4xKQPooAu0Tw44FHzJ6ILM7KG+QlsNzZM51aMP +QLVonFdHm+XMG9wOch2yC1MhJRuykgIGDleQfYF8UpjKXeMnSndFAStlPsrYeXhJlBF G0mSu9KH+GpG7bot2xRDkxGZ74i+xG5ZwjDYrVatx7gtXLCmhpl/mtRO6RUrSRzDG5ch PB/7hUDfb/nhHnTpOO7qlnPmNIg5odnYSozZbPVTPl7uA7zf+WMz5Wc5EuDlnDBdC2TV vbJhroqVZ/W9t27JANyzDY4zJyWVYeF0RPbThWAKwUzAWTsd8pTTb+PXaDM5f4rpljKe gAow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=KVr7ugD1; 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 m1si5862461otk.309.2020.04.04.12.58.21; Sat, 04 Apr 2020 12:58:34 -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=pass header.i=@joelfernandes.org header.s=google header.b=KVr7ugD1; 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 S1726312AbgDDT57 (ORCPT + 99 others); Sat, 4 Apr 2020 15:57:59 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:41735 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726297AbgDDT56 (ORCPT ); Sat, 4 Apr 2020 15:57:58 -0400 Received: by mail-qt1-f193.google.com with SMTP id i3so9519939qtv.8 for ; Sat, 04 Apr 2020 12:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9CbVDZTIMk5DedKHwOhqZguosZYkuF+efmzxSvwSHmA=; b=KVr7ugD1uCChONGUAtH0ZrG1JFeu24vOGuBSUCXWE9Hd/QJ6QGr2dmamlEzvoswCpj 8o9wKR62qOm72sk7VVi5b8MpjFHEnicmKJh86KHMgBuj5wQLnq/P6MlDkNo8xrERB2eD Xg8Y3KzC7dxU+ioN1VAr8OUON4n7JstpkEL6w= 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=9CbVDZTIMk5DedKHwOhqZguosZYkuF+efmzxSvwSHmA=; b=D3dW6yvUfvVY+6kBIeYTmt7QeGCAx+5vkT5zQmzx3jJmo6yB1Eqe+D6yEuLIp9FqVm elyV1jFG3l5ZJLd3393qc3z+zBoq+cKphqvgrlv5G9j6VHwfzeCfrxextx6YsFoNplSG p2C2HL61i9TqL3hO1yIMQxSRJp9q0ljALbertPZf28tZHM1vqjIU1uAvPKxrwvm7BHvQ +ppv+8t2enYZ8UJTGff/A1eDCfLyytxEPv5y2h1m93mzm9lGtmXG7PQQ4WX4lDeZj1hz sgWbKtSA99zBiMM9WENoB9hNsRaiuaXHqjKUrAIQ6YBkRnhw6F2vnN1PozDcLyjgAHzw bZ0w== X-Gm-Message-State: AGi0PuZsPuF9yFvVKIXz9uvoB12M/ec/VOZaETiLj6BMNGy5E4vFhy2Z Cfxs0m+6E7fdOqUxhN4eOe8q9Q== X-Received: by 2002:ac8:f4a:: with SMTP id l10mr14435539qtk.146.1586030276074; Sat, 04 Apr 2020 12:57:56 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id w17sm1403373qkb.11.2020.04.04.12.57.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Apr 2020 12:57:55 -0700 (PDT) Date: Sat, 4 Apr 2020 15:57:55 -0400 From: Joel Fernandes To: Boqun Feng Cc: linux-kernel@vger.kernel.org, Alan Stern , 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 , linux-arch@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v4 0/4] Documentation/litmus-tests: Add litmus tests for atomic APIs Message-ID: <20200404195755.GB83565@google.com> References: <20200326024022.7566-1-boqun.feng@gmail.com> <20200327221843.GA226939@google.com> <20200331014037.GB59159@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> <20200402035816.GA46686@google.com> <20200402080358.GC59159@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200402080358.GC59159@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 02, 2020 at 04:03:58PM +0800, Boqun Feng wrote: > On Wed, Apr 01, 2020 at 11:58:16PM -0400, Joel Fernandes wrote: > > On Tue, Mar 31, 2020 at 09:40:37AM +0800, Boqun Feng wrote: > > > On Fri, Mar 27, 2020 at 06:18:43PM -0400, Joel Fernandes wrote: > > > > On Thu, Mar 26, 2020 at 10:40:18AM +0800, Boqun Feng wrote: > > > > > A recent discussion raises up the requirement for having test cases for > > > > > atomic APIs: > > > > > > > > > > https://lore.kernel.org/lkml/20200213085849.GL14897@hirez.programming.kicks-ass.net/ > > > > > > > > > > , and since we already have a way to generate a test module from a > > > > > litmus test with klitmus[1]. It makes sense that we add more litmus > > > > > tests for atomic APIs. And based on the previous discussion, I create a > > > > > new directory Documentation/atomic-tests and put these litmus tests > > > > > here. > > > > > > > > > > This patchset starts the work by adding the litmus tests which are > > > > > already used in atomic_t.txt, and also improve the atomic_t.txt to make > > > > > it consistent with the litmus tests. > > > > > > > > > > Previous version: > > > > > v1: https://lore.kernel.org/linux-doc/20200214040132.91934-1-boqun.feng@gmail.com/ > > > > > v2: https://lore.kernel.org/lkml/20200219062627.104736-1-boqun.feng@gmail.com/ > > > > > v3: https://lore.kernel.org/linux-doc/20200227004049.6853-1-boqun.feng@gmail.com/ > > > > > > > > For full series: > > > > > > > > Reviewed-by: Joel Fernandes (Google) > > > > > > > > One question I had was in the existing atomic_set() documentation, it talks > > > > about atomic_add_unless() implementation based on locking could have issues. > > > > It says the way to fix such cases is: > > > > > > > > Quote: > > > > the typical solution is to then implement atomic_set{}() with > > > > atomic_xchg(). > > > > > > > > I didn't get how using atomic_xchg() fixes it. Is the assumption there that > > > > atomic_xchg() would be implemented using locking to avoid atomic_set() having > > > > > > Right, I think that's the intent of the sentence. > > > > > > > issues? If so, we could clarify that in the document. > > > > > > > > > > Patches are welcome ;-) > > > > > > ---8<----------------------- > > > > Like this? I'll add it to my tree and send it to Paul during my next > > series, unless you disagree ;-) > > > > Subject: [PATCH] doc: atomic_t: Document better about the locking within > > atomic_xchg() > > > > It is not fully clear how the atomic_set() would not cause an issue with > > preservation of the atomicity of RMW in this example. Make it clear that > > locking within atomic_xchg() would save the day. > > > > Suggested-by: Boqun Feng > > Signed-off-by: Joel Fernandes (Google) > > Thanks! > > Acked-by: Boqun Feng Thanks for the Ack, will send it to Paul during next series with your tag. - Joel