Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp347226imu; Fri, 11 Jan 2019 01:15:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN45VpplyVCH41cgKTfvDOxmlZwrYp19cep6z0Krh2Maz8hdTQcEKVOvSB6blpqAkBo9wYCW X-Received: by 2002:a63:db02:: with SMTP id e2mr12767739pgg.419.1547198152276; Fri, 11 Jan 2019 01:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547198152; cv=none; d=google.com; s=arc-20160816; b=oEGg71SHJNqEWoglcY/n85O536TDISfL72a9XPqHRksdNr4l8FYEOZH770Xay/xGLA saxygNU1S0gg83blvxEG2LhrayDzaYZlji06TQz/186rBXVY3ZryBYnvaea4sKyM3PX+ o87430wiLKHyHaAswZa/xOObitbKZ/9ch+I272fV7w9XJONpQf+kfazYtdtGaCdDN3pC 9710dEQr8Qcz0KlecY8p3xdWRb3B1Yona7AR0/YJ1gDD6AD18zo7xSTLu7Ol3ICF/5Ez Az/vB/lhTLwtmDzJdB5DaEPp4PE8u6fpFICbkStPmxQSv0vnOd9d4mem++ntU2E+c7Pu bRhg== 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=XztsdydnA9aErpsx+ZLJyi1LgXJcuTHdbr1BDNLGFYQ=; b=xv0JK5DOCcIHUuylqqtw8GCawz08tAHDAruYQcFJV01ZjS1Llwb4eSx3z6yahqaIx0 Q1Or+JsLVi2/BR+g0GxAlDy5X0VnWtXtIVkagjcsfvFE2uH2bGWbgNNEi4dcEWq0qB9Z Zux9CPyYgV/nXXJEMlR/o/arKZjAiZ/WBXVfIK/La8qW/5/UoKQVOHi8OWKSo7q+UeXb Z+wfdajeT9c+HPtkvW4JHyn2Bs9JA2xuL39c1t4NlZjjot9sisU19G63rGmr3x3XHCI9 jKc16fER6dlofCo/+ahNCU9yjo+BnojtkbdP4N+waSNXD0iLgywj88e+zO27zPIASMlw YF7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=bs10b1Ll; 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 n78si21947221pfi.235.2019.01.11.01.15.36; Fri, 11 Jan 2019 01:15:52 -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=bombadil.20170209 header.b=bs10b1Ll; 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 S1730826AbfAKIeY (ORCPT + 99 others); Fri, 11 Jan 2019 03:34:24 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44416 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728175AbfAKIeX (ORCPT ); Fri, 11 Jan 2019 03:34:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=XztsdydnA9aErpsx+ZLJyi1LgXJcuTHdbr1BDNLGFYQ=; b=bs10b1LlljCRAmHsKrXP1lxoR wggpYj99i32W381r9cbrHsdBiztV3x/At6X+D7DtqTRMQTRjq8XaeN+3fpfHSgqBjKi0Y/07mb9+r W3IexEOXhDoqKta15DK5aACnj8YLfWJlh28X4xMZ5dNGqvG2ZkHFPuJkDMZGERFCGhgNbRSxeVNdG 7B2ikyup19y6CqpZto2Ozf9hlmhpZnPvTNkpcZqQvlIKYHBcuLFvtGuZgfERp7txUB1F9wVkNK23M YW1y1ZWbizPZoOUJsIqgCR23PBKsiT0Cko1rAn5mw3ncmgmlWKYUjoX/n+PwZ0G7NeH+ykHjVc6R7 yuiR7akgQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghsGd-00011G-0L; Fri, 11 Jan 2019 08:34:15 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6F04B20280450; Fri, 11 Jan 2019 09:34:11 +0100 (CET) Date: Fri, 11 Jan 2019 09:34:11 +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: <20190111083411.GM1900@hirez.programming.kicks-ass.net> References: <20190108223746.shuwx3ro7cgwz7hh@breakpoint.cc> <20190110124123.GA21224@hirez.programming.kicks-ass.net> <20190110144812.mkbokbj2iyryj6lv@breakpoint.cc> <20190110202533.GK2861@worktop.programming.kicks-ass.net> <20190110222920.jqpzzv74huc2lb7f@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190110222920.jqpzzv74huc2lb7f@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 11:29:20PM +0100, Florian Westphal wrote: > 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(). Ah, bummer :/ > > 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. synchronize_rcu() implies smp_mb() on all CPUs.