Re: [PATCH v4 1/3] rcu-tasks: Add helpers to visit tasks on the exit lists

From: Ravindran, Binoy

Date: Fri Nov 27 2026 - 13:56:45 EST



Hi Petr,

> Nit: I would be nice to make the commit messages better human
> readable.

Thanks. I will rewrite them in that style, with each helper in its own
numbered item.

> Is it acceptable to process all entries while keeping the
> raw_spin_lock()?

No, you are right. The walk length is unbounded when many tasks are
exiting.

> IMHO, a better approach would be to make rcu_tasks_postscan()
> generic function to do an operation on the rcu_tasks_exit_list and
> release the spin lock regularly.

Agreed. v5 will turn the lock-dropping loop in rcu_tasks_postscan()
into a helper that takes a callback, with one cursor per user, and
drop the snapshot array. The livepatch steps will not deduplicate
against the task list anymore, so they do not need to walk the exit
lists under tasklist_lock, and the lock can be dropped during the
walk.

v5 will also handle a failed schedule_on_each_cpu() rather than assume
it succeeds, and I will check the recursive-fault path in
make_task_dead(), which skips the normal exit.

Thanks,
Binoy