+ mm-mmu_notifier-rename-mmu_notifier_synchronize-to-_barrier.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm/mmu_notifier.c: rename mmu_notifier_synchronize() to <...>_barrier()
has been added to the -mm tree.  Its filename is
     mm-mmu_notifier-rename-mmu_notifier_synchronize-to-_barrier.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-mmu_notifier-rename-mmu_notifier_synchronize-to-_barrier.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-mmu_notifier-rename-mmu_notifier_synchronize-to-_barrier.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
Subject: mm/mmu_notifier.c: rename mmu_notifier_synchronize() to <...>_barrier()

... 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 finishe,
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.

Link: http://lkml.kernel.org/r/20181105192955.26305-1-sean.j.christopherson@xxxxxxxxx
Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Jérôme Glisse <jglisse@xxxxxxxxxx>
Cc: Oded Gabbay <oded.gabbay@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/mmu_notifier.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/mm/mmu_notifier.c~mm-mmu_notifier-rename-mmu_notifier_synchronize-to-_barrier
+++ a/mm/mmu_notifier.c
@@ -35,12 +35,12 @@ void mmu_notifier_call_srcu(struct rcu_h
 }
 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
_

Patches currently in -mm which might be from sean.j.christopherson@xxxxxxxxx are

mm-mmu_notifier-rename-mmu_notifier_synchronize-to-_barrier.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux