diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2012-09-21 13:41:50 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-09-23 10:42:52 -0400 |
commit | 86f343b50bb9f56cce60fade22da9defff28934c (patch) | |
tree | c2951c5b76afcd56a3d9f4a5d1d40e95528f3bbe | |
parent | 22a767269a767b3ee91e4aaea353ac6bec6a912d (diff) |
rcu: Fix CONFIG_RCU_FAST_NO_HZ stall warning message
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>
-rw-r--r-- | Documentation/RCU/stallwarn.txt | 16 | ||||
-rw-r--r-- | kernel/rcutree_plugin.h | 12 |
2 files changed, 16 insertions, 12 deletions
diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt index 523364e4e1f1..1927151b386b 100644 --- a/Documentation/RCU/stallwarn.txt +++ b/Documentation/RCU/stallwarn.txt | |||
@@ -99,7 +99,7 @@ In kernels with CONFIG_RCU_FAST_NO_HZ, even more information is | |||
99 | printed: | 99 | printed: |
100 | 100 | ||
101 | INFO: rcu_preempt detected stall on CPU | 101 | INFO: rcu_preempt detected stall on CPU |
102 | 0: (64628 ticks this GP) idle=dd5/3fffffffffffffff/0 drain=0 . timer=-1 | 102 | 0: (64628 ticks this GP) idle=dd5/3fffffffffffffff/0 drain=0 . timer not pending |
103 | (t=65000 jiffies) | 103 | (t=65000 jiffies) |
104 | 104 | ||
105 | The "(64628 ticks this GP)" indicates that this CPU has taken more | 105 | 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 | |||
116 | be a small positive number if in the idle loop and a very large positive | 116 | be a small positive number if in the idle loop and a very large positive |
117 | number (as shown above) otherwise. | 117 | number (as shown above) otherwise. |
118 | 118 | ||
119 | For CONFIG_RCU_FAST_NO_HZ kernels, the "drain=0" indicates that the | 119 | For CONFIG_RCU_FAST_NO_HZ kernels, the "drain=0" indicates that the CPU is |
120 | CPU is not in the process of trying to force itself into dyntick-idle | 120 | not in the process of trying to force itself into dyntick-idle state, the |
121 | state, the "." indicates that the CPU has not given up forcing RCU | 121 | "." indicates that the CPU has not given up forcing RCU into dyntick-idle |
122 | into dyntick-idle mode (it would be "H" otherwise), and the "timer=-1" | 122 | mode (it would be "H" otherwise), and the "timer not pending" indicates |
123 | indicates that the CPU has not recented forced RCU into dyntick-idle | 123 | that the CPU has not recently forced RCU into dyntick-idle mode (it |
124 | mode (it would otherwise indicate the number of microseconds remaining | 124 | would otherwise indicate the number of microseconds remaining in this |
125 | in this forced state). | 125 | forced state). |
126 | 126 | ||
127 | 127 | ||
128 | Multiple Warnings From One Stall | 128 | Multiple Warnings From One Stall |
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index df47014e129d..e12d07ba601a 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h | |||
@@ -2130,11 +2130,15 @@ static void print_cpu_stall_fast_no_hz(char *cp, int cpu) | |||
2130 | { | 2130 | { |
2131 | struct rcu_dynticks *rdtp = &per_cpu(rcu_dynticks, cpu); | 2131 | struct rcu_dynticks *rdtp = &per_cpu(rcu_dynticks, cpu); |
2132 | struct timer_list *tltp = &rdtp->idle_gp_timer; | 2132 | struct timer_list *tltp = &rdtp->idle_gp_timer; |
2133 | char c; | ||
2133 | 2134 | ||
2134 | sprintf(cp, "drain=%d %c timer=%lu", | 2135 | c = rdtp->dyntick_holdoff == jiffies ? 'H' : '.'; |
2135 | rdtp->dyntick_drain, | 2136 | if (timer_pending(tltp)) |
2136 | rdtp->dyntick_holdoff == jiffies ? 'H' : '.', | 2137 | sprintf(cp, "drain=%d %c timer=%lu", |
2137 | timer_pending(tltp) ? tltp->expires - jiffies : -1); | 2138 | rdtp->dyntick_drain, c, tltp->expires - jiffies); |
2139 | else | ||
2140 | sprintf(cp, "drain=%d %c timer not pending", | ||
2141 | rdtp->dyntick_drain, c); | ||
2138 | } | 2142 | } |
2139 | 2143 | ||
2140 | #else /* #ifdef CONFIG_RCU_FAST_NO_HZ */ | 2144 | #else /* #ifdef CONFIG_RCU_FAST_NO_HZ */ |