]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
rcu: Fix CONFIG_RCU_FAST_NO_HZ stall warning message
authorPaul E. McKenney <paul.mckenney@linaro.org>
Fri, 21 Sep 2012 17:41:50 +0000 (10:41 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 23 Sep 2012 14:42:52 +0000 (07:42 -0700)
The print_cpu_stall_fast_no_hz() function attempts to print -1 when
the ->idle_gp_timer is not pending, but unsigned arithmetic causes it
to instead print ULONG_MAX, which is 4294967295 on 32-bit systems and
18446744073709551615 on 64-bit systems.  Neither of these are the most
reader-friendly values, so this commit instead causes "timer not pending"
to be printed when ->idle_gp_timer is not pending.

Reported-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Documentation/RCU/stallwarn.txt
kernel/rcutree_plugin.h

index 523364e4e1f11bb5ecaf4477b118e570dfa79611..1927151b386bb68650e44cb8a03d767f01c8d89a 100644 (file)
@@ -99,7 +99,7 @@ In kernels with CONFIG_RCU_FAST_NO_HZ, even more information is
 printed:
 
        INFO: rcu_preempt detected stall on CPU
-       0: (64628 ticks this GP) idle=dd5/3fffffffffffffff/0 drain=0 . timer=-1
+       0: (64628 ticks this GP) idle=dd5/3fffffffffffffff/0 drain=0 . timer not pending
           (t=65000 jiffies)
 
 The "(64628 ticks this GP)" indicates that this CPU has taken more
@@ -116,13 +116,13 @@ number between the two "/"s is the value of the nesting, which will
 be a small positive number if in the idle loop and a very large positive
 number (as shown above) otherwise.
 
-For CONFIG_RCU_FAST_NO_HZ kernels, the "drain=0" indicates that the
-CPU is not in the process of trying to force itself into dyntick-idle
-state, the "." indicates that the CPU has not given up forcing RCU
-into dyntick-idle mode (it would be "H" otherwise), and the "timer=-1"
-indicates that the CPU has not recented forced RCU into dyntick-idle
-mode (it would otherwise indicate the number of microseconds remaining
-in this forced state).
+For CONFIG_RCU_FAST_NO_HZ kernels, the "drain=0" indicates that the CPU is
+not in the process of trying to force itself into dyntick-idle state, the
+"." indicates that the CPU has not given up forcing RCU into dyntick-idle
+mode (it would be "H" otherwise), and the "timer not pending" indicates
+that the CPU has not recently forced RCU into dyntick-idle mode (it
+would otherwise indicate the number of microseconds remaining in this
+forced state).
 
 
 Multiple Warnings From One Stall
index df47014e129d302c4927f11e4c282c01a825d874..e12d07ba601a7e1a6f8e816db91d2d295dcd3b0b 100644 (file)
@@ -2130,11 +2130,15 @@ static void print_cpu_stall_fast_no_hz(char *cp, int cpu)
 {
        struct rcu_dynticks *rdtp = &per_cpu(rcu_dynticks, cpu);
        struct timer_list *tltp = &rdtp->idle_gp_timer;
+       char c;
 
-       sprintf(cp, "drain=%d %c timer=%lu",
-               rdtp->dyntick_drain,
-               rdtp->dyntick_holdoff == jiffies ? 'H' : '.',
-               timer_pending(tltp) ? tltp->expires - jiffies : -1);
+       c = rdtp->dyntick_holdoff == jiffies ? 'H' : '.';
+       if (timer_pending(tltp))
+               sprintf(cp, "drain=%d %c timer=%lu",
+                       rdtp->dyntick_drain, c, tltp->expires - jiffies);
+       else
+               sprintf(cp, "drain=%d %c timer not pending",
+                       rdtp->dyntick_drain, c);
 }
 
 #else /* #ifdef CONFIG_RCU_FAST_NO_HZ */