在 2026/9/11 16:11, [email protected] 写道:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s)
> to consider:
> - [Medium] The commit message incorrectly claims to replace
> `for_each_thread()` with `for_each_thread_rculock()`, but the code actually
> replaces `for_each_process()` with `for_each_process_rculock()`.
> --
>
> commit 3ac98de6fbc4e97ba4981ef0c4941692c15a9309
> Author: Ye Liu <[email protected]>
>
> cpu/hotplug: convert thread iterator to for_each_thread_rculock
>
> This commit replaces a manual rcu_read_lock() and rcu_read_unlock() pair
> in clear_tasks_mm_cpumask() with a scoped RCU lock iterator macro.
>
>> cpu/hotplug: convert thread iterator to for_each_thread_rculock
>>
>> Replace the manual rcu_read_lock()/rcu_read_unlock() pair combined
>> with for_each_thread() loop in kernel/cpu.c with for_each_thread_rculock(),
>
> [Severity: Medium]
> Is the commit message accurate regarding the iterator being replaced?
>
> The commit message subject and body describe converting a thread iterator
> using for_each_thread() to for_each_thread_rculock(). However, looking at
> clear_tasks_mm_cpumask() in the diff:
>
>> diff --git a/kernel/cpu.c b/kernel/cpu.c
>> index b3c8553d7bd6c..00638d2abc0f6 100644
>> --- a/kernel/cpu.c
>> +++ b/kernel/cpu.c
>> @@ -1254,8 +1254,7 @@ void clear_tasks_mm_cpumask(int cpu)
>> * full-fledged tasklist_lock.
>> */
>> WARN_ON(cpu_online(cpu));
>> - rcu_read_lock();
>> - for_each_process(p) {
>> + for_each_process_rculock(p) {
>
> The code actually replaces for_each_process() with for_each_process_rculock().
>
> Could the commit message be updated to match the process iterator actually
> used in the patch to avoid confusion during review or bisection?
>
Sorry, copy error. It should be the following content:
cpu/hotplug: convert process iterator to for_each_process_rculock
Replace the manual rcu_read_lock()/rcu_read_unlock() pair combined
with for_each_process() loop in kernel/cpu.c with
for_each_process_rculock(),
which scopes the RCU read lock to the loop body via scoped_guard(rcu).
No functional change.
--
Thanks,
Ye Liu