Re: [PATCH v2 5/8] kernel: convert process/thread iterators to for_each_*_rculock
From: Peter Zijlstra
Date: Tue Sep 08 2026 - 03:49:48 EST
On Mon, Sep 07, 2026 at 04:13:31PM +0800, Ye Liu wrote:
> From: Ye Liu <liuye@xxxxxxxxxx>
>
> Replace the manual rcu_read_lock()/rcu_read_unlock() and guard(rcu)
> pairs combined with for_each_process(), for_each_thread() and
> for_each_process_thread() loops across kernel/ with the
> for_each_*_rculock() macros, which scope the RCU read lock to the
> loop body via scoped_guard(rcu).
>
> No functional change.
>
> Signed-off-by: Ye Liu <liuye@xxxxxxxxxx>
> Acked-by: Michal Hocko <mhocko@xxxxxxxx>
> ---
> Changes in v2:
> - Rename *_rcu to *_rculock
> - Rename stale 'unlock:' label to 'out:' in hung_task.c (Günther Noack)
> kernel/cpu.c | 4 +---
> kernel/freezer.c | 4 +---
> kernel/hung_task.c | 11 ++++-------
> kernel/locking/lockdep.c | 4 +---
> kernel/rcu/update.c | 4 +---
> kernel/sched/core.c | 3 +--
> kernel/sched/debug.c | 4 +---
> kernel/trace/fgraph.c | 8 ++------
> kernel/unwind/deferred.c | 3 +--
> 9 files changed, 13 insertions(+), 32 deletions(-)
This is not something that can be applied.