Re: [PATCH 6/8] fs: convert process/thread iterators to for_each_*_rcu
From: Oleg Nesterov
Date: Fri Sep 04 2026 - 05:22:40 EST
On 09/04, Ye Liu wrote:
>
> @@ -1160,8 +1160,7 @@ static int __set_oom_adj(struct file *file, int oom_adj, bool legacy)
> if (mm) {
> struct task_struct *p;
>
> - rcu_read_lock();
> - for_each_process(p) {
> + for_each_process_rcu(p) {
> if (same_thread_group(task, p))
> continue;
Hmm... I am not aware of for_each_process_rcu(), but looking at this
change I guess it includes something like scope_guard(rcu) ?
Perhaps makes sense, but the naming looks sligthly confusing to me.
I mean, to for_each_process_rcu() looks like (say) list_for_each_entry_rcu()
where _rcu has another meaning...
Oleg.