[PATCH v3 12/15] unwind: convert process/thread iterator to for_each_process_thread_rculock
Ye Liu
ye.liu at linux.dev
Fri Sep 11 07:57:57 UTC 2026
From: Ye Liu <liuye at 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 at kylinos.cn>
Acked-by: Michal Hocko <mhocko at suse.com>
Reviewed-by: SJ Park <sj at kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs at kernel.org>
Reviewed-by: Oleg Nesterov <oleg at 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
More information about the Linux-security-module-archive
mailing list