Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull NOHZ fix from Ingo Molnar:
"This fixes an old NOHZ race where we incorrectly calculate the next
timer interrupt in certain circumstances where hrtimers are pending,
that can cause hard to reproduce stalled-values artifacts in
/proc/stat"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
nohz: Fix collision between tick and other hrtimers

+9 -2
+7 -2
kernel/time/tick-sched.c
··· 767 767 tick = expires; 768 768 769 769 /* Skip reprogram of event if its not changed */ 770 - if (ts->tick_stopped && (expires == dev->next_event)) 770 + if (ts->tick_stopped && (expires == ts->next_tick)) 771 771 goto out; 772 772 773 773 /* ··· 787 787 trace_tick_stop(1, TICK_DEP_MASK_NONE); 788 788 } 789 789 790 + ts->next_tick = tick; 791 + 790 792 /* 791 793 * If the expiration time == KTIME_MAX, then we simply stop 792 794 * the tick timer. ··· 804 802 else 805 803 tick_program_event(tick, 1); 806 804 out: 807 - /* Update the estimated sleep length */ 805 + /* 806 + * Update the estimated sleep length until the next timer 807 + * (not only the tick). 808 + */ 808 809 ts->sleep_length = ktime_sub(dev->next_event, now); 809 810 return tick; 810 811 }
+2
kernel/time/tick-sched.h
··· 27 27 * timer is modified for nohz sleeps. This is necessary 28 28 * to resume the tick timer operation in the timeline 29 29 * when the CPU returns from nohz sleep. 30 + * @next_tick: Next tick to be fired when in dynticks mode. 30 31 * @tick_stopped: Indicator that the idle tick has been stopped 31 32 * @idle_jiffies: jiffies at the entry to idle for idle time accounting 32 33 * @idle_calls: Total number of idle calls ··· 45 44 unsigned long check_clocks; 46 45 enum tick_nohz_mode nohz_mode; 47 46 ktime_t last_tick; 47 + ktime_t next_tick; 48 48 int inidle; 49 49 int tick_stopped; 50 50 unsigned long idle_jiffies;