Skip to content

Commit 87a54ca

Browse files
committed
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner: "Viresh unearthed the following three hickups in the timer/timekeeping code: - Negated check for the result of a clock event selection - A missing early exit in the jiffies update path which causes update_wall_time to be called for nothing causing lock contention and wasted cycles in the timer interrupt - Checking a variable in the NOHZ code enable code for true which can only be set by that very code after the check succeeds. That results in a rock solid runtime disablement of that feature" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: tick-sched: Check tick_nohz_enabled in tick_nohz_switch_to_nohz() tick-sched: Don't call update_wall_time() when delta is lesser than tick_period tick-common: Fix wrong check in tick_check_replacement()
2 parents 81cef0f + 2763053 commit 87a54ca

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎kernel/time/tick-common.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static bool tick_check_preferred(struct clock_event_device *curdev,
276276
bool tick_check_replacement(struct clock_event_device *curdev,
277277
struct clock_event_device *newdev)
278278
{
279-
if (tick_check_percpu(curdev, newdev, smp_processor_id()))
279+
if (!tick_check_percpu(curdev, newdev, smp_processor_id()))
280280
return false;
281281

282282
return tick_check_preferred(curdev, newdev);

‎kernel/time/tick-sched.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ static void tick_do_update_jiffies64(ktime_t now)
8484

8585
/* Keep the tick_next_period variable up to date */
8686
tick_next_period = ktime_add(last_jiffies_update, tick_period);
87+
} else {
88+
write_sequnlock(&jiffies_lock);
89+
return;
8790
}
8891
write_sequnlock(&jiffies_lock);
8992
update_wall_time();
@@ -967,7 +970,7 @@ static void tick_nohz_switch_to_nohz(void)
967970
struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);
968971
ktime_t next;
969972

970-
if (!tick_nohz_active)
973+
if (!tick_nohz_enabled)
971974
return;
972975

973976
local_irq_disable();

0 commit comments

Comments
 (0)