--- b/arch/x86/kernel/nmi.c | 6 +++--- b/include/linux/rcupdate.h | 7 +++---- b/kernel/rcu/update.c | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff -puN include/linux/rcupdate.h~rcu-halfstall include/linux/rcupdate.h --- a/include/linux/rcupdate.h~rcu-halfstall 2014-06-17 14:08:19.596464173 -0700 +++ b/include/linux/rcupdate.h 2014-06-17 14:15:40.335598696 -0700 @@ -303,8 +303,8 @@ bool __rcu_is_watching(void); * Hooks for cond_resched() and friends to avoid RCU CPU stall warnings. */ -extern u64 RCU_COND_RESCHED_LIM; /* ms vs. 100s of ms. */ -DECLARE_PER_CPU(int, rcu_cond_resched_count); +extern u64 RCU_COND_RESCHED_EVERY_THIS_JIFFIES; +DECLARE_PER_CPU(unsigned long, rcu_cond_resched_at_jiffies); void rcu_resched(void); /* @@ -321,8 +321,7 @@ void rcu_resched(void); */ static inline bool rcu_should_resched(void) { - return raw_cpu_inc_return(rcu_cond_resched_count) >= - RCU_COND_RESCHED_LIM; + return raw_cpu_read(rcu_cond_resched_at_jiffies) >= jiffies; } /* diff -puN arch/x86/kernel/nmi.c~rcu-halfstall arch/x86/kernel/nmi.c --- a/arch/x86/kernel/nmi.c~rcu-halfstall 2014-06-17 14:11:28.442072042 -0700 +++ b/arch/x86/kernel/nmi.c 2014-06-17 14:12:04.664723690 -0700 @@ -88,13 +88,13 @@ __setup("unknown_nmi_panic", setup_unkno static u64 nmi_longest_ns = 1 * NSEC_PER_MSEC; -u64 RCU_COND_RESCHED_LIM = 256; +u64 RCU_COND_RESCHED_EVERY_THIS_JIFFIES = 100; static int __init nmi_warning_debugfs(void) { debugfs_create_u64("nmi_longest_ns", 0644, arch_debugfs_dir, &nmi_longest_ns); - debugfs_create_u64("RCU_COND_RESCHED_LIM", 0644, - arch_debugfs_dir, &RCU_COND_RESCHED_LIM); + debugfs_create_u64("RCU_COND_RESCHED_EVERY_THIS_JIFFIES", 0644, + arch_debugfs_dir, &RCU_COND_RESCHED_EVERY_THIS_JIFFIES); return 0; } fs_initcall(nmi_warning_debugfs); diff -puN kernel/rcu/update.c~rcu-halfstall kernel/rcu/update.c --- a/kernel/rcu/update.c~rcu-halfstall 2014-06-17 14:12:50.768834979 -0700 +++ b/kernel/rcu/update.c 2014-06-17 14:17:14.166894075 -0700 @@ -355,7 +355,7 @@ early_initcall(check_cpu_stall_init); * Hooks for cond_resched() and friends to avoid RCU CPU stall warnings. */ -DEFINE_PER_CPU(int, rcu_cond_resched_count); +DEFINE_PER_CPU(unsigned long, rcu_cond_resched_at_jiffies); /* * Report a set of RCU quiescent states, for use by cond_resched() @@ -364,7 +364,7 @@ DEFINE_PER_CPU(int, rcu_cond_resched_cou void rcu_resched(void) { preempt_disable(); - __this_cpu_write(rcu_cond_resched_count, 0); + __this_cpu_write(rcu_cond_resched_at_jiffies, jiffies + RCU_COND_RESCHED_EVERY_THIS_JIFFIES); rcu_note_context_switch(smp_processor_id()); preempt_enable(); } _