Re: [PATCH 1/4] tick/sched: Forward timer even in nohz mode

From: Scott Wood
Date: Mon Jan 06 2020 - 15:12:26 EST


On Mon, 2019-12-16 at 18:22 -0500, Scott Wood wrote:
> Currently when exiting nohz, the expiry will be forwarded as if we
> had just run the timer. If we re-enter nohz before this new expiry,
> and exit after, this forwarding will happen again. If this load pattern
> recurs the tick can be indefinitely postponed.
>
> To avoid this, use last_tick as-is rather than calling hrtimer_forward().
> However, in some cases the tick *will* have just run (despite being
> "stopped"), and leading to double timer execution.
>
> To avoid that, forward the timer after every tick (regardless of nohz
> status) and keep last_tick up-to-date. During nohz, last_tick will
> reflect what the expiry would have been if not in nohz mode.
>
> Signed-off-by: Scott Wood <swood@xxxxxxxxxx>
> ---
> kernel/time/tick-sched.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)

Any comments on these patches?

Thanks,
Scott