From: Ye Liu <liuye@kylinos.cn>
Replace guard(rcu)() combined with for_each_process_thread() loop in
kernel/unwind/deferred.c with for_each_process_thread_rculock(),
which scopes the RCU read lock to the loop body via scoped_guard(rcu).
No functional change.
Signed-off-by: Ye Liu <liuye@kylinos.cn>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: SJ Park <sj@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
---
Changes in v3:
- Split from kernel/ patch in v2 (Peter Zijlstra, Steven Rostedt)
Changes in v2:
- Rename *_rcu to *_rculock
kernel/unwind/deferred.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/unwind/deferred.c b/kernel/unwind/deferred.c
index 5bea47314254..ecfe1336095e 100644
--- a/kernel/unwind/deferred.c
+++ b/kernel/unwind/deferred.c
@@ -319,9 +319,8 @@ void unwind_deferred_cancel(struct unwind_work *work)
synchronize_srcu(&unwind_srcu);
- guard(rcu)();
/* Clear this bit from all threads */
- for_each_process_thread(g, t) {
+ for_each_process_thread_rculock(g, t) {
atomic_long_andnot(BIT(bit),
&t->unwind_info.unwind_mask);
if (t->unwind_info.cache)--
2.25.1