Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2477520pxb; Tue, 9 Mar 2021 03:37:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1HOQMsxEQdTVEdXz/52VmLJh7kG+oMKXQmlfS640dZCUF0scV6IaAihgmvf6j2bdATay1 X-Received: by 2002:a17:906:58d6:: with SMTP id e22mr19558285ejs.112.1615289869249; Tue, 09 Mar 2021 03:37:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615289869; cv=none; d=google.com; s=arc-20160816; b=lK8fCaB8p76a7eH5vsrs6yvT5bA8rpmeyF7K6obIg0o1X647Jgw4z+EbViPTu7Wd3v Gd71nqzfrh3eTIYtRcIhOuT53l3mHLjTDQoYHlCOs/ap1aVrobLBhaqsefd7UkvutAgl rVuC9uG+zdiColXRZAtuAZ7wQiHNX1U60FQenzjxcvPzJhlJzrognHNj1rQXgVGcSfgp /WS2f9CVTmuLSpAFjSAteRgvabOybGPzEkLgljI6QIfJ41rAQ8xN3EjOsX5IED0xyIeJ cTmLtbtvR6qhYXnH4oG3SY6NGtlnsFoyXCgTEWbGcVreOE1K6NMRuyotilKG7CIGgDdM Jb8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=BDZAWXWcO0e8zQHQWt7HpNfSNI6CxwBdWu+XlliyXXE=; b=Q4urvAb3kaS7q1UG7TD36J/667We1KKAumCX1jDmCEkZNCal2PgD2UBwegbXE6swMF x2dEMNnJOUMl4Nz4Mv79oSOZGN77065OOiCfSnphok2e9j0LXh/zYVPC7wohdpiI1Bk7 GktaIIWzXvdUDbHszwARLBOc92Hcq9b66yWc8pLVUaor170UxfiVTx5fzO3ghUUPEkET EZNDoNpcgBd+8nGErEeWb5RiAOMzdV33/X1s+stEACOKpVCPQFXOqr8B0nFUqbPnJRDY qQGSfOG8YNyJSpmkn5ZuwratzDNKmz8NSx98+BHy/Kn+rjo54waLbs0RqVWd/DhBTE1C ducQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r20si5240182ejo.22.2021.03.09.03.37.26; Tue, 09 Mar 2021 03:37:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230122AbhCILeP (ORCPT + 99 others); Tue, 9 Mar 2021 06:34:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbhCILeD (ORCPT ); Tue, 9 Mar 2021 06:34:03 -0500 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15E80C06174A; Tue, 9 Mar 2021 03:34:03 -0800 (PST) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1lJacW-0005aP-OH; Tue, 09 Mar 2021 12:33:48 +0100 Date: Tue, 9 Mar 2021 12:33:48 +0100 From: Florian Westphal To: Mark Tomlinson Cc: pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de, subashab@codeaurora.org, netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] netfilter: x_tables: Use correct memory barriers. Message-ID: <20210309113348.GE10808@breakpoint.cc> References: <20210308012413.14383-1-mark.tomlinson@alliedtelesis.co.nz> <20210308012413.14383-4-mark.tomlinson@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210308012413.14383-4-mark.tomlinson@alliedtelesis.co.nz> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mark Tomlinson wrote: > When a new table value was assigned, it was followed by a write memory > barrier. This ensured that all writes before this point would complete > before any writes after this point. However, to determine whether the > rules are unused, the sequence counter is read. To ensure that all > writes have been done before these reads, a full memory barrier is > needed, not just a write memory barrier. The same argument applies when > incrementing the counter, before the rules are read. > > Changing to using smp_mb() instead of smp_wmb() fixes the kernel panic > reported in cc00bcaa5899 (which is still present), while still > maintaining the same speed of replacing tables. > > The smb_mb() barriers potentially slow the packet path, however testing > has shown no measurable change in performance on a 4-core MIPS64 > platform. Okay, thanks for testing. I have no further feedback.