Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp78594imu; Tue, 8 Jan 2019 15:03:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN5RT+3A7dqxez1PdG7Rpo2ZVcJAohbRMRSvi3QfEUOhQ6b1UuAgKnIWpKTGRMoFIjmG0jb/ X-Received: by 2002:a63:d904:: with SMTP id r4mr3225673pgg.207.1546988588480; Tue, 08 Jan 2019 15:03:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546988588; cv=none; d=google.com; s=arc-20160816; b=gsWpICYIbeLzQ2vewcOjQqiqoITOx/LAlbf/wHpiU8n1jyMzOYUImG3AFgTu94cWho d3ciYuD6VFeVh+B4cj1xGgx+stoJg19LZEsDJkLbMoTG0ZtDH2npLzGGBfbdAL8SN5hl uM6AtdbzX2lNe+nXFPUdQiWQ7ixp1FP/CzBcTp8jbuDOd12HCVnAkJlbv246p5hBM8Q9 8MRiL5sqGUjTs+J0vuWUEvaVk8F62iXcaG9niZjREvm0WwwevQDjP5zf7UVA9FM2nlxw uzgbcsVEQipyBDCLA2DnQYEn7e6/rZrM97VsbxKuIuDkqd4Zj7HxEP0CwnkbuSgYX8m+ TTMw== 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=qnVXHnNiAXg9lrklFvcy7F3t5+akKwaM5AnH6GFqHu8=; b=ivH1LMQZSMERe41ekJxnFWCVulj/BbDLzTTEE2K5pFF1/EB97E4ThPagb9dcGbJRVJ p8As5TI/JhqEm2/ujyKwpmDwec+2pZkCwenIOtISR0U+92h2nl0XNhxRnx6IfGYD/nUA LS8gXSabHKDXONmSONYI0LNc74wxDioeodaIEWBAEBFmNMQeEHm0o92i84AjJ+jpGS+r +kPEX2umZs0G99VUExw5ksxaFGMGrA7PZIqVgFyADd8FA+jXGKbVybOGwHLjYzQWLDhb BU414av0XwMHksc7hSilRgAIRukbE3xICKncPpeDydkUFwj6QuduzPBDB/JGNLsD3zXq 3dsg== 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 184si27976563pgj.329.2019.01.08.15.02.53; Tue, 08 Jan 2019 15:03:08 -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 S1729702AbfAHWhu (ORCPT + 99 others); Tue, 8 Jan 2019 17:37:50 -0500 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:43954 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728617AbfAHWhu (ORCPT ); Tue, 8 Jan 2019 17:37:50 -0500 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.89) (envelope-from ) id 1gh00I-0000S3-JR; Tue, 08 Jan 2019 23:37:46 +0100 Date: Tue, 8 Jan 2019 23:37:46 +0100 From: Florian Westphal To: Anatol Pomozov Cc: fw@strlen.de, Dmitry Vyukov , paulmck@linux.ibm.com, LKML Subject: Re: seqcount usage in xt_replace_table() Message-ID: <20190108223746.shuwx3ro7cgwz7hh@breakpoint.cc> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Anatol Pomozov wrote: > Or maybe xt_replace_table() can be enhanced? When I hear that > something waits until an event happens on all CPUs I think about > wait_event() function. Would it be better for xt_replace_table() to > introduce an atomic counter that is decremented by CPUs, and the main > CPU waits until the counter gets zero? That would mean placing an additional atomic op into the iptables evaluation path (ipt_do_table and friends). Only alternative I see that might work is synchronize_rcu (the _do_table functions are called with rcu read lock held). I guess current scheme is cheaper though.