Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2389936imu; Thu, 10 Jan 2019 13:20:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN4aBfjXIyyGB/TIqgJGRaEhsGbLcfVgwoumhpMk+mkwsABAwjqV12Le+D9Sw5aUwI0XDLba X-Received: by 2002:a65:65c9:: with SMTP id y9mr11168647pgv.438.1547155240745; Thu, 10 Jan 2019 13:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547155240; cv=none; d=google.com; s=arc-20160816; b=O7vhrH59Vv5CYsDQF9lv3s/TnXAKnSNh2BzSZ4X7OKmcS1pZXv6LepNUlPClQLNyfI GoR5GG9OBrQ9lDQENSONBgvWMIAEte7MN284Ia2b5fBSrUCKupDLR395L4HLrXr6HauL ywIEq9DT9aWksfibfwo6DsZ0fQC5+12+G/RSUlXt0msbzibAczBQPeTOq/at7MBAcB7I rRz0sgApoYNbMRCH+cvMnQ4hWlEXSB5goOJxNQ5z+cG35oLCwWjzRDhECjM9R7GkFc7S 7TwL02ZCOeIRh/VfdjVqq2LMrbu2+068QGK21+K9/CANZc3BXWQCkf2cRxyqMCgyhizs aGjA== 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:dkim-signature; bh=Jog9ZwrILLUqYnYEM9yeKYKLdJpnoiz07dnT1UexYGE=; b=kCNp651dc+AUycEUscGsq6PCLBtBRRNqcDi1XERzYI1xIHkDsdU4h5Fk+7jmDrQucT DXPPecaXaMz60FpvqK+gjCw0dqZBVldORUI16nM0DUbWX9dUhvASxOmiD25HAtTbm/YY m99ry7ybW9LP173NnKS4Nm/IGY5okOZhMsknnK5YbwZ5myLfMUOjs6CO8OUKhyabhof6 awJEmi6UBcLJjCEb6L1ttzGc53uHwPeAqhtS517Iy/grpoRHNYSawStR8HBQ1XeqfL4N 26IMVw24W+5Ypu8c8sJ+2NNtIxNuL3rkEWsJKtiGks+pHntq0ZzKJCGUz/Wt9LLOYQ+U D+iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="GaCjm/pW"; 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 a17si18058162pgv.456.2019.01.10.13.20.25; Thu, 10 Jan 2019 13:20:40 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="GaCjm/pW"; 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 S1729924AbfAJUZl (ORCPT + 99 others); Thu, 10 Jan 2019 15:25:41 -0500 Received: from merlin.infradead.org ([205.233.59.134]:51422 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727750AbfAJUZl (ORCPT ); Thu, 10 Jan 2019 15:25:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jog9ZwrILLUqYnYEM9yeKYKLdJpnoiz07dnT1UexYGE=; b=GaCjm/pWe5FgFqzGylW36JSuR w7j55huQNZGwupGWfX4BGLueRjgeK52utJbgYLT7kgUX5tp4N1JpdhF0GqHPpWmjWPk9fXyfms3ed y7YHRBCZmXsRv0Yo36PbZDpFr7iJ/brdxCOIp+Bl9fUKtqXhlWrknAO2HhpJKlW2na/liadrci1XX /0dR9U5gBh4dzywQ2pkKart0smy6VEFlyQcsMqMpU2rRVFQvx3OiDxD/buSI0WEGWqprnhdQ9TCZy oJAQEEIUGRJ45RyVTbac+XoBZ9mc7sJ2VVPos8cNFkoSH6KE1GPnLpMbaQ1FzkWklshY6NFgNypYa 0apYNOGvg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghgtU-00071q-1C; Thu, 10 Jan 2019 20:25:36 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 823F59844AF; Thu, 10 Jan 2019 21:25:33 +0100 (CET) Date: Thu, 10 Jan 2019 21:25:33 +0100 From: Peter Zijlstra To: Florian Westphal Cc: Anatol Pomozov , Dmitry Vyukov , paulmck@linux.ibm.com, LKML Subject: Re: seqcount usage in xt_replace_table() Message-ID: <20190110202533.GK2861@worktop.programming.kicks-ass.net> References: <20190108223746.shuwx3ro7cgwz7hh@breakpoint.cc> <20190110124123.GA21224@hirez.programming.kicks-ass.net> <20190110144812.mkbokbj2iyryj6lv@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190110144812.mkbokbj2iyryj6lv@breakpoint.cc> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 10, 2019 at 03:48:12PM +0100, Florian Westphal wrote: > Peter Zijlstra wrote: > > Is performance a concern in this path? There is no comment justifying > > this 'creative' stuff. > > We have to wait until all cpus are done with current iptables ruleset. > > Before this 'creative' change, this relied on get_counters > synchronization. And that caused wait times of 30 seconds or more on > busy systems. > > I have no objections swapping this with a synchronize_rcu() if that > makes it easier. Would using synchronize_rcu() not also mean you can get rid of that xt_write_recseq*() stuff entirely? Anyway, synchronize_rcu() can also take a little while, but I don't think anywere near 30 seconds. > (synchronize_rcu might be confusing though, as we don't use rcu > for table->private), and one 'has to know' that all the netfilter > hooks, including the iptables eval loop, run with rcu_read_lock > held). A comment can help there, right?