diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-31 12:02:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-31 12:02:51 -0500 |
commit | aafd9d6a46745926648cb5d0b68b108e79ceb8d4 (patch) | |
tree | b099dece2ff08e57d141af686ffbb24dc663c05b /kernel | |
parent | 595bf999e3a864f40e049c67c42ecee50fb7a78a (diff) | |
parent | a2b4c607c93a0850c8e3d90688cf3bd08576b986 (diff) |
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer/dynticks updates from Ingo Molnar:
"This tree contains misc dynticks updates: a fix and three cleanups"
* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched/nohz: Fix overflow error in scheduler_tick_max_deferment()
nohz_full: fix code style issue of tick_nohz_full_stop_tick
nohz: Get timekeeping max deferment outside jiffies_lock
tick: Rename tick_check_idle() to tick_irq_enter()
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/core.c | 2 | ||||
-rw-r--r-- | kernel/softirq.c | 2 | ||||
-rw-r--r-- | kernel/time/tick-sched.c | 27 |
3 files changed, 16 insertions, 15 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 656cd70eb577..b46131ef6aab 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -2476,7 +2476,7 @@ u64 scheduler_tick_max_deferment(void) | |||
2476 | if (time_before_eq(next, now)) | 2476 | if (time_before_eq(next, now)) |
2477 | return 0; | 2477 | return 0; |
2478 | 2478 | ||
2479 | return jiffies_to_usecs(next - now) * NSEC_PER_USEC; | 2479 | return jiffies_to_nsecs(next - now); |
2480 | } | 2480 | } |
2481 | #endif | 2481 | #endif |
2482 | 2482 | ||
diff --git a/kernel/softirq.c b/kernel/softirq.c index 850967068aaf..490fcbb1dc5b 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -328,7 +328,7 @@ void irq_enter(void) | |||
328 | * here, as softirq will be serviced on return from interrupt. | 328 | * here, as softirq will be serviced on return from interrupt. |
329 | */ | 329 | */ |
330 | local_bh_disable(); | 330 | local_bh_disable(); |
331 | tick_check_idle(); | 331 | tick_irq_enter(); |
332 | _local_bh_enable(); | 332 | _local_bh_enable(); |
333 | } | 333 | } |
334 | 334 | ||
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 08cb0c3b8ccb..9f8af69c67ec 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -533,12 +533,13 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, | |||
533 | struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev; | 533 | struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev; |
534 | u64 time_delta; | 534 | u64 time_delta; |
535 | 535 | ||
536 | time_delta = timekeeping_max_deferment(); | ||
537 | |||
536 | /* Read jiffies and the time when jiffies were updated last */ | 538 | /* Read jiffies and the time when jiffies were updated last */ |
537 | do { | 539 | do { |
538 | seq = read_seqbegin(&jiffies_lock); | 540 | seq = read_seqbegin(&jiffies_lock); |
539 | last_update = last_jiffies_update; | 541 | last_update = last_jiffies_update; |
540 | last_jiffies = jiffies; | 542 | last_jiffies = jiffies; |
541 | time_delta = timekeeping_max_deferment(); | ||
542 | } while (read_seqretry(&jiffies_lock, seq)); | 543 | } while (read_seqretry(&jiffies_lock, seq)); |
543 | 544 | ||
544 | if (rcu_needs_cpu(cpu, &rcu_delta_jiffies) || | 545 | if (rcu_needs_cpu(cpu, &rcu_delta_jiffies) || |
@@ -678,18 +679,18 @@ out: | |||
678 | static void tick_nohz_full_stop_tick(struct tick_sched *ts) | 679 | static void tick_nohz_full_stop_tick(struct tick_sched *ts) |
679 | { | 680 | { |
680 | #ifdef CONFIG_NO_HZ_FULL | 681 | #ifdef CONFIG_NO_HZ_FULL |
681 | int cpu = smp_processor_id(); | 682 | int cpu = smp_processor_id(); |
682 | 683 | ||
683 | if (!tick_nohz_full_cpu(cpu) || is_idle_task(current)) | 684 | if (!tick_nohz_full_cpu(cpu) || is_idle_task(current)) |
684 | return; | 685 | return; |
685 | 686 | ||
686 | if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE) | 687 | if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE) |
687 | return; | 688 | return; |
688 | 689 | ||
689 | if (!can_stop_full_tick()) | 690 | if (!can_stop_full_tick()) |
690 | return; | 691 | return; |
691 | 692 | ||
692 | tick_nohz_stop_sched_tick(ts, ktime_get(), cpu); | 693 | tick_nohz_stop_sched_tick(ts, ktime_get(), cpu); |
693 | #endif | 694 | #endif |
694 | } | 695 | } |
695 | 696 | ||
@@ -1023,7 +1024,7 @@ static void tick_nohz_kick_tick(struct tick_sched *ts, ktime_t now) | |||
1023 | #endif | 1024 | #endif |
1024 | } | 1025 | } |
1025 | 1026 | ||
1026 | static inline void tick_check_nohz_this_cpu(void) | 1027 | static inline void tick_nohz_irq_enter(void) |
1027 | { | 1028 | { |
1028 | struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched); | 1029 | struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched); |
1029 | ktime_t now; | 1030 | ktime_t now; |
@@ -1042,17 +1043,17 @@ static inline void tick_check_nohz_this_cpu(void) | |||
1042 | #else | 1043 | #else |
1043 | 1044 | ||
1044 | static inline void tick_nohz_switch_to_nohz(void) { } | 1045 | static inline void tick_nohz_switch_to_nohz(void) { } |
1045 | static inline void tick_check_nohz_this_cpu(void) { } | 1046 | static inline void tick_nohz_irq_enter(void) { } |
1046 | 1047 | ||
1047 | #endif /* CONFIG_NO_HZ_COMMON */ | 1048 | #endif /* CONFIG_NO_HZ_COMMON */ |
1048 | 1049 | ||
1049 | /* | 1050 | /* |
1050 | * Called from irq_enter to notify about the possible interruption of idle() | 1051 | * Called from irq_enter to notify about the possible interruption of idle() |
1051 | */ | 1052 | */ |
1052 | void tick_check_idle(void) | 1053 | void tick_irq_enter(void) |
1053 | { | 1054 | { |
1054 | tick_check_oneshot_broadcast_this_cpu(); | 1055 | tick_check_oneshot_broadcast_this_cpu(); |
1055 | tick_check_nohz_this_cpu(); | 1056 | tick_nohz_irq_enter(); |
1056 | } | 1057 | } |
1057 | 1058 | ||
1058 | /* | 1059 | /* |