Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1088028ybp; Wed, 9 Oct 2019 08:38:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCsCfAo8XlJy0f+0/hC2BWTce3XnCgk/1M4cdRoLRNBOSi8QPRK9hvA7e7vgj011JUrYqv X-Received: by 2002:aa7:c259:: with SMTP id y25mr3502612edo.117.1570635502313; Wed, 09 Oct 2019 08:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570635502; cv=none; d=google.com; s=arc-20160816; b=k/pJbzSvUOtDSS8Jvnqn6yXOYMqEyUD5+WWaWn4BnRlyYpymknn43rjwRnB45544bG FHWKQOqmm2y4NVTa9gox+1yB8EKq1ZXyXDsk46Qjh+oDl2gS8Hpex784fRVh98F3hUPc hD/TrRvwAUGHSiL9jrhwIEOREAY/+h+DNdf21mApCEz9dctV49XuyhknuDUOOeSECP7u oE0tTN8iiqmWhYTd8oEHBOxpC8BnNoNsEUMU/glpSmfZjDGNbdRxixOR7vsltn0hbWWh Js6FPw0/JE1BAZxJ6VFgk8BVNP5l41uOGpe9XQsFK1H07C3s6lOFGZ1+6JsLePKsx4SZ ZpsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=SEZWkeIMTgDa7jEzZzxGm6UVHJHxAENHvn4RI0NAUSs=; b=mcKH5iocs/3zAqFZ8aY3nj5LpIC7CrEsfMpurfJC5aRhR9lpWs5jOr6qUwwmIyPTxu Rn1h4W6pm6JcMVz7u2a/lv9WADZ90+opYp7uu0Rr6WaIYhAH+WRpBJ7HGtod2thhnlU6 C0xjitWjIfI7EzVYbH9TAO1/wVaB3VjSicELwThogUeEm5YM6xrdh7FrfJYO80+OAKRo KYhRR3Argp6WH2SSuYPkz422iFq11h2r2FQmT8u7zFongszvg7YJ6wkBNDdyUG/cGrL7 3vke98vt1w0xC9Ld+mpW8VJIwjq7iGcZ4fam86zBfbocZPOcIoBP21C6WsUn62JiGL4o NULQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UsVnXzAI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kt5si1314968ejb.283.2019.10.09.08.37.58; Wed, 09 Oct 2019 08:38:22 -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=@kernel.org header.s=default header.b=UsVnXzAI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731473AbfJIPhG (ORCPT + 99 others); Wed, 9 Oct 2019 11:37:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:37162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729742AbfJIPhG (ORCPT ); Wed, 9 Oct 2019 11:37:06 -0400 Received: from paulmck-ThinkPad-P72 (mobile-166-137-176-109.mycingular.net [166.137.176.109]) (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 304D9218AC; Wed, 9 Oct 2019 15:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570635425; bh=edf3a7Xyb4Ic5cpCpe6yHS1CA/n0vMcGLXMOlQSiBDg=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=UsVnXzAIzR9JpLCn6O++S2Alq32z1XzoL7CfrtrT9iC2Bo0HNdbEOUmEWiXGhZKgx vjuRbLjOI8qbqYcp1pQ0CB6If1Fac/28dbE+e+Ue4pYPQwx/LyYIhkw4YIJkL6+Phr UKrIppp5CAM5RiV5D4NOZtnRaAveBHLwVySAldQg= Date: Wed, 9 Oct 2019 08:36:59 -0700 From: "Paul E. McKenney" To: Pablo Neira Ayuso Cc: 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, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org Subject: Re: [PATCH tip/core/rcu 8/9] net/netfilter: Replace rcu_swap_protected() with rcu_replace() Message-ID: <20191009153659.GA30521@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20191003014153.GA13156@paulmck-ThinkPad-P72> <20191003014310.13262-8-paulmck@kernel.org> <20191008141611.usmxb5vzoxc36wqw@salvia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008141611.usmxb5vzoxc36wqw@salvia> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 08, 2019 at 04:16:11PM +0200, Pablo Neira Ayuso wrote: > On Wed, Oct 02, 2019 at 06:43:09PM -0700, paulmck@kernel.org wrote: > > From: "Paul E. McKenney" > > > > This commit replaces the use of rcu_swap_protected() with the more > > intuitively appealing rcu_replace() as a step towards removing > > rcu_swap_protected(). > > > > Link: https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=Z7-GGtM6wcvtyytXZA1+BHqta4gg6Hw@mail.gmail.com/ > > Reported-by: Linus Torvalds > > Signed-off-by: Paul E. McKenney > > Cc: Pablo Neira Ayuso > > Cc: Jozsef Kadlecsik > > Cc: Florian Westphal > > Cc: "David S. Miller" > > Cc: > > Cc: > > Cc: > > Acked-by: Pablo Neira Ayuso Applied, thank you! Thanx, Paul > > --- > > net/netfilter/nf_tables_api.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c > > index d481f9b..8499baf 100644 > > --- a/net/netfilter/nf_tables_api.c > > +++ b/net/netfilter/nf_tables_api.c > > @@ -1461,8 +1461,9 @@ static void nft_chain_stats_replace(struct nft_trans *trans) > > if (!nft_trans_chain_stats(trans)) > > return; > > > > - rcu_swap_protected(chain->stats, nft_trans_chain_stats(trans), > > - lockdep_commit_lock_is_held(trans->ctx.net)); > > + nft_trans_chain_stats(trans) = > > + rcu_replace(chain->stats, nft_trans_chain_stats(trans), > > + lockdep_commit_lock_is_held(trans->ctx.net)); > > > > if (!nft_trans_chain_stats(trans)) > > static_branch_inc(&nft_counters_enabled); > > -- > > 2.9.5 > >