rcu-tasks: Don't remove tasks with pending IPIs from holdout list
authorPaul E. McKenney <paulmck@kernel.org>
Sun, 19 Sep 2021 03:40:48 +0000 (20:40 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 1 Dec 2021 01:29:06 +0000 (17:29 -0800)
commitf5dbc594b5bac1fa694174032b8d3d0249945fd3
treeb05097ac49921275a8264d51b5d14210cb8557bd
parent8c0abfd6d2f6b0221194241ac2908751a2a0385f
rcu-tasks: Don't remove tasks with pending IPIs from holdout list

Currently, the check_all_holdout_tasks_trace() function removes all tasks
marked with ->trc_reader_checked from the holdout list, including those
with IPIs pending.  This means that the IPI handler might arrive at
a task that has already been removed from the list, which is at best
an accident waiting to happen.

This commit therefore avoids removing tasks with IPIs pending from
the holdout list.  This in turn means that the "if" condition in the
for_each_online_cpu() loop in rcu_tasks_trace_postgp() should always
evaluate to false, so a WARN_ON_ONCE() is added to check that.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tasks.h