Re: [PATCH] change next_thread() to use list_next_entry_circular()
From: Oleg Nesterov
Date: Sat Dec 05 2026 - 11:19:50 EST
On 12/05, Oleg Nesterov wrote:
>
> Not for inclusion yet. I need to recheck and write a better changelog.
> Plus see TODO below. Just to get a review from sashiko at least ;)
>
> The only problem is that list_next_entry_circular() expects
> signal->thread_head to be not empty, and as Nickolai Zeldovich
> pointed out this is not necessarily true in cgroup code if "leader"
> was already reaped. So change cgroup.c to use for_each_thread().
>
> TODO: we actually need an list_next_entry_circular_rcu() which we
> don't have yet.
OK, sashiko rightly complains that "replacing __next_thread() with
list_next_entry_circular() break RCU-only traversal", see
https://sashiko.dev/#/patchset/axQ02FJTsnV-P6jA%40redhat.com
But this is exactly what I tried to say in "TODO". I'll send V2
when I have time.
Oleg.