Commit 19415004 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcu-tasks: Avoid rcu_tasks_trace_pertask() duplicate list additions



This commit adds checks within rcu_tasks_trace_pertask() to avoid
duplicate (and destructive) additions to the holdouts list.  These checks
will be required later due to the possibility of a given task having
blocked while in an RCU Tasks Trace read-side critical section, but now
running on a CPU.

Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
Cc: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: KP Singh <kpsingh@kernel.org>
parent 1fa98e2e
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1455,8 +1455,9 @@ static void rcu_tasks_trace_pertask(struct task_struct *t,
{
	// During early boot when there is only the one boot CPU, there
	// is no idle task for the other CPUs.	Also, the grace-period
	// kthread is always in a quiescent state.  Either way, just return.
	if (unlikely(t == NULL) || t == current)
	// kthread is always in a quiescent state.  In addition, just return
	// if this task is already on the list.
	if (unlikely(t == NULL) || t == current || !list_empty(&t->trc_holdout_list))
		return;

	rcu_st_need_qs(t, 0);