[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220217110948.35477-1-linmiaohe@huawei.com>
Date: Thu, 17 Feb 2022 19:09:48 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: <akpm@...ux-foundation.org>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
<linmiaohe@...wei.com>
Subject: [PATCH] mm/mmu_notifiers: use helper function mmu_notifier_synchronize()
Use helper function mmu_notifier_synchronize() to ensure all mmu_notifiers
are freed. Minor readability improvement.
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
mm/mmu_notifier.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
index 459d195d2ff6..159f70c20236 100644
--- a/mm/mmu_notifier.c
+++ b/mm/mmu_notifier.c
@@ -334,15 +334,15 @@ static void mn_hlist_release(struct mmu_notifier_subscriptions *subscriptions,
srcu_read_unlock(&srcu, id);
/*
- * synchronize_srcu here prevents mmu_notifier_release from returning to
- * exit_mmap (which would proceed with freeing all pages in the mm)
- * until the ->release method returns, if it was invoked by
- * mmu_notifier_unregister.
+ * mmu_notifier_synchronize here prevents mmu_notifier_release from
+ * returning to exit_mmap (which would proceed with freeing all pages
+ * in the mm) until the ->release method returns, if it was invoked
+ * by mmu_notifier_unregister.
*
* The notifier_subscriptions can't go away from under us because
* one mm_count is held by exit_mmap.
*/
- synchronize_srcu(&srcu);
+ mmu_notifier_synchronize();
}
void __mmu_notifier_release(struct mm_struct *mm)
@@ -851,7 +851,7 @@ void mmu_notifier_unregister(struct mmu_notifier *subscription,
* Wait for any running method to finish, of course including
* ->release if it was run by mmu_notifier_release instead of us.
*/
- synchronize_srcu(&srcu);
+ mmu_notifier_synchronize();
BUG_ON(atomic_read(&mm->mm_count) <= 0);
--
2.23.0
Powered by blists - more mailing lists