Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp458512ybn; Thu, 3 Oct 2019 07:31:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9z+C3s73AJIuR0h0ykOBLj3bGqdre65TKqjuurxg0ozUD42OiI6alBNUr6DhFl37Zja/k X-Received: by 2002:a17:906:a2c7:: with SMTP id by7mr8031074ejb.13.1570113102343; Thu, 03 Oct 2019 07:31:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570113102; cv=none; d=google.com; s=arc-20160816; b=P6gFMHod0Q3KtgXcObgc+/8ZAvnbGmvTvKvev7t3h6hpSkg9w8zrv1rdUgefqyoKBH 5q7y6NslZnHk6f0an7c+3tqGaULK4uCHP3P/Sb1y2S9awAb4I3l+DL/P4R4zKh3Gvqat Oe7krtGKXoLhs6eXKTNpI1QYrYL6RalPpVjkt/LQUYa71KrWJ6JoKb/b/XfrjydZ/Qpq F9jcCGIpn75cgVWk3Rsnp3rGrvvbxbp8Oa84MYrEcorvSFGxUlFw9l3PglMtEzeGIeek qKPDzhANNMDKApGrzLHTV548WJXZEcb9shks/UynATqpri4k48MqtsI+RE2TNibuhJWq cXYw== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=k6IvY8rOGIe/o8WKD5tGmuYuCS1ssG4QpTkDHIK8Ri8=; b=LtHW9c5i4Yor4IfVNlXP1yCC91KQ+cJZ29LmPUdxxnLQY/fsCiPhaVu2oyfWnaidJ8 krzRl8mORVrq8Hi56G68iFl1M9lKQQgsPI+1OuwtzBsWEJRApdAYX1Vl4Aycs7FERDFw /1iM/RkIKpZK63ONOP/r/p6b8va77NpbwxJpgkT+5zuybtPz4a6HQk1ilk+09aXIBteP 2wBZkK7UH/FK4dGuCRB5Bq5PpefJBivEgcPmjFu1NebjJvokLRDSyyLonCvf00BpGxRG w59f9YJO56Zv49fO454T5KvgeYBmfKb2vgfxVynOZovWdyZzHTlHePQPtZuQBxwy42fz 1zzg== 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 b4si1492143edq.221.2019.10.03.07.31.17; Thu, 03 Oct 2019 07:31:42 -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; 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 S1730347AbfJCNIy (ORCPT + 99 others); Thu, 3 Oct 2019 09:08:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:37810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729763AbfJCNIy (ORCPT ); Thu, 3 Oct 2019 09:08:54 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B1A221D71; Thu, 3 Oct 2019 13:08:52 +0000 (UTC) Date: Thu, 3 Oct 2019 09:08:50 -0400 From: Steven Rostedt To: David Howells Cc: paulmck@kernel.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, Bart Van Assche , Christoph Hellwig , Hannes Reinecke , Johannes Thumshirn , Shane M Seymour , "Martin K . Petersen" Subject: Re: [PATCH tip/core/rcu 1/9] rcu: Upgrade rcu_swap_protected() to rcu_replace() Message-ID: <20191003090850.1e2561b3@gandalf.local.home> In-Reply-To: <25408.1570091957@warthog.procyon.org.uk> References: <20191003014310.13262-1-paulmck@kernel.org> <20191003014153.GA13156@paulmck-ThinkPad-P72> <25408.1570091957@warthog.procyon.org.uk> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 03 Oct 2019 09:39:17 +0100 David Howells wrote: > paulmck@kernel.org wrote: > > > +#define rcu_replace(rcu_ptr, ptr, c) \ > > +({ \ > > + typeof(ptr) __tmp = rcu_dereference_protected((rcu_ptr), (c)); \ > > + rcu_assign_pointer((rcu_ptr), (ptr)); \ > > + __tmp; \ > > +}) > > Does it make sense to actually use xchg() if that's supported by the arch? > Hmm, is there really any arch that doesn't support xchg()? It would be very hard to do any kind of atomic operations without it. cmpxchg() is the one that I understand is optional by the arch. -- Steve