diff options
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/tick-broadcast.c | 6 | ||||
-rw-r--r-- | kernel/time/tick-sched.c | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index 57a1f02e5ec0..67f80c261709 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c | |||
@@ -30,6 +30,7 @@ | |||
30 | struct tick_device tick_broadcast_device; | 30 | struct tick_device tick_broadcast_device; |
31 | static cpumask_t tick_broadcast_mask; | 31 | static cpumask_t tick_broadcast_mask; |
32 | static DEFINE_SPINLOCK(tick_broadcast_lock); | 32 | static DEFINE_SPINLOCK(tick_broadcast_lock); |
33 | static int tick_broadcast_force; | ||
33 | 34 | ||
34 | #ifdef CONFIG_TICK_ONESHOT | 35 | #ifdef CONFIG_TICK_ONESHOT |
35 | static void tick_broadcast_clear_oneshot(int cpu); | 36 | static void tick_broadcast_clear_oneshot(int cpu); |
@@ -232,10 +233,11 @@ static void tick_do_broadcast_on_off(void *why) | |||
232 | CLOCK_EVT_MODE_SHUTDOWN); | 233 | CLOCK_EVT_MODE_SHUTDOWN); |
233 | } | 234 | } |
234 | if (*reason == CLOCK_EVT_NOTIFY_BROADCAST_FORCE) | 235 | if (*reason == CLOCK_EVT_NOTIFY_BROADCAST_FORCE) |
235 | dev->features |= CLOCK_EVT_FEAT_DUMMY; | 236 | tick_broadcast_force = 1; |
236 | break; | 237 | break; |
237 | case CLOCK_EVT_NOTIFY_BROADCAST_OFF: | 238 | case CLOCK_EVT_NOTIFY_BROADCAST_OFF: |
238 | if (cpu_isset(cpu, tick_broadcast_mask)) { | 239 | if (!tick_broadcast_force && |
240 | cpu_isset(cpu, tick_broadcast_mask)) { | ||
239 | cpu_clear(cpu, tick_broadcast_mask); | 241 | cpu_clear(cpu, tick_broadcast_mask); |
240 | if (td->mode == TICKDEV_MODE_PERIODIC) | 242 | if (td->mode == TICKDEV_MODE_PERIODIC) |
241 | tick_setup_periodic(dev, 0); | 243 | tick_setup_periodic(dev, 0); |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 28abad66fc8e..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 | ||
@@ -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 | /* |