aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sched.h6
-rw-r--r--kernel/sched.c10
-rw-r--r--kernel/time/tick-sched.c2
3 files changed, 1 insertions, 17 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 9a7bc5ba7e7e..2091ea2a2c5c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -273,14 +273,8 @@ extern cpumask_var_t nohz_cpu_mask;
273#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 273#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
274extern void select_nohz_load_balancer(int stop_tick); 274extern void select_nohz_load_balancer(int stop_tick);
275extern int get_nohz_timer_target(void); 275extern int get_nohz_timer_target(void);
276extern int nohz_ratelimit(int cpu);
277#else 276#else
278static inline void select_nohz_load_balancer(int stop_tick) { } 277static inline void select_nohz_load_balancer(int stop_tick) { }
279
280static inline int nohz_ratelimit(int cpu)
281{
282 return 0;
283}
284#endif 278#endif
285 279
286/* 280/*
diff --git a/kernel/sched.c b/kernel/sched.c
index 16f3f77f71be..f6c9bb6ac70b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1255,16 +1255,6 @@ void wake_up_idle_cpu(int cpu)
1255 smp_send_reschedule(cpu); 1255 smp_send_reschedule(cpu);
1256} 1256}
1257 1257
1258int nohz_ratelimit(int cpu)
1259{
1260 struct rq *rq = cpu_rq(cpu);
1261 u64 diff = rq->clock - rq->nohz_stamp;
1262
1263 rq->nohz_stamp = rq->clock;
1264
1265 return diff < (NSEC_PER_SEC / HZ) >> 1;
1266}
1267
1268#endif /* CONFIG_NO_HZ */ 1258#endif /* CONFIG_NO_HZ */
1269 1259
1270static u64 sched_avg_period(void) 1260static u64 sched_avg_period(void)
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 17525cac6cfe..021d2f878f19 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -325,7 +325,7 @@ void tick_nohz_stop_sched_tick(int inidle)
325 } while (read_seqretry(&xtime_lock, seq)); 325 } while (read_seqretry(&xtime_lock, seq));
326 326
327 if (rcu_needs_cpu(cpu) || printk_needs_cpu(cpu) || 327 if (rcu_needs_cpu(cpu) || printk_needs_cpu(cpu) ||
328 arch_needs_cpu(cpu) || nohz_ratelimit(cpu)) { 328 arch_needs_cpu(cpu)) {
329 next_jiffies = last_jiffies + 1; 329 next_jiffies = last_jiffies + 1;
330 delta_jiffies = 1; 330 delta_jiffies = 1;
331 } else { 331 } else {