diff options
Diffstat (limited to 'kernel/time')
| -rw-r--r-- | kernel/time/tick-sched.c | 6 | ||||
| -rw-r--r-- | kernel/time/timekeeping.c | 19 |
2 files changed, 15 insertions, 10 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 3a9e5d5c1091..f423bdd035c2 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
| @@ -372,7 +372,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, | |||
| 372 | * the scheduler tick in nohz_restart_sched_tick. | 372 | * the scheduler tick in nohz_restart_sched_tick. |
| 373 | */ | 373 | */ |
| 374 | if (!ts->tick_stopped) { | 374 | if (!ts->tick_stopped) { |
| 375 | select_nohz_load_balancer(1); | 375 | nohz_balance_enter_idle(cpu); |
| 376 | calc_load_enter_idle(); | 376 | calc_load_enter_idle(); |
| 377 | 377 | ||
| 378 | ts->last_tick = hrtimer_get_expires(&ts->sched_timer); | 378 | ts->last_tick = hrtimer_get_expires(&ts->sched_timer); |
| @@ -436,7 +436,8 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) | |||
| 436 | if (unlikely(local_softirq_pending() && cpu_online(cpu))) { | 436 | if (unlikely(local_softirq_pending() && cpu_online(cpu))) { |
| 437 | static int ratelimit; | 437 | static int ratelimit; |
| 438 | 438 | ||
| 439 | if (ratelimit < 10) { | 439 | if (ratelimit < 10 && |
| 440 | (local_softirq_pending() & SOFTIRQ_STOP_IDLE_MASK)) { | ||
| 440 | printk(KERN_ERR "NOHZ: local_softirq_pending %02x\n", | 441 | printk(KERN_ERR "NOHZ: local_softirq_pending %02x\n", |
| 441 | (unsigned int) local_softirq_pending()); | 442 | (unsigned int) local_softirq_pending()); |
| 442 | ratelimit++; | 443 | ratelimit++; |
| @@ -569,7 +570,6 @@ static void tick_nohz_restart(struct tick_sched *ts, ktime_t now) | |||
| 569 | static void tick_nohz_restart_sched_tick(struct tick_sched *ts, ktime_t now) | 570 | static void tick_nohz_restart_sched_tick(struct tick_sched *ts, ktime_t now) |
| 570 | { | 571 | { |
| 571 | /* Update jiffies first */ | 572 | /* Update jiffies first */ |
| 572 | select_nohz_load_balancer(0); | ||
| 573 | tick_do_update_jiffies64(now); | 573 | tick_do_update_jiffies64(now); |
| 574 | update_cpu_load_nohz(); | 574 | update_cpu_load_nohz(); |
| 575 | 575 | ||
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 34e5eac81424..d3b91e75cecd 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
| @@ -303,10 +303,11 @@ void getnstimeofday(struct timespec *ts) | |||
| 303 | seq = read_seqbegin(&tk->lock); | 303 | seq = read_seqbegin(&tk->lock); |
| 304 | 304 | ||
| 305 | ts->tv_sec = tk->xtime_sec; | 305 | ts->tv_sec = tk->xtime_sec; |
| 306 | ts->tv_nsec = timekeeping_get_ns(tk); | 306 | nsecs = timekeeping_get_ns(tk); |
| 307 | 307 | ||
| 308 | } while (read_seqretry(&tk->lock, seq)); | 308 | } while (read_seqretry(&tk->lock, seq)); |
| 309 | 309 | ||
| 310 | ts->tv_nsec = 0; | ||
| 310 | timespec_add_ns(ts, nsecs); | 311 | timespec_add_ns(ts, nsecs); |
| 311 | } | 312 | } |
| 312 | EXPORT_SYMBOL(getnstimeofday); | 313 | EXPORT_SYMBOL(getnstimeofday); |
| @@ -345,6 +346,7 @@ void ktime_get_ts(struct timespec *ts) | |||
| 345 | { | 346 | { |
| 346 | struct timekeeper *tk = &timekeeper; | 347 | struct timekeeper *tk = &timekeeper; |
| 347 | struct timespec tomono; | 348 | struct timespec tomono; |
| 349 | s64 nsec; | ||
| 348 | unsigned int seq; | 350 | unsigned int seq; |
| 349 | 351 | ||
| 350 | WARN_ON(timekeeping_suspended); | 352 | WARN_ON(timekeeping_suspended); |
| @@ -352,13 +354,14 @@ void ktime_get_ts(struct timespec *ts) | |||
| 352 | do { | 354 | do { |
| 353 | seq = read_seqbegin(&tk->lock); | 355 | seq = read_seqbegin(&tk->lock); |
| 354 | ts->tv_sec = tk->xtime_sec; | 356 | ts->tv_sec = tk->xtime_sec; |
| 355 | ts->tv_nsec = timekeeping_get_ns(tk); | 357 | nsec = timekeeping_get_ns(tk); |
| 356 | tomono = tk->wall_to_monotonic; | 358 | tomono = tk->wall_to_monotonic; |
| 357 | 359 | ||
| 358 | } while (read_seqretry(&tk->lock, seq)); | 360 | } while (read_seqretry(&tk->lock, seq)); |
| 359 | 361 | ||
| 360 | set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec, | 362 | ts->tv_sec += tomono.tv_sec; |
| 361 | ts->tv_nsec + tomono.tv_nsec); | 363 | ts->tv_nsec = 0; |
| 364 | timespec_add_ns(ts, nsec + tomono.tv_nsec); | ||
| 362 | } | 365 | } |
| 363 | EXPORT_SYMBOL_GPL(ktime_get_ts); | 366 | EXPORT_SYMBOL_GPL(ktime_get_ts); |
| 364 | 367 | ||
| @@ -1244,6 +1247,7 @@ void get_monotonic_boottime(struct timespec *ts) | |||
| 1244 | { | 1247 | { |
| 1245 | struct timekeeper *tk = &timekeeper; | 1248 | struct timekeeper *tk = &timekeeper; |
| 1246 | struct timespec tomono, sleep; | 1249 | struct timespec tomono, sleep; |
| 1250 | s64 nsec; | ||
| 1247 | unsigned int seq; | 1251 | unsigned int seq; |
| 1248 | 1252 | ||
| 1249 | WARN_ON(timekeeping_suspended); | 1253 | WARN_ON(timekeeping_suspended); |
| @@ -1251,14 +1255,15 @@ void get_monotonic_boottime(struct timespec *ts) | |||
| 1251 | do { | 1255 | do { |
| 1252 | seq = read_seqbegin(&tk->lock); | 1256 | seq = read_seqbegin(&tk->lock); |
| 1253 | ts->tv_sec = tk->xtime_sec; | 1257 | ts->tv_sec = tk->xtime_sec; |
| 1254 | ts->tv_nsec = timekeeping_get_ns(tk); | 1258 | nsec = timekeeping_get_ns(tk); |
| 1255 | tomono = tk->wall_to_monotonic; | 1259 | tomono = tk->wall_to_monotonic; |
| 1256 | sleep = tk->total_sleep_time; | 1260 | sleep = tk->total_sleep_time; |
| 1257 | 1261 | ||
| 1258 | } while (read_seqretry(&tk->lock, seq)); | 1262 | } while (read_seqretry(&tk->lock, seq)); |
| 1259 | 1263 | ||
| 1260 | set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec + sleep.tv_sec, | 1264 | ts->tv_sec += tomono.tv_sec + sleep.tv_sec; |
| 1261 | ts->tv_nsec + tomono.tv_nsec + sleep.tv_nsec); | 1265 | ts->tv_nsec = 0; |
| 1266 | timespec_add_ns(ts, nsec + tomono.tv_nsec + sleep.tv_nsec); | ||
| 1262 | } | 1267 | } |
| 1263 | EXPORT_SYMBOL_GPL(get_monotonic_boottime); | 1268 | EXPORT_SYMBOL_GPL(get_monotonic_boottime); |
| 1264 | 1269 | ||
