rcu: Add more information to the wrong-idle-task complaint
authorPaul E. McKenney <paul.mckenney@linaro.org>
Tue, 1 Nov 2011 15:57:21 +0000 (08:57 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 11 Dec 2011 18:31:42 +0000 (10:31 -0800)
The current code just complains if the current task is not the idle task.
This commit therefore adds printing of the identity of the idle task.

Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
kernel/rcutiny.c
kernel/rcutree.c

index 9b9bdf666fb5027a061ca50cd70c842266bb92c5..6d70ff71a875cbbfa777186a44c11defcd1f1442 100644 (file)
@@ -65,10 +65,14 @@ static void rcu_idle_enter_common(long long oldval)
        }
        RCU_TRACE(trace_rcu_dyntick("Start", oldval, rcu_dynticks_nesting));
        if (!idle_cpu(smp_processor_id())) {
-               WARN_ON_ONCE(1);        /* must be idle task! */
+               struct task_struct *idle = idle_task(smp_processor_id());
+
                RCU_TRACE(trace_rcu_dyntick("Error on entry: not idle task",
                                            oldval, rcu_dynticks_nesting));
                ftrace_dump(DUMP_ALL);
+               WARN_ONCE(1, "Current pid: %d comm: %s / Idle pid: %d comm: %s",
+                         current->pid, current->comm,
+                         idle->pid, idle->comm); /* must be idle task! */
        }
        rcu_sched_qs(0); /* implies rcu_bh_qsctr_inc(0) */
 }
@@ -115,10 +119,14 @@ static void rcu_idle_exit_common(long long oldval)
        }
        RCU_TRACE(trace_rcu_dyntick("End", oldval, rcu_dynticks_nesting));
        if (!idle_cpu(smp_processor_id())) {
-               WARN_ON_ONCE(1);        /* must be idle task! */
+               struct task_struct *idle = idle_task(smp_processor_id());
+
                RCU_TRACE(trace_rcu_dyntick("Error on exit: not idle task",
                          oldval, rcu_dynticks_nesting));
                ftrace_dump(DUMP_ALL);
+               WARN_ONCE(1, "Current pid: %d comm: %s / Idle pid: %d comm: %s",
+                         current->pid, current->comm,
+                         idle->pid, idle->comm); /* must be idle task! */
        }
 }
 
index 06e40dd53b23847a8aadadd966e26db6a39e76aa..9888a0ad2d4e4db156897b0f5eb460410ab2d555 100644 (file)
@@ -356,10 +356,14 @@ static void rcu_idle_enter_common(struct rcu_dynticks *rdtp, long long oldval)
        }
        trace_rcu_dyntick("Start", oldval, rdtp->dynticks_nesting);
        if (!idle_cpu(smp_processor_id())) {
-               WARN_ON_ONCE(1);        /* must be idle task! */
+               struct task_struct *idle = idle_task(smp_processor_id());
+
                trace_rcu_dyntick("Error on entry: not idle task",
                                   oldval, rdtp->dynticks_nesting);
                ftrace_dump(DUMP_ALL);
+               WARN_ONCE(1, "Current pid: %d comm: %s / Idle pid: %d comm: %s",
+                         current->pid, current->comm,
+                         idle->pid, idle->comm); /* must be idle task! */
        }
        /* CPUs seeing atomic_inc() must see prior RCU read-side crit sects */
        smp_mb__before_atomic_inc();  /* See above. */
@@ -445,10 +449,14 @@ static void rcu_idle_exit_common(struct rcu_dynticks *rdtp, long long oldval)
        WARN_ON_ONCE(!(atomic_read(&rdtp->dynticks) & 0x1));
        trace_rcu_dyntick("End", oldval, rdtp->dynticks_nesting);
        if (!idle_cpu(smp_processor_id())) {
-               WARN_ON_ONCE(1);        /* must be idle task! */
+               struct task_struct *idle = idle_task(smp_processor_id());
+
                trace_rcu_dyntick("Error on exit: not idle task",
                                  oldval, rdtp->dynticks_nesting);
                ftrace_dump(DUMP_ALL);
+               WARN_ONCE(1, "Current pid: %d comm: %s / Idle pid: %d comm: %s",
+                         current->pid, current->comm,
+                         idle->pid, idle->comm); /* must be idle task! */
        }
 }