diff options
Diffstat (limited to 'kernel/time/tick-sched.c')
-rw-r--r-- | kernel/time/tick-sched.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index b854a895591e..942fc7c85283 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -48,6 +48,13 @@ static void tick_do_update_jiffies64(ktime_t now) | |||
48 | unsigned long ticks = 0; | 48 | unsigned long ticks = 0; |
49 | ktime_t delta; | 49 | ktime_t delta; |
50 | 50 | ||
51 | /* | ||
52 | * Do a quick check without holding xtime_lock: | ||
53 | */ | ||
54 | delta = ktime_sub(now, last_jiffies_update); | ||
55 | if (delta.tv64 < tick_period.tv64) | ||
56 | return; | ||
57 | |||
51 | /* Reevalute with xtime_lock held */ | 58 | /* Reevalute with xtime_lock held */ |
52 | write_seqlock(&xtime_lock); | 59 | write_seqlock(&xtime_lock); |
53 | 60 | ||
@@ -133,8 +140,6 @@ void tick_nohz_update_jiffies(void) | |||
133 | if (!ts->tick_stopped) | 140 | if (!ts->tick_stopped) |
134 | return; | 141 | return; |
135 | 142 | ||
136 | touch_softlockup_watchdog(); | ||
137 | |||
138 | cpu_clear(cpu, nohz_cpu_mask); | 143 | cpu_clear(cpu, nohz_cpu_mask); |
139 | now = ktime_get(); | 144 | now = ktime_get(); |
140 | ts->idle_waketime = now; | 145 | ts->idle_waketime = now; |
@@ -142,6 +147,8 @@ void tick_nohz_update_jiffies(void) | |||
142 | local_irq_save(flags); | 147 | local_irq_save(flags); |
143 | tick_do_update_jiffies64(now); | 148 | tick_do_update_jiffies64(now); |
144 | local_irq_restore(flags); | 149 | local_irq_restore(flags); |
150 | |||
151 | touch_softlockup_watchdog(); | ||
145 | } | 152 | } |
146 | 153 | ||
147 | void tick_nohz_stop_idle(int cpu) | 154 | void tick_nohz_stop_idle(int cpu) |
@@ -228,6 +235,7 @@ void tick_nohz_stop_sched_tick(void) | |||
228 | local_softirq_pending()); | 235 | local_softirq_pending()); |
229 | ratelimit++; | 236 | ratelimit++; |
230 | } | 237 | } |
238 | goto end; | ||
231 | } | 239 | } |
232 | 240 | ||
233 | ts->idle_calls++; | 241 | ts->idle_calls++; |
@@ -276,6 +284,7 @@ void tick_nohz_stop_sched_tick(void) | |||
276 | ts->tick_stopped = 1; | 284 | ts->tick_stopped = 1; |
277 | ts->idle_jiffies = last_jiffies; | 285 | ts->idle_jiffies = last_jiffies; |
278 | rcu_enter_nohz(); | 286 | rcu_enter_nohz(); |
287 | sched_clock_tick_stop(cpu); | ||
279 | } | 288 | } |
280 | 289 | ||
281 | /* | 290 | /* |
@@ -375,6 +384,7 @@ void tick_nohz_restart_sched_tick(void) | |||
375 | select_nohz_load_balancer(0); | 384 | select_nohz_load_balancer(0); |
376 | now = ktime_get(); | 385 | now = ktime_get(); |
377 | tick_do_update_jiffies64(now); | 386 | tick_do_update_jiffies64(now); |
387 | sched_clock_tick_start(cpu); | ||
378 | cpu_clear(cpu, nohz_cpu_mask); | 388 | cpu_clear(cpu, nohz_cpu_mask); |
379 | 389 | ||
380 | /* | 390 | /* |