From: Paul E. McKenney Date: Wed, 25 May 2022 01:19:17 +0000 (-0700) Subject: rcu-tasks: RCU Tasks Trace grace-period kthread has implicit QS X-Git-Tag: v6.0-rc1~163^2~1^5~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d4c90d755d5703d5a74fac0870c0a697250ec33;p=thirdparty%2Flinux.git rcu-tasks: RCU Tasks Trace grace-period kthread has implicit QS Because the task driving the grace-period kthread is in quiescent state throughout, this commit excludes it from the list of tasks from which a quiescent state is needed. This does mean that attaching a sleepable BPF program to function in kernel/rcu/tasks.h is a bad idea, by the way. Signed-off-by: Paul E. McKenney Cc: Neeraj Upadhyay Cc: Eric Dumazet Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Martin KaFai Lau Cc: KP Singh --- diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 414861d651964..554b2e59a1d5a 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -1433,8 +1433,9 @@ static void rcu_tasks_trace_pertask(struct task_struct *t, struct list_head *hop) { // During early boot when there is only the one boot CPU, there - // is no idle task for the other CPUs. Just return. - if (unlikely(t == NULL)) + // 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) return; rcu_st_need_qs(t, 0);