Thread (45 messages) flat view 45 messages, 8 authors, 1d ago

Re: [PATCH v2 5/8] kernel: convert process/thread iterators to for_each_*_rculock

From: Peter Zijlstra <peterz@infradead.org>
Date: 2026-09-08 07:42:39
Also in: linux-fsdevel, linux-mm, linux-pm, linux-security-module, lkml, rcu

On Mon, Sep 07, 2026 at 04:13:31PM +0800, Ye Liu wrote:
From: Ye Liu <liuye@kylinos.cn>

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@kylinos.cn>
Acked-by: Michal Hocko <mhocko@suse.com>
---
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help