diff options
Diffstat (limited to 'kernel/rcu/tree_stall.h')
| -rw-r--r-- | kernel/rcu/tree_stall.h | 37 | 
1 files changed, 34 insertions, 3 deletions
diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index 5653560573e2..b10b8349bb2a 100644 --- a/kernel/rcu/tree_stall.h +++ b/kernel/rcu/tree_stall.h @@ -39,7 +39,7 @@ int rcu_exp_jiffies_till_stall_check(void)  	// CONFIG_RCU_EXP_CPU_STALL_TIMEOUT, so check the allowed range.  	// The minimum clamped value is "2UL", because at least one full  	// tick has to be guaranteed. -	till_stall_check = clamp(msecs_to_jiffies(cpu_stall_timeout), 2UL, 21UL * HZ); +	till_stall_check = clamp(msecs_to_jiffies(cpu_stall_timeout), 2UL, 300UL * HZ);  	if (cpu_stall_timeout && jiffies_to_msecs(till_stall_check) != cpu_stall_timeout)  		WRITE_ONCE(rcu_exp_cpu_stall_timeout, jiffies_to_msecs(till_stall_check)); @@ -428,6 +428,35 @@ static bool rcu_is_rcuc_kthread_starving(struct rcu_data *rdp, unsigned long *jp  	return j > 2 * HZ;  } +static void print_cpu_stat_info(int cpu) +{ +	struct rcu_snap_record rsr, *rsrp; +	struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu); +	struct kernel_cpustat *kcsp = &kcpustat_cpu(cpu); + +	if (!rcu_cpu_stall_cputime) +		return; + +	rsrp = &rdp->snap_record; +	if (rsrp->gp_seq != rdp->gp_seq) +		return; + +	rsr.cputime_irq     = kcpustat_field(kcsp, CPUTIME_IRQ, cpu); +	rsr.cputime_softirq = kcpustat_field(kcsp, CPUTIME_SOFTIRQ, cpu); +	rsr.cputime_system  = kcpustat_field(kcsp, CPUTIME_SYSTEM, cpu); + +	pr_err("\t         hardirqs   softirqs   csw/system\n"); +	pr_err("\t number: %8ld %10d %12lld\n", +		kstat_cpu_irqs_sum(cpu) - rsrp->nr_hardirqs, +		kstat_cpu_softirqs_sum(cpu) - rsrp->nr_softirqs, +		nr_context_switches_cpu(cpu) - rsrp->nr_csw); +	pr_err("\tcputime: %8lld %10lld %12lld   ==> %d(ms)\n", +		div_u64(rsr.cputime_irq - rsrp->cputime_irq, NSEC_PER_MSEC), +		div_u64(rsr.cputime_softirq - rsrp->cputime_softirq, NSEC_PER_MSEC), +		div_u64(rsr.cputime_system - rsrp->cputime_system, NSEC_PER_MSEC), +		jiffies_to_msecs(jiffies - rsrp->jiffies)); +} +  /*   * Print out diagnostic information for the specified stalled CPU.   * @@ -484,6 +513,8 @@ static void print_cpu_stall_info(int cpu)  	       data_race(rcu_state.n_force_qs) - rcu_state.n_force_qs_gpstart,  	       rcuc_starved ? buf : "",  	       falsepositive ? " (false positive?)" : ""); + +	print_cpu_stat_info(cpu);  }  /* Complain about starvation of grace-period kthread.  */ @@ -588,7 +619,7 @@ static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps)  	for_each_possible_cpu(cpu)  		totqlen += rcu_get_n_cbs_cpu(cpu); -	pr_cont("\t(detected by %d, t=%ld jiffies, g=%ld, q=%lu ncpus=%d)\n", +	pr_err("\t(detected by %d, t=%ld jiffies, g=%ld, q=%lu ncpus=%d)\n",  	       smp_processor_id(), (long)(jiffies - gps),  	       (long)rcu_seq_current(&rcu_state.gp_seq), totqlen, rcu_state.n_online_cpus);  	if (ndetected) { @@ -649,7 +680,7 @@ static void print_cpu_stall(unsigned long gps)  	raw_spin_unlock_irqrestore_rcu_node(rdp->mynode, flags);  	for_each_possible_cpu(cpu)  		totqlen += rcu_get_n_cbs_cpu(cpu); -	pr_cont("\t(t=%lu jiffies g=%ld q=%lu ncpus=%d)\n", +	pr_err("\t(t=%lu jiffies g=%ld q=%lu ncpus=%d)\n",  		jiffies - gps,  		(long)rcu_seq_current(&rcu_state.gp_seq), totqlen, rcu_state.n_online_cpus);  |