[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160829105122.GJ10153@twins.programming.kicks-ass.net>
Date: Mon, 29 Aug 2016 12:51:22 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Manfred Spraul <manfred@...orfullife.com>
Cc: benh@...nel.crashing.org, paulmck@...ux.vnet.ibm.com,
Ingo Molnar <mingo@...e.hu>, Boqun Feng <boqun.feng@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>, 1vier1@....de,
Davidlohr Bueso <dave@...olabs.net>
Subject: Re: [PATCH 3/4] net/netfilter/nf_conntrack_core: update memory
barriers.
On Sun, Aug 28, 2016 at 01:56:15PM +0200, Manfred Spraul wrote:
> +++ b/net/netfilter/nf_conntrack_core.c
> @@ -80,20 +80,29 @@ static __read_mostly bool nf_conntrack_locks_all;
>
> void nf_conntrack_lock(spinlock_t *lock) __acquires(lock)
> {
> + /* Step 1: Acquire the lock */
> spin_lock(lock);
> - while (unlikely(nf_conntrack_locks_all)) {
> - spin_unlock(lock);
>
> - /*
> - * Order the 'nf_conntrack_locks_all' load vs. the
> - * spin_unlock_wait() loads below, to ensure
> - * that 'nf_conntrack_locks_all_lock' is indeed held:
> - */
> - smp_rmb(); /* spin_lock(&nf_conntrack_locks_all_lock) */
> - spin_unlock_wait(&nf_conntrack_locks_all_lock);
> - spin_lock(lock);
> - }
> + /* Step 2: make it visible to all CPUs that we hold the lock */
> + smp_mb__after_spin_lock();
I hate this comment. A barrier does _not_ make visible anything.
A barrier _orders_ things.
Powered by blists - more mailing lists