All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
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.
Date: Tue, 9 Mar 2021 12:33:48 +0100	[thread overview]
Message-ID: <20210309113348.GE10808@breakpoint.cc> (raw)
In-Reply-To: <20210308012413.14383-4-mark.tomlinson@alliedtelesis.co.nz>

Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz> 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.

  reply	other threads:[~2021-03-09 11:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08  1:24 [PATCH v2 0/3] Don't use RCU for x_tables synchronization Mark Tomlinson
2021-03-08  1:24 ` [PATCH v2 1/3] Revert "netfilter: x_tables: Update remaining dereference to RCU" Mark Tomlinson
2021-03-08  1:24 ` [PATCH v2 2/3] Revert "netfilter: x_tables: Switch synchronization " Mark Tomlinson
2021-03-08  1:24 ` [PATCH v2 3/3] netfilter: x_tables: Use correct memory barriers Mark Tomlinson
2021-03-09 11:33   ` Florian Westphal [this message]
2021-03-11 15:51 ` [PATCH v2 0/3] Don't use RCU for x_tables synchronization Tyler Hicks
2021-03-15 17:42 ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210309113348.GE10808@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=kadlec@netfilter.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.tomlinson@alliedtelesis.co.nz \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=subashab@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.