diff options
Diffstat (limited to 'kernel/time/tick-sched.c')
-rw-r--r-- | kernel/time/tick-sched.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 9d7a053545f5..0b17424349eb 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -36,16 +36,17 @@ | |||
36 | */ | 36 | */ |
37 | static DEFINE_PER_CPU(struct tick_sched, tick_cpu_sched); | 37 | static DEFINE_PER_CPU(struct tick_sched, tick_cpu_sched); |
38 | 38 | ||
39 | /* | ||
40 | * The time, when the last jiffy update happened. Protected by jiffies_lock. | ||
41 | */ | ||
42 | static ktime_t last_jiffies_update; | ||
43 | |||
44 | struct tick_sched *tick_get_tick_sched(int cpu) | 39 | struct tick_sched *tick_get_tick_sched(int cpu) |
45 | { | 40 | { |
46 | return &per_cpu(tick_cpu_sched, cpu); | 41 | return &per_cpu(tick_cpu_sched, cpu); |
47 | } | 42 | } |
48 | 43 | ||
44 | #if defined(CONFIG_NO_HZ_COMMON) || defined(CONFIG_HIGH_RES_TIMERS) | ||
45 | /* | ||
46 | * The time, when the last jiffy update happened. Protected by jiffies_lock. | ||
47 | */ | ||
48 | static ktime_t last_jiffies_update; | ||
49 | |||
49 | /* | 50 | /* |
50 | * Must be called with interrupts disabled ! | 51 | * Must be called with interrupts disabled ! |
51 | */ | 52 | */ |
@@ -151,6 +152,7 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs) | |||
151 | update_process_times(user_mode(regs)); | 152 | update_process_times(user_mode(regs)); |
152 | profile_tick(CPU_PROFILING); | 153 | profile_tick(CPU_PROFILING); |
153 | } | 154 | } |
155 | #endif | ||
154 | 156 | ||
155 | #ifdef CONFIG_NO_HZ_FULL | 157 | #ifdef CONFIG_NO_HZ_FULL |
156 | cpumask_var_t tick_nohz_full_mask; | 158 | cpumask_var_t tick_nohz_full_mask; |
@@ -993,9 +995,9 @@ static void tick_nohz_switch_to_nohz(void) | |||
993 | /* Get the next period */ | 995 | /* Get the next period */ |
994 | next = tick_init_jiffy_update(); | 996 | next = tick_init_jiffy_update(); |
995 | 997 | ||
996 | hrtimer_forward_now(&ts->sched_timer, tick_period); | ||
997 | hrtimer_set_expires(&ts->sched_timer, next); | 998 | hrtimer_set_expires(&ts->sched_timer, next); |
998 | tick_program_event(next, 1); | 999 | hrtimer_forward_now(&ts->sched_timer, tick_period); |
1000 | tick_program_event(hrtimer_get_expires(&ts->sched_timer), 1); | ||
999 | tick_nohz_activate(ts, NOHZ_MODE_LOWRES); | 1001 | tick_nohz_activate(ts, NOHZ_MODE_LOWRES); |
1000 | } | 1002 | } |
1001 | 1003 | ||