summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2022-05-25 18:49:26 +0200
committerPaul E. McKenney <paulmck@kernel.org>2022-06-20 18:22:28 +0200
commitf90f19da88bfe32dd1fdfd104de4c0526a3be701 (patch)
tree6c57295b118e5be4fcceb97ff4eaa2bd755d90da
parentrcu-tasks: Make RCU Tasks Trace stall warnings print full .b.need_qs field (diff)
downloadlinux-f90f19da88bfe32dd1fdfd104de4c0526a3be701.tar.xz
linux-f90f19da88bfe32dd1fdfd104de4c0526a3be701.zip
rcu-tasks: Make RCU Tasks Trace stall warning handle idle offline tasks
When a CPU is offline, its idle task can appear to be running, but it cannot be doing anything while CPU-hotplug operations are excluded. This commit takes advantage of that fact by making trc_check_slow_task() check for task_curr(t) && cpu_online(task_cpu(t)), and recording full information in that case. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: Peter Zijlstra <peterz@infradead.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>
-rw-r--r--kernel/rcu/tasks.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index 5eefbab7f2ed..64eb4d7b142e 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -1476,7 +1476,7 @@ static int trc_check_slow_task(struct task_struct *t, void *arg)
{
struct trc_stall_chk_rdr *trc_rdrp = arg;
- if (task_curr(t))
+ if (task_curr(t) && cpu_online(task_cpu(t)))
return false; // It is running, so decline to inspect it.
trc_rdrp->nesting = READ_ONCE(t->trc_reader_nesting);
trc_rdrp->ipi_to_cpu = READ_ONCE(t->trc_ipi_to_cpu);