Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp29943imu; Thu, 10 Jan 2019 16:23:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN4/iNfewwIuWrvz2SJrSQ8CGpNM7GSf4qLkcVgUN7QmDkTz7WT2QuQLI1LkEvzWxIyNWG4l X-Received: by 2002:a62:64d7:: with SMTP id y206mr12352405pfb.84.1547166215213; Thu, 10 Jan 2019 16:23:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547166215; cv=none; d=google.com; s=arc-20160816; b=JnVA1ISP9/QQSrFetvhR2o+TzDkDSiTpEJLQjkEUHZtlLbbKVGHKLIOixdanv9vpva PPeZb09XO63X3dsscPkzGeB5kt+WYG+HZVaYTVpImLYno7woAQtQ9soebOb9cgN4QDaM xzlpjsRRPMrP7crGEiRuO4Of6rOHDx6L/i4ESnL40sClJv0kfj0os7tzZxWFaAxv5R2t 2ZT9AFsOBvk+WAegI6/RhYThQWsVuA+jTLhOvFY5ziClQpChAF7f/fufNDZYAFEfGrQs WDK0/SPeLuQiDgEGyjB3AUyXbb+n9UTqAjPB7J09RibtoyTzs/gWgF5m0r5IwREUQASs csaQ== 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=VcyRFczM/u92MglYyjpYAY1sYpmJ8K2TYLvQTciv9dk=; b=E6iZOYWJmhOTogK/+zU4MoGZqAWLSHJODkZDG6kRcSqxpskAi8rAnMCeCeMCzeTtXD p1zF584MgXucLH38ssLBTS3LRZ60Pk++veCgI9fgtMLIsaau1daKNfBbhF+hNcM6iXvv ASIwi/G761bVUN1TbiFCLFYWhnQ4OvQab8ariZCxlhJQBO5tzax7t8ShodKSnNkqyc+N 1ctOExgr303xqFYUtmkDOqb9S5K5j9MDS4zn5lzTCHChNarDQsRTteRjLtymGw65dV71 68MO2F/n1M8PpObnMB9Bu7H0wDum679aL2HfWIX0Cz7ab1Sbh8HiF8XhlsLnhXouMTG9 9gCw== 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 k11si9869661pgg.430.2019.01.10.16.23.20; Thu, 10 Jan 2019 16:23:35 -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 S1729429AbfAJW3Z (ORCPT + 99 others); Thu, 10 Jan 2019 17:29:25 -0500 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:55694 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728042AbfAJW3Z (ORCPT ); Thu, 10 Jan 2019 17:29:25 -0500 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.89) (envelope-from ) id 1ghipE-0001kK-9d; Thu, 10 Jan 2019 23:29:20 +0100 Date: Thu, 10 Jan 2019 23:29:20 +0100 From: Florian Westphal To: Peter Zijlstra Cc: Florian Westphal , Anatol Pomozov , Dmitry Vyukov , paulmck@linux.ibm.com, LKML Subject: Re: seqcount usage in xt_replace_table() Message-ID: <20190110222920.jqpzzv74huc2lb7f@breakpoint.cc> References: <20190108223746.shuwx3ro7cgwz7hh@breakpoint.cc> <20190110124123.GA21224@hirez.programming.kicks-ass.net> <20190110144812.mkbokbj2iyryj6lv@breakpoint.cc> <20190110202533.GK2861@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190110202533.GK2861@worktop.programming.kicks-ass.net> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter Zijlstra wrote: > Would using synchronize_rcu() not also mean you can get rid of that > xt_write_recseq*() stuff entirely? No, because those are used to synchronize with cpus that read the ruleset counters, see net/ipv4/netfilter/ip_tables.c:get_counters(). > Anyway, synchronize_rcu() can also take a little while, but I don't > think anywere near 30 seconds. Ok, I think in that case it would be best to just replace the recseq value sampling with smp_mb + synchronize_rcu plus a comment that explains why its done.