diff options
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 36c951b7eef8..75badda95d61 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -2453,7 +2453,7 @@ u64 scheduler_tick_max_deferment(void) | |||
| 2453 | if (time_before_eq(next, now)) | 2453 | if (time_before_eq(next, now)) |
| 2454 | return 0; | 2454 | return 0; |
| 2455 | 2455 | ||
| 2456 | return jiffies_to_usecs(next - now) * NSEC_PER_USEC; | 2456 | return jiffies_to_nsecs(next - now); |
| 2457 | } | 2457 | } |
| 2458 | #endif | 2458 | #endif |
| 2459 | 2459 | ||
diff --git a/kernel/softirq.c b/kernel/softirq.c index 8a1e6e104892..991e38d9f71e 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
| @@ -326,7 +326,7 @@ void irq_enter(void) | |||
| 326 | * here, as softirq will be serviced on return from interrupt. | 326 | * here, as softirq will be serviced on return from interrupt. |
| 327 | */ | 327 | */ |
| 328 | local_bh_disable(); | 328 | local_bh_disable(); |
| 329 | tick_check_idle(); | 329 | tick_irq_enter(); |
| 330 | _local_bh_enable(); | 330 | _local_bh_enable(); |
| 331 | } | 331 | } |
| 332 | 332 | ||
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 | /* |
