Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2012163imu; Thu, 10 Jan 2019 06:55:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN4yyq5mxbj7MMNTQ/A/Os5mcAUBIciFJrF7c2OuJUqt9VsLkl6g/eRnYDGeUyxpP0bRS6Lv X-Received: by 2002:a17:902:830a:: with SMTP id bd10mr10667770plb.321.1547132144556; Thu, 10 Jan 2019 06:55:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547132144; cv=none; d=google.com; s=arc-20160816; b=O3f66lMGnJppxNOqHb6TUKvsYDjFzExufcKDJ/5plYJZ53B05HOm4xhjZ3h0lixjXz /uS8J35nWZQ3WDgRd3tSU0Zw6mxjQ6+r3pSnAcmUb9JR3DvT1KJF8eCyGJx9mWoBzwvF Zub1qZHyZQDTsFG3isKjzuQ1Vzhy629vi4SFZiilSFYAx04D4pYXffbJG5X3R2SrY8Ku eDDCqS9ukg4eDvVR7SbImE1KvYPmUf5t9rLCse3RWKC3+8WQk4rGTsMuVmNR2lXRGDqH vdpHRPHGNDBTF11zsNuTUo0ow15EKpCIdGsGQQKWDNQWL/GZ34p1Sz57bk5Dkjxw3RxR 02PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date; bh=QFmedF6bThq3T04WKWn9Vc2mcqqqG+WX4y3jM1qdMcI=; b=BRs4DrrRZzWLyheq351+d1BW6dePZl1ue6/0MqP23HxkoixcpBddEEpyUhHqQ223he b99tpzYa+KkRgO6fSB4KTc5EPfjo4A2btjQV8lUbNfNoA6qk9samznxNT5UaqNJdaB7r zCUsktcf/Pczp5RYb0vp1WfOR03SMB6LpDzl70mqVyqV3eWAyisHq+Xgm1ErjM1RhOVx sLDNXR7VIsctXbEDno34CFPEzSFvMWQye0MaYp7PzNAAX/BZDsDVT+w7A1fM4qeIExFp eiFYPw04H2Vuj7AzKgZe6T3+8j00ywsy8ZIvzpZZwuHJ1jXQNfLKMa/fO7DaDyDIGvPC CCww== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si11451271plt.68.2019.01.10.06.55.28; Thu, 10 Jan 2019 06:55:44 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729368AbfAJOwU (ORCPT + 99 others); Thu, 10 Jan 2019 09:52:20 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41312 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729032AbfAJOwU (ORCPT ); Thu, 10 Jan 2019 09:52:20 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id x0AEnMa2147041 for ; Thu, 10 Jan 2019 09:52:18 -0500 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0b-001b2d01.pphosted.com with ESMTP id 2px5x5y09f-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 10 Jan 2019 09:52:18 -0500 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 10 Jan 2019 14:52:18 -0000 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 10 Jan 2019 14:52:15 -0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0AEqEYp24117402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 10 Jan 2019 14:52:15 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D7A90B205F; Thu, 10 Jan 2019 14:52:14 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9F0DB2065; Thu, 10 Jan 2019 14:52:14 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.88]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 10 Jan 2019 14:52:14 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 7E93216C5F90; Thu, 10 Jan 2019 06:52:15 -0800 (PST) Date: Thu, 10 Jan 2019 06:52:15 -0800 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Florian Westphal , Anatol Pomozov , Dmitry Vyukov , LKML Subject: Re: seqcount usage in xt_replace_table() Reply-To: paulmck@linux.ibm.com References: <20190108223746.shuwx3ro7cgwz7hh@breakpoint.cc> <20190110124123.GA21224@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190110124123.GA21224@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 19011014-0072-0000-0000-000003E7DFED X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010379; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000274; SDB=6.01144485; UDB=6.00595914; IPR=6.00924749; MB=3.00025068; MTD=3.00000008; XFM=3.00000015; UTC=2019-01-10 14:52:17 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19011014-0073-0000-0000-00004AC1FD04 Message-Id: <20190110145215.GM1215@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-10_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=904 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901100117 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 01:41:23PM +0100, Peter Zijlstra wrote: > On Tue, Jan 08, 2019 at 11:37:46PM +0100, Florian Westphal wrote: > > 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). > > > > For: > > /* > * Ensure contents of newinfo are visible before assigning to > * private. > */ > smp_wmb(); > table->private = newinfo; > > we have: > > smp_store_release(&table->private, newinfo); > > But what store does that second smp_wmb() order against? The comment: > > /* make sure all cpus see new ->private value */ > smp_wmb(); > > makes no sense what so ever, no smp_*() barrier can provide such > guarantees. Agreed, this would require something like synchronize_rcu() or some sort of IPI-based sys_membarrier() lookalike. Thanx, Paul > > 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. > > Is performance a concern in this path? There is no comment justifying > this 'creative' stuff. >