[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181105121833.200d5b53300a7ef4df7d349d@linux-foundation.org>
Date: Mon, 5 Nov 2018 12:18:33 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Jérôme Glisse <jglisse@...hat.com>,
Oded Gabbay <oded.gabbay@....com>
Subject: Re: [PATCH] mm/mmu_notifier: rename mmu_notifier_synchronize() to
<...>_barrier()
On Mon, 5 Nov 2018 11:29:55 -0800 Sean Christopherson <sean.j.christopherson@...el.com> wrote:
> ...and update its comment to explicitly reference its association with
> mmu_notifier_call_srcu().
>
> Contrary to its name, mmu_notifier_synchronize() does not synchronize
> the notifier's SRCU instance, but rather waits for RCU callbacks to
> finished, i.e. it invokes rcu_barrier(). The RCU documentation is
> quite clear on this matter, explicitly calling out that rcu_barrier()
> does not imply synchronize_rcu(). The misnomer could lean an unwary
> developer to incorrectly assume that mmu_notifier_synchronize() can
> be used in conjunction with mmu_notifier_unregister_no_release() to
> implement a variation of mmu_notifier_unregister() that synchronizes
> SRCU without invoking ->release. A Documentation-allergic and hasty
> developer could be further confused by the fact that rcu_barrier() is
> indeed a pass-through to synchronize_rcu()... in tiny SRCU.
Fair enough.
> --- a/mm/mmu_notifier.c
> +++ b/mm/mmu_notifier.c
> @@ -35,12 +35,12 @@ void mmu_notifier_call_srcu(struct rcu_head *rcu,
> }
> EXPORT_SYMBOL_GPL(mmu_notifier_call_srcu);
>
> -void mmu_notifier_synchronize(void)
> +void mmu_notifier_barrier(void)
> {
> - /* Wait for any running method to finish. */
> + /* Wait for any running RCU callbacks (see above) to finish. */
> srcu_barrier(&srcu);
> }
> -EXPORT_SYMBOL_GPL(mmu_notifier_synchronize);
> +EXPORT_SYMBOL_GPL(mmu_notifier_barrier);
>
> /*
> * This function can't run concurrently against mmu_notifier_register
But as it has no callers, why retain it?
Powered by blists - more mailing lists