Loading Documentation/admin-guide/kernel-parameters.txt +6 −0 Original line number Diff line number Diff line Loading @@ -5113,6 +5113,12 @@ rcupdate.rcu_cpu_stall_timeout to be used (after conversion from seconds to milliseconds). rcupdate.rcu_cpu_stall_cputime= [KNL] Provide statistics on the cputime and count of interrupts and tasks during the sampling period. For multiple continuous RCU stalls, all sampling periods begin at half of the first RCU stall timeout. rcupdate.rcu_exp_stall_task_details= [KNL] Print stack dumps of any tasks blocking the current expedited RCU grace period during an Loading include/linux/kernel_stat.h +13 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ DECLARE_PER_CPU(struct kernel_cpustat, kernel_cpustat); #define kstat_cpu(cpu) per_cpu(kstat, cpu) #define kcpustat_cpu(cpu) per_cpu(kernel_cpustat, cpu) extern unsigned long long nr_context_switches_cpu(int cpu); extern unsigned long long nr_context_switches(void); extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); Loading @@ -67,6 +68,17 @@ static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) return kstat_cpu(cpu).softirqs[irq]; } static inline unsigned int kstat_cpu_softirqs_sum(int cpu) { int i; unsigned int sum = 0; for (i = 0; i < NR_SOFTIRQS; i++) sum += kstat_softirqs_cpu(i, cpu); return sum; } /* * Number of interrupts per specific IRQ source, since bootup */ Loading @@ -75,7 +87,7 @@ extern unsigned int kstat_irqs_usr(unsigned int irq); /* * Number of interrupts per cpu, since bootup */ static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu) static inline unsigned long kstat_cpu_irqs_sum(unsigned int cpu) { return kstat_cpu(cpu).irqs_sum; } Loading kernel/rcu/Kconfig.debug +14 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ config RCU_CPU_STALL_TIMEOUT config RCU_EXP_CPU_STALL_TIMEOUT int "Expedited RCU CPU stall timeout in milliseconds" depends on RCU_STALL_COMMON range 0 21000 range 0 300000 default 0 help If a given expedited RCU grace period extends more than the Loading @@ -92,6 +92,19 @@ config RCU_EXP_CPU_STALL_TIMEOUT says to use the RCU_CPU_STALL_TIMEOUT value converted from seconds to milliseconds. config RCU_CPU_STALL_CPUTIME bool "Provide additional RCU stall debug information" depends on RCU_STALL_COMMON default n help Collect statistics during the sampling period, such as the number of (hard interrupts, soft interrupts, task switches) and the cputime of (hard interrupts, soft interrupts, kernel tasks) are added to the RCU stall report. For multiple continuous RCU stalls, all sampling periods begin at half of the first RCU stall timeout. The boot option rcupdate.rcu_cpu_stall_cputime has the same function as this one, but will override this if it exists. config RCU_TRACE bool "Enable tracing for RCU" depends on DEBUG_KERNEL Loading kernel/rcu/rcu.h +1 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,7 @@ extern int rcu_cpu_stall_ftrace_dump; extern int rcu_cpu_stall_suppress; extern int rcu_cpu_stall_timeout; extern int rcu_exp_cpu_stall_timeout; extern int rcu_cpu_stall_cputime; extern bool rcu_exp_stall_task_details __read_mostly; int rcu_jiffies_till_stall_check(void); int rcu_exp_jiffies_till_stall_check(void); Loading kernel/rcu/tree.c +18 −0 Original line number Diff line number Diff line Loading @@ -866,6 +866,24 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp) rdp->rcu_iw_gp_seq = rnp->gp_seq; irq_work_queue_on(&rdp->rcu_iw, rdp->cpu); } if (rcu_cpu_stall_cputime && rdp->snap_record.gp_seq != rdp->gp_seq) { int cpu = rdp->cpu; struct rcu_snap_record *rsrp; struct kernel_cpustat *kcsp; kcsp = &kcpustat_cpu(cpu); rsrp = &rdp->snap_record; rsrp->cputime_irq = kcpustat_field(kcsp, CPUTIME_IRQ, cpu); rsrp->cputime_softirq = kcpustat_field(kcsp, CPUTIME_SOFTIRQ, cpu); rsrp->cputime_system = kcpustat_field(kcsp, CPUTIME_SYSTEM, cpu); rsrp->nr_hardirqs = kstat_cpu_irqs_sum(rdp->cpu); rsrp->nr_softirqs = kstat_cpu_softirqs_sum(rdp->cpu); rsrp->nr_csw = nr_context_switches_cpu(rdp->cpu); rsrp->jiffies = jiffies; rsrp->gp_seq = rdp->gp_seq; } } return 0; Loading Loading
Documentation/admin-guide/kernel-parameters.txt +6 −0 Original line number Diff line number Diff line Loading @@ -5113,6 +5113,12 @@ rcupdate.rcu_cpu_stall_timeout to be used (after conversion from seconds to milliseconds). rcupdate.rcu_cpu_stall_cputime= [KNL] Provide statistics on the cputime and count of interrupts and tasks during the sampling period. For multiple continuous RCU stalls, all sampling periods begin at half of the first RCU stall timeout. rcupdate.rcu_exp_stall_task_details= [KNL] Print stack dumps of any tasks blocking the current expedited RCU grace period during an Loading
include/linux/kernel_stat.h +13 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ DECLARE_PER_CPU(struct kernel_cpustat, kernel_cpustat); #define kstat_cpu(cpu) per_cpu(kstat, cpu) #define kcpustat_cpu(cpu) per_cpu(kernel_cpustat, cpu) extern unsigned long long nr_context_switches_cpu(int cpu); extern unsigned long long nr_context_switches(void); extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); Loading @@ -67,6 +68,17 @@ static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) return kstat_cpu(cpu).softirqs[irq]; } static inline unsigned int kstat_cpu_softirqs_sum(int cpu) { int i; unsigned int sum = 0; for (i = 0; i < NR_SOFTIRQS; i++) sum += kstat_softirqs_cpu(i, cpu); return sum; } /* * Number of interrupts per specific IRQ source, since bootup */ Loading @@ -75,7 +87,7 @@ extern unsigned int kstat_irqs_usr(unsigned int irq); /* * Number of interrupts per cpu, since bootup */ static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu) static inline unsigned long kstat_cpu_irqs_sum(unsigned int cpu) { return kstat_cpu(cpu).irqs_sum; } Loading
kernel/rcu/Kconfig.debug +14 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ config RCU_CPU_STALL_TIMEOUT config RCU_EXP_CPU_STALL_TIMEOUT int "Expedited RCU CPU stall timeout in milliseconds" depends on RCU_STALL_COMMON range 0 21000 range 0 300000 default 0 help If a given expedited RCU grace period extends more than the Loading @@ -92,6 +92,19 @@ config RCU_EXP_CPU_STALL_TIMEOUT says to use the RCU_CPU_STALL_TIMEOUT value converted from seconds to milliseconds. config RCU_CPU_STALL_CPUTIME bool "Provide additional RCU stall debug information" depends on RCU_STALL_COMMON default n help Collect statistics during the sampling period, such as the number of (hard interrupts, soft interrupts, task switches) and the cputime of (hard interrupts, soft interrupts, kernel tasks) are added to the RCU stall report. For multiple continuous RCU stalls, all sampling periods begin at half of the first RCU stall timeout. The boot option rcupdate.rcu_cpu_stall_cputime has the same function as this one, but will override this if it exists. config RCU_TRACE bool "Enable tracing for RCU" depends on DEBUG_KERNEL Loading
kernel/rcu/rcu.h +1 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,7 @@ extern int rcu_cpu_stall_ftrace_dump; extern int rcu_cpu_stall_suppress; extern int rcu_cpu_stall_timeout; extern int rcu_exp_cpu_stall_timeout; extern int rcu_cpu_stall_cputime; extern bool rcu_exp_stall_task_details __read_mostly; int rcu_jiffies_till_stall_check(void); int rcu_exp_jiffies_till_stall_check(void); Loading
kernel/rcu/tree.c +18 −0 Original line number Diff line number Diff line Loading @@ -866,6 +866,24 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp) rdp->rcu_iw_gp_seq = rnp->gp_seq; irq_work_queue_on(&rdp->rcu_iw, rdp->cpu); } if (rcu_cpu_stall_cputime && rdp->snap_record.gp_seq != rdp->gp_seq) { int cpu = rdp->cpu; struct rcu_snap_record *rsrp; struct kernel_cpustat *kcsp; kcsp = &kcpustat_cpu(cpu); rsrp = &rdp->snap_record; rsrp->cputime_irq = kcpustat_field(kcsp, CPUTIME_IRQ, cpu); rsrp->cputime_softirq = kcpustat_field(kcsp, CPUTIME_SOFTIRQ, cpu); rsrp->cputime_system = kcpustat_field(kcsp, CPUTIME_SYSTEM, cpu); rsrp->nr_hardirqs = kstat_cpu_irqs_sum(rdp->cpu); rsrp->nr_softirqs = kstat_cpu_softirqs_sum(rdp->cpu); rsrp->nr_csw = nr_context_switches_cpu(rdp->cpu); rsrp->jiffies = jiffies; rsrp->gp_seq = rdp->gp_seq; } } return 0; Loading