diff options
Diffstat (limited to 'kernel/time/tick-sched.c')
| -rw-r--r-- | kernel/time/tick-sched.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index beef7ccdf842..f5da526424a9 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
| @@ -140,8 +140,6 @@ void tick_nohz_update_jiffies(void) | |||
| 140 | if (!ts->tick_stopped) | 140 | if (!ts->tick_stopped) |
| 141 | return; | 141 | return; |
| 142 | 142 | ||
| 143 | touch_softlockup_watchdog(); | ||
| 144 | |||
| 145 | cpu_clear(cpu, nohz_cpu_mask); | 143 | cpu_clear(cpu, nohz_cpu_mask); |
| 146 | now = ktime_get(); | 144 | now = ktime_get(); |
| 147 | ts->idle_waketime = now; | 145 | ts->idle_waketime = now; |
| @@ -149,6 +147,8 @@ void tick_nohz_update_jiffies(void) | |||
| 149 | local_irq_save(flags); | 147 | local_irq_save(flags); |
| 150 | tick_do_update_jiffies64(now); | 148 | tick_do_update_jiffies64(now); |
| 151 | local_irq_restore(flags); | 149 | local_irq_restore(flags); |
| 150 | |||
| 151 | touch_softlockup_watchdog(); | ||
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | void tick_nohz_stop_idle(int cpu) | 154 | void tick_nohz_stop_idle(int cpu) |
| @@ -195,7 +195,7 @@ u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time) | |||
| 195 | * Called either from the idle loop or from irq_exit() when an idle period was | 195 | * Called either from the idle loop or from irq_exit() when an idle period was |
| 196 | * just interrupted by an interrupt which did not cause a reschedule. | 196 | * just interrupted by an interrupt which did not cause a reschedule. |
| 197 | */ | 197 | */ |
| 198 | void tick_nohz_stop_sched_tick(void) | 198 | void tick_nohz_stop_sched_tick(int inidle) |
| 199 | { | 199 | { |
| 200 | unsigned long seq, last_jiffies, next_jiffies, delta_jiffies, flags; | 200 | unsigned long seq, last_jiffies, next_jiffies, delta_jiffies, flags; |
| 201 | struct tick_sched *ts; | 201 | struct tick_sched *ts; |
| @@ -224,6 +224,11 @@ void tick_nohz_stop_sched_tick(void) | |||
| 224 | if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE)) | 224 | if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE)) |
| 225 | goto end; | 225 | goto end; |
| 226 | 226 | ||
| 227 | if (!inidle && !ts->inidle) | ||
| 228 | goto end; | ||
| 229 | |||
| 230 | ts->inidle = 1; | ||
| 231 | |||
| 227 | if (need_resched()) | 232 | if (need_resched()) |
| 228 | goto end; | 233 | goto end; |
| 229 | 234 | ||
| @@ -284,7 +289,6 @@ void tick_nohz_stop_sched_tick(void) | |||
| 284 | ts->tick_stopped = 1; | 289 | ts->tick_stopped = 1; |
| 285 | ts->idle_jiffies = last_jiffies; | 290 | ts->idle_jiffies = last_jiffies; |
| 286 | rcu_enter_nohz(); | 291 | rcu_enter_nohz(); |
| 287 | sched_clock_tick_stop(cpu); | ||
| 288 | } | 292 | } |
| 289 | 293 | ||
| 290 | /* | 294 | /* |
| @@ -373,18 +377,20 @@ void tick_nohz_restart_sched_tick(void) | |||
| 373 | local_irq_disable(); | 377 | local_irq_disable(); |
| 374 | tick_nohz_stop_idle(cpu); | 378 | tick_nohz_stop_idle(cpu); |
| 375 | 379 | ||
| 376 | if (!ts->tick_stopped) { | 380 | if (!ts->inidle || !ts->tick_stopped) { |
| 381 | ts->inidle = 0; | ||
| 377 | local_irq_enable(); | 382 | local_irq_enable(); |
| 378 | return; | 383 | return; |
| 379 | } | 384 | } |
| 380 | 385 | ||
| 386 | ts->inidle = 0; | ||
| 387 | |||
| 381 | rcu_exit_nohz(); | 388 | rcu_exit_nohz(); |
| 382 | 389 | ||
| 383 | /* Update jiffies first */ | 390 | /* Update jiffies first */ |
| 384 | select_nohz_load_balancer(0); | 391 | select_nohz_load_balancer(0); |
| 385 | now = ktime_get(); | 392 | now = ktime_get(); |
| 386 | tick_do_update_jiffies64(now); | 393 | tick_do_update_jiffies64(now); |
| 387 | sched_clock_tick_start(cpu); | ||
| 388 | cpu_clear(cpu, nohz_cpu_mask); | 394 | cpu_clear(cpu, nohz_cpu_mask); |
| 389 | 395 | ||
| 390 | /* | 396 | /* |
