diff options
author | Ingo Molnar <mingo@kernel.org> | 2014-01-12 08:12:44 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-01-12 08:12:44 -0500 |
commit | dba861461f88c12249ac78fb877866c04f99deb3 (patch) | |
tree | 5812b143581bcc66c7c542f01ba0cb22e489b8e5 /kernel/time/tick-sched.c | |
parent | 0e6601eee039893a3f6420596ae4588d90d13cbe (diff) | |
parent | 228fdc083b017eaf90e578fa86fb1ecfd5ffae87 (diff) |
Merge branch 'linus' into timers/core
Pick up the latest fixes and refresh the branch.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/time/tick-sched.c')
-rw-r--r-- | kernel/time/tick-sched.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 2afd43fca93b..52cee12b3302 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -361,8 +361,8 @@ void __init tick_nohz_init(void) | |||
361 | /* | 361 | /* |
362 | * NO HZ enabled ? | 362 | * NO HZ enabled ? |
363 | */ | 363 | */ |
364 | int tick_nohz_enabled __read_mostly = 1; | 364 | static int tick_nohz_enabled __read_mostly = 1; |
365 | 365 | int tick_nohz_active __read_mostly; | |
366 | /* | 366 | /* |
367 | * Enable / Disable tickless mode | 367 | * Enable / Disable tickless mode |
368 | */ | 368 | */ |
@@ -461,7 +461,7 @@ u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time) | |||
461 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); | 461 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); |
462 | ktime_t now, idle; | 462 | ktime_t now, idle; |
463 | 463 | ||
464 | if (!tick_nohz_enabled) | 464 | if (!tick_nohz_active) |
465 | return -1; | 465 | return -1; |
466 | 466 | ||
467 | now = ktime_get(); | 467 | now = ktime_get(); |
@@ -502,7 +502,7 @@ u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time) | |||
502 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); | 502 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); |
503 | ktime_t now, iowait; | 503 | ktime_t now, iowait; |
504 | 504 | ||
505 | if (!tick_nohz_enabled) | 505 | if (!tick_nohz_active) |
506 | return -1; | 506 | return -1; |
507 | 507 | ||
508 | now = ktime_get(); | 508 | now = ktime_get(); |
@@ -707,8 +707,10 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) | |||
707 | return false; | 707 | return false; |
708 | } | 708 | } |
709 | 709 | ||
710 | if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE)) | 710 | if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE)) { |
711 | ts->sleep_length = (ktime_t) { .tv64 = NSEC_PER_SEC/HZ }; | ||
711 | return false; | 712 | return false; |
713 | } | ||
712 | 714 | ||
713 | if (need_resched()) | 715 | if (need_resched()) |
714 | return false; | 716 | return false; |
@@ -795,11 +797,6 @@ void tick_nohz_idle_enter(void) | |||
795 | local_irq_disable(); | 797 | local_irq_disable(); |
796 | 798 | ||
797 | ts = &__get_cpu_var(tick_cpu_sched); | 799 | ts = &__get_cpu_var(tick_cpu_sched); |
798 | /* | ||
799 | * set ts->inidle unconditionally. even if the system did not | ||
800 | * switch to nohz mode the cpu frequency governers rely on the | ||
801 | * update of the idle time accounting in tick_nohz_start_idle(). | ||
802 | */ | ||
803 | ts->inidle = 1; | 800 | ts->inidle = 1; |
804 | __tick_nohz_idle_enter(ts); | 801 | __tick_nohz_idle_enter(ts); |
805 | 802 | ||
@@ -968,7 +965,7 @@ static void tick_nohz_switch_to_nohz(void) | |||
968 | struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched); | 965 | struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched); |
969 | ktime_t next; | 966 | ktime_t next; |
970 | 967 | ||
971 | if (!tick_nohz_enabled) | 968 | if (!tick_nohz_active) |
972 | return; | 969 | return; |
973 | 970 | ||
974 | local_irq_disable(); | 971 | local_irq_disable(); |
@@ -976,7 +973,7 @@ static void tick_nohz_switch_to_nohz(void) | |||
976 | local_irq_enable(); | 973 | local_irq_enable(); |
977 | return; | 974 | return; |
978 | } | 975 | } |
979 | 976 | tick_nohz_active = 1; | |
980 | ts->nohz_mode = NOHZ_MODE_LOWRES; | 977 | ts->nohz_mode = NOHZ_MODE_LOWRES; |
981 | 978 | ||
982 | /* | 979 | /* |
@@ -1132,8 +1129,10 @@ void tick_setup_sched_timer(void) | |||
1132 | } | 1129 | } |
1133 | 1130 | ||
1134 | #ifdef CONFIG_NO_HZ_COMMON | 1131 | #ifdef CONFIG_NO_HZ_COMMON |
1135 | if (tick_nohz_enabled) | 1132 | if (tick_nohz_enabled) { |
1136 | ts->nohz_mode = NOHZ_MODE_HIGHRES; | 1133 | ts->nohz_mode = NOHZ_MODE_HIGHRES; |
1134 | tick_nohz_active = 1; | ||
1135 | } | ||
1137 | #endif | 1136 | #endif |
1138 | } | 1137 | } |
1139 | #endif /* HIGH_RES_TIMERS */ | 1138 | #endif /* HIGH_RES_TIMERS */ |