aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/timer.c')
-rw-r--r--kernel/timer.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/kernel/timer.c b/kernel/timer.c
index f1b8afe1ad86..353b9227c2ec 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -37,7 +37,7 @@
37#include <linux/delay.h> 37#include <linux/delay.h>
38#include <linux/tick.h> 38#include <linux/tick.h>
39#include <linux/kallsyms.h> 39#include <linux/kallsyms.h>
40#include <linux/perf_event.h> 40#include <linux/irq_work.h>
41#include <linux/sched.h> 41#include <linux/sched.h>
42#include <linux/slab.h> 42#include <linux/slab.h>
43 43
@@ -326,6 +326,7 @@ EXPORT_SYMBOL_GPL(round_jiffies_up_relative);
326 326
327/** 327/**
328 * set_timer_slack - set the allowed slack for a timer 328 * set_timer_slack - set the allowed slack for a timer
329 * @timer: the timer to be modified
329 * @slack_hz: the amount of time (in jiffies) allowed for rounding 330 * @slack_hz: the amount of time (in jiffies) allowed for rounding
330 * 331 *
331 * Set the amount of time, in jiffies, that a certain timer has 332 * Set the amount of time, in jiffies, that a certain timer has
@@ -1251,6 +1252,12 @@ unsigned long get_next_timer_interrupt(unsigned long now)
1251 struct tvec_base *base = __get_cpu_var(tvec_bases); 1252 struct tvec_base *base = __get_cpu_var(tvec_bases);
1252 unsigned long expires; 1253 unsigned long expires;
1253 1254
1255 /*
1256 * Pretend that there is no timer pending if the cpu is offline.
1257 * Possible pending timers will be migrated later to an active cpu.
1258 */
1259 if (cpu_is_offline(smp_processor_id()))
1260 return now + NEXT_TIMER_MAX_DELTA;
1254 spin_lock(&base->lock); 1261 spin_lock(&base->lock);
1255 if (time_before_eq(base->next_timer, base->timer_jiffies)) 1262 if (time_before_eq(base->next_timer, base->timer_jiffies))
1256 base->next_timer = __next_timer_interrupt(base); 1263 base->next_timer = __next_timer_interrupt(base);
@@ -1278,7 +1285,10 @@ void update_process_times(int user_tick)
1278 run_local_timers(); 1285 run_local_timers();
1279 rcu_check_callbacks(cpu, user_tick); 1286 rcu_check_callbacks(cpu, user_tick);
1280 printk_tick(); 1287 printk_tick();
1281 perf_event_do_pending(); 1288#ifdef CONFIG_IRQ_WORK
1289 if (in_irq())
1290 irq_work_run();
1291#endif
1282 scheduler_tick(); 1292 scheduler_tick();
1283 run_posix_cpu_timers(p); 1293 run_posix_cpu_timers(p);
1284} 1294}
@@ -1315,7 +1325,7 @@ void do_timer(unsigned long ticks)
1315{ 1325{
1316 jiffies_64 += ticks; 1326 jiffies_64 += ticks;
1317 update_wall_time(); 1327 update_wall_time();
1318 calc_global_load(); 1328 calc_global_load(ticks);
1319} 1329}
1320 1330
1321#ifdef __ARCH_WANT_SYS_ALARM 1331#ifdef __ARCH_WANT_SYS_ALARM