aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcuclassic.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-08-11 07:34:15 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-11 07:35:18 -0400
commit78635fc739b1254f3e0362ac430edbdd2cff01dc (patch)
tree9cb480451f63260951b4b46d3b6026934174c39c /kernel/rcuclassic.c
parent67182ae1c42206e516f7efb292b745e826497b24 (diff)
rcu, debug: detect stalled grace periods, cleanups
small cleanups. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/rcuclassic.c')
-rw-r--r--kernel/rcuclassic.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c
index d7ec731de75c..56b8712fe5aa 100644
--- a/kernel/rcuclassic.c
+++ b/kernel/rcuclassic.c
@@ -294,6 +294,7 @@ static inline void record_gp_check_time(struct rcu_ctrlblk *rcp)
294{ 294{
295 rcp->gp_check = get_seconds() + 3; 295 rcp->gp_check = get_seconds() + 3;
296} 296}
297
297static void print_other_cpu_stall(struct rcu_ctrlblk *rcp) 298static void print_other_cpu_stall(struct rcu_ctrlblk *rcp)
298{ 299{
299 int cpu; 300 int cpu;
@@ -303,11 +304,9 @@ static void print_other_cpu_stall(struct rcu_ctrlblk *rcp)
303 304
304 spin_lock(&rcp->lock); 305 spin_lock(&rcp->lock);
305 delta = get_seconds() - rcp->gp_check; 306 delta = get_seconds() - rcp->gp_check;
306 if (delta < 2L || 307 if (delta < 2L || cpus_empty(rcp->cpumask)) {
307 cpus_empty(rcp->cpumask)) {
308 spin_unlock(&rcp->lock); 308 spin_unlock(&rcp->lock);
309 return; 309 return;
310 rcp->gp_check = get_seconds() + 30;
311 } 310 }
312 spin_unlock(&rcp->lock); 311 spin_unlock(&rcp->lock);
313 312
@@ -319,6 +318,7 @@ static void print_other_cpu_stall(struct rcu_ctrlblk *rcp)
319 printk(" (detected by %d, t=%lu/%lu)\n", 318 printk(" (detected by %d, t=%lu/%lu)\n",
320 smp_processor_id(), get_seconds(), rcp->gp_check); 319 smp_processor_id(), get_seconds(), rcp->gp_check);
321} 320}
321
322static void print_cpu_stall(struct rcu_ctrlblk *rcp) 322static void print_cpu_stall(struct rcu_ctrlblk *rcp)
323{ 323{
324 printk(KERN_ERR "RCU detected CPU %d stall (t=%lu/%lu)\n", 324 printk(KERN_ERR "RCU detected CPU %d stall (t=%lu/%lu)\n",
@@ -329,8 +329,8 @@ static void print_cpu_stall(struct rcu_ctrlblk *rcp)
329 rcp->gp_check = get_seconds() + 30; 329 rcp->gp_check = get_seconds() + 30;
330 spin_unlock(&rcp->lock); 330 spin_unlock(&rcp->lock);
331} 331}
332static inline void check_cpu_stall(struct rcu_ctrlblk *rcp, 332
333 struct rcu_data *rdp) 333static void check_cpu_stall(struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
334{ 334{
335 long delta; 335 long delta;
336 336
@@ -341,12 +341,11 @@ static inline void check_cpu_stall(struct rcu_ctrlblk *rcp,
341 341
342 print_cpu_stall(rcp); 342 print_cpu_stall(rcp);
343 343
344 } else if (!cpus_empty(rcp->cpumask) && delta >= 2L) { 344 } else {
345 345 if (!cpus_empty(rcp->cpumask) && delta >= 2L) {
346 /* They had two seconds to dump stack, so complain. */ 346 /* They had two seconds to dump stack, so complain. */
347 347 print_other_cpu_stall(rcp);
348 print_other_cpu_stall(rcp); 348 }
349
350 } 349 }
351} 350}
352 351
@@ -355,8 +354,9 @@ static inline void check_cpu_stall(struct rcu_ctrlblk *rcp,
355static inline void record_gp_check_time(struct rcu_ctrlblk *rcp) 354static inline void record_gp_check_time(struct rcu_ctrlblk *rcp)
356{ 355{
357} 356}
358static inline void check_cpu_stall(struct rcu_ctrlblk *rcp, 357
359 struct rcu_data *rdp) 358static inline void
359check_cpu_stall(struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
360{ 360{
361} 361}
362 362