File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 20
20
int sysctl_panic_on_rcu_stall __read_mostly ;
21
21
int sysctl_max_rcu_stall_to_panic __read_mostly ;
22
22
23
+ #ifdef CONFIG_SYSFS
24
+
25
+ static unsigned int rcu_stall_count ;
26
+
27
+ static ssize_t rcu_stall_count_show (struct kobject * kobj , struct kobj_attribute * attr ,
28
+ char * page )
29
+ {
30
+ return sysfs_emit (page , "%u\n" , rcu_stall_count );
31
+ }
32
+
33
+ static struct kobj_attribute rcu_stall_count_attr = __ATTR_RO (rcu_stall_count );
34
+
35
+ static __init int kernel_rcu_stall_sysfs_init (void )
36
+ {
37
+ sysfs_add_file_to_group (kernel_kobj , & rcu_stall_count_attr .attr , NULL );
38
+ return 0 ;
39
+ }
40
+
41
+ late_initcall (kernel_rcu_stall_sysfs_init );
42
+
43
+ #endif // CONFIG_SYSFS
44
+
23
45
#ifdef CONFIG_PROVE_RCU
24
46
#define RCU_STALL_DELAY_DELTA (5 * HZ)
25
47
#else
@@ -784,6 +806,10 @@ static void check_cpu_stall(struct rcu_data *rdp)
784
806
if (kvm_check_and_clear_guest_paused ())
785
807
return ;
786
808
809
+ #ifdef CONFIG_SYSFS
810
+ ++ rcu_stall_count ;
811
+ #endif
812
+
787
813
rcu_stall_notifier_call_chain (RCU_STALL_NOTIFY_NORM , (void * )j - gps );
788
814
if (READ_ONCE (csd_lock_suppress_rcu_stall ) && csd_lock_is_stuck ()) {
789
815
pr_err ("INFO: %s detected stall, but suppressed full report due to a stuck CSD-lock.\n" , rcu_state .name );
You can’t perform that action at this time.
0 commit comments