@@ -39,7 +39,7 @@ int rcu_exp_jiffies_till_stall_check(void)
3939 // CONFIG_RCU_EXP_CPU_STALL_TIMEOUT, so check the allowed range.
4040 // The minimum clamped value is "2UL", because at least one full
4141 // tick has to be guaranteed.
42- till_stall_check = clamp (msecs_to_jiffies (cpu_stall_timeout ), 2UL , 21UL * HZ );
42+ till_stall_check = clamp (msecs_to_jiffies (cpu_stall_timeout ), 2UL , 300UL * HZ );
4343
4444 if (cpu_stall_timeout && jiffies_to_msecs (till_stall_check ) != cpu_stall_timeout )
4545 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
428428 return j > 2 * HZ ;
429429}
430430
431+ static void print_cpu_stat_info (int cpu )
432+ {
433+ struct rcu_snap_record rsr , * rsrp ;
434+ struct rcu_data * rdp = per_cpu_ptr (& rcu_data , cpu );
435+ struct kernel_cpustat * kcsp = & kcpustat_cpu (cpu );
436+
437+ if (!rcu_cpu_stall_cputime )
438+ return ;
439+
440+ rsrp = & rdp -> snap_record ;
441+ if (rsrp -> gp_seq != rdp -> gp_seq )
442+ return ;
443+
444+ rsr .cputime_irq = kcpustat_field (kcsp , CPUTIME_IRQ , cpu );
445+ rsr .cputime_softirq = kcpustat_field (kcsp , CPUTIME_SOFTIRQ , cpu );
446+ rsr .cputime_system = kcpustat_field (kcsp , CPUTIME_SYSTEM , cpu );
447+
448+ pr_err ("\t hardirqs softirqs csw/system\n" );
449+ pr_err ("\t number: %8ld %10d %12lld\n" ,
450+ kstat_cpu_irqs_sum (cpu ) - rsrp -> nr_hardirqs ,
451+ kstat_cpu_softirqs_sum (cpu ) - rsrp -> nr_softirqs ,
452+ nr_context_switches_cpu (cpu ) - rsrp -> nr_csw );
453+ pr_err ("\tcputime: %8lld %10lld %12lld ==> %d(ms)\n" ,
454+ div_u64 (rsr .cputime_irq - rsrp -> cputime_irq , NSEC_PER_MSEC ),
455+ div_u64 (rsr .cputime_softirq - rsrp -> cputime_softirq , NSEC_PER_MSEC ),
456+ div_u64 (rsr .cputime_system - rsrp -> cputime_system , NSEC_PER_MSEC ),
457+ jiffies_to_msecs (jiffies - rsrp -> jiffies ));
458+ }
459+
431460/*
432461 * Print out diagnostic information for the specified stalled CPU.
433462 *
@@ -484,6 +513,8 @@ static void print_cpu_stall_info(int cpu)
484513 data_race (rcu_state .n_force_qs ) - rcu_state .n_force_qs_gpstart ,
485514 rcuc_starved ? buf : "" ,
486515 falsepositive ? " (false positive?)" : "" );
516+
517+ print_cpu_stat_info (cpu );
487518}
488519
489520/* Complain about starvation of grace-period kthread. */
@@ -588,7 +619,7 @@ static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps)
588619
589620 for_each_possible_cpu (cpu )
590621 totqlen += rcu_get_n_cbs_cpu (cpu );
591- pr_cont ("\t(detected by %d, t=%ld jiffies, g=%ld, q=%lu ncpus=%d)\n" ,
622+ pr_err ("\t(detected by %d, t=%ld jiffies, g=%ld, q=%lu ncpus=%d)\n" ,
592623 smp_processor_id (), (long )(jiffies - gps ),
593624 (long )rcu_seq_current (& rcu_state .gp_seq ), totqlen , rcu_state .n_online_cpus );
594625 if (ndetected ) {
@@ -649,7 +680,7 @@ static void print_cpu_stall(unsigned long gps)
649680 raw_spin_unlock_irqrestore_rcu_node (rdp -> mynode , flags );
650681 for_each_possible_cpu (cpu )
651682 totqlen += rcu_get_n_cbs_cpu (cpu );
652- pr_cont ("\t(t=%lu jiffies g=%ld q=%lu ncpus=%d)\n" ,
683+ pr_err ("\t(t=%lu jiffies g=%ld q=%lu ncpus=%d)\n" ,
653684 jiffies - gps ,
654685 (long )rcu_seq_current (& rcu_state .gp_seq ), totqlen , rcu_state .n_online_cpus );
655686
0 commit comments