diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2012-01-16 16:29:10 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-02-21 12:03:49 -0500 |
commit | a858af2875fb291d0f4b0a4419fefbf03c2379c0 (patch) | |
tree | 5183796cbf50ec0cd3bd5c741db15705376dacbd /kernel/rcutree.c | |
parent | 13cfcca0e4e2d4cee1d0183c049eb34e54ac976e (diff) |
rcu: Print scheduling-clock information on RCU CPU stall-warning messages
There have been situations where RCU CPU stall warnings were caused by
issues in scheduling-clock timer initialization. To make it easier to
track these down, this commit causes the RCU CPU stall-warning messages
to print out the number of scheduling-clock interrupts taken in the
current grace period for each stalled CPU.
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r-- | kernel/rcutree.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index cfdab9898e33..dccd2f78db4e 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -689,12 +689,6 @@ static void print_other_cpu_stall(struct rcu_state *rsp) | |||
689 | return; | 689 | return; |
690 | } | 690 | } |
691 | rsp->jiffies_stall = jiffies + 3 * jiffies_till_stall_check() + 3; | 691 | rsp->jiffies_stall = jiffies + 3 * jiffies_till_stall_check() + 3; |
692 | |||
693 | /* | ||
694 | * Now rat on any tasks that got kicked up to the root rcu_node | ||
695 | * due to CPU offlining. | ||
696 | */ | ||
697 | ndetected = rcu_print_task_stall(rnp); | ||
698 | raw_spin_unlock_irqrestore(&rnp->lock, flags); | 692 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
699 | 693 | ||
700 | /* | 694 | /* |
@@ -702,8 +696,9 @@ static void print_other_cpu_stall(struct rcu_state *rsp) | |||
702 | * See Documentation/RCU/stallwarn.txt for info on how to debug | 696 | * See Documentation/RCU/stallwarn.txt for info on how to debug |
703 | * RCU CPU stall warnings. | 697 | * RCU CPU stall warnings. |
704 | */ | 698 | */ |
705 | printk(KERN_ERR "INFO: %s detected stalls on CPUs/tasks: {", | 699 | printk(KERN_ERR "INFO: %s detected stalls on CPUs/tasks:", |
706 | rsp->name); | 700 | rsp->name); |
701 | print_cpu_stall_info_begin(); | ||
707 | rcu_for_each_leaf_node(rsp, rnp) { | 702 | rcu_for_each_leaf_node(rsp, rnp) { |
708 | raw_spin_lock_irqsave(&rnp->lock, flags); | 703 | raw_spin_lock_irqsave(&rnp->lock, flags); |
709 | ndetected += rcu_print_task_stall(rnp); | 704 | ndetected += rcu_print_task_stall(rnp); |
@@ -712,11 +707,22 @@ static void print_other_cpu_stall(struct rcu_state *rsp) | |||
712 | continue; | 707 | continue; |
713 | for (cpu = 0; cpu <= rnp->grphi - rnp->grplo; cpu++) | 708 | for (cpu = 0; cpu <= rnp->grphi - rnp->grplo; cpu++) |
714 | if (rnp->qsmask & (1UL << cpu)) { | 709 | if (rnp->qsmask & (1UL << cpu)) { |
715 | printk(" %d", rnp->grplo + cpu); | 710 | print_cpu_stall_info(rsp, rnp->grplo + cpu); |
716 | ndetected++; | 711 | ndetected++; |
717 | } | 712 | } |
718 | } | 713 | } |
719 | printk("} (detected by %d, t=%ld jiffies)\n", | 714 | |
715 | /* | ||
716 | * Now rat on any tasks that got kicked up to the root rcu_node | ||
717 | * due to CPU offlining. | ||
718 | */ | ||
719 | rnp = rcu_get_root(rsp); | ||
720 | raw_spin_lock_irqsave(&rnp->lock, flags); | ||
721 | ndetected = rcu_print_task_stall(rnp); | ||
722 | raw_spin_unlock_irqrestore(&rnp->lock, flags); | ||
723 | |||
724 | print_cpu_stall_info_end(); | ||
725 | printk(KERN_CONT "(detected by %d, t=%ld jiffies)\n", | ||
720 | smp_processor_id(), (long)(jiffies - rsp->gp_start)); | 726 | smp_processor_id(), (long)(jiffies - rsp->gp_start)); |
721 | if (ndetected == 0) | 727 | if (ndetected == 0) |
722 | printk(KERN_ERR "INFO: Stall ended before state dump start\n"); | 728 | printk(KERN_ERR "INFO: Stall ended before state dump start\n"); |
@@ -740,8 +746,11 @@ static void print_cpu_stall(struct rcu_state *rsp) | |||
740 | * See Documentation/RCU/stallwarn.txt for info on how to debug | 746 | * See Documentation/RCU/stallwarn.txt for info on how to debug |
741 | * RCU CPU stall warnings. | 747 | * RCU CPU stall warnings. |
742 | */ | 748 | */ |
743 | printk(KERN_ERR "INFO: %s detected stall on CPU %d (t=%lu jiffies)\n", | 749 | printk(KERN_ERR "INFO: %s self-detected stall on CPU", rsp->name); |
744 | rsp->name, smp_processor_id(), jiffies - rsp->gp_start); | 750 | print_cpu_stall_info_begin(); |
751 | print_cpu_stall_info(rsp, smp_processor_id()); | ||
752 | print_cpu_stall_info_end(); | ||
753 | printk(KERN_CONT " (t=%lu jiffies)\n", jiffies - rsp->gp_start); | ||
745 | if (!trigger_all_cpu_backtrace()) | 754 | if (!trigger_all_cpu_backtrace()) |
746 | dump_stack(); | 755 | dump_stack(); |
747 | 756 | ||
@@ -831,6 +840,7 @@ static void __note_new_gpnum(struct rcu_state *rsp, struct rcu_node *rnp, struct | |||
831 | rdp->passed_quiesce = 0; | 840 | rdp->passed_quiesce = 0; |
832 | } else | 841 | } else |
833 | rdp->qs_pending = 0; | 842 | rdp->qs_pending = 0; |
843 | zero_cpu_stall_ticks(rdp); | ||
834 | } | 844 | } |
835 | } | 845 | } |
836 | 846 | ||
@@ -1496,6 +1506,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp) | |||
1496 | void rcu_check_callbacks(int cpu, int user) | 1506 | void rcu_check_callbacks(int cpu, int user) |
1497 | { | 1507 | { |
1498 | trace_rcu_utilization("Start scheduler-tick"); | 1508 | trace_rcu_utilization("Start scheduler-tick"); |
1509 | increment_cpu_stall_ticks(); | ||
1499 | if (user || rcu_is_cpu_rrupt_from_idle()) { | 1510 | if (user || rcu_is_cpu_rrupt_from_idle()) { |
1500 | 1511 | ||
1501 | /* | 1512 | /* |