Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5715678ybp; Tue, 8 Oct 2019 07:17:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuYMq1ftNgR7PWFMUnEWVuRHUfi8KHXLKXDbj7QOyCKGPe/XxXp1fWKgxF2W2CuT09Rb6z X-Received: by 2002:a50:a557:: with SMTP id z23mr33280099edb.99.1570544239902; Tue, 08 Oct 2019 07:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570544239; cv=none; d=google.com; s=arc-20160816; b=dLYisvZNNUTj+VEbbko1GlbwiCIvcl5zABVnghttfDKzlFspQiV89emst8GZv7HpOW JRDp+WQm8N1BvYJdNMJevfdMO4ajQXqoveHhYkjPxTRQSLPpmYwsbWdggCpbvIaSrWV7 zEzX5rbqt4ncl2AATETgFfh7P8MDSPZkmyEAz1MQ/1ARePpwFobCrNl+I9ULYmH4T9Ju h00tsoOSxYIae7jsgiKwnqU3t8nuy46wOym8PNcYNCY0v75DTYBtNn9CJop1KvobweqS hMMbjioggFOeRiJsjlTgiAywQoNInljGGntZikDX48dSh8e/JwKoDkc6rB+QI2af6i6O Xy6g== 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:message-id:subject:cc :to:from:date; bh=7uF9Fy+HSTyoR06KUVocYlcujzK/7KnNtNY1NxB20SA=; b=L2E9CSvJA7TOsTCb8Tsr/ZYVw/DiHArVop82Zi8Pwu4tk0lqNaqOmA0AhfOx4Zpb4v r2ATwTCSZh5wR43ou4txOfULtjHIZ3LbhdVr/77zbkqpxCTaVeqCtOq9nt04EYUerQCz lBTcElUHh/mkHzPMPNYaoGWxcepAJ+SAUtn4Rd5/3panexbP0mRxtx6fyQNnDJtCmNNo VwN9Pu0oZPn2r7ud0GfXqfWGnnzaZChixp3mkqNHyw8cUyYXcpWQ2kCOrwijeexpn125 8ZvZGoMnH9SJ8fTCKoWlUffJESLiQhyuPMzxV32+Buhpz0XvaDpXgaTi1RQYbzuPs4nj 9gSw== 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 d52si10292024ede.370.2019.10.08.07.16.56; Tue, 08 Oct 2019 07:17:19 -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 S1726407AbfJHOQS (ORCPT + 99 others); Tue, 8 Oct 2019 10:16:18 -0400 Received: from correo.us.es ([193.147.175.20]:52196 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbfJHOQS (ORCPT ); Tue, 8 Oct 2019 10:16:18 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id 3D602A0AEF1 for ; Tue, 8 Oct 2019 16:16:12 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 23093B8001 for ; Tue, 8 Oct 2019 16:16:12 +0200 (CEST) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id 17169CA0F2; Tue, 8 Oct 2019 16:16:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on antivirus1-rhel7.int X-Spam-Level: X-Spam-Status: No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50, SMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1 Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 859A4DA7B6; Tue, 8 Oct 2019 16:16:09 +0200 (CEST) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Tue, 08 Oct 2019 16:16:09 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from us.es (sys.soleta.eu [212.170.55.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 1984lsi) by entrada.int (Postfix) with ESMTPSA id 1DFE742EF4E3; Tue, 8 Oct 2019 16:16:09 +0200 (CEST) Date: Tue, 8 Oct 2019 16:16:11 +0200 X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: paulmck@kernel.org 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: <20191008141611.usmxb5vzoxc36wqw@salvia> References: <20191003014153.GA13156@paulmck-ThinkPad-P72> <20191003014310.13262-8-paulmck@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191003014310.13262-8-paulmck@kernel.org> User-Agent: NeoMutt/20170113 (1.7.2) X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 >