Re: [PATCH v2] sched/cputime: Don't warn when the tick period starts after idle exit
From: Stian Halseth
Date: Sat Oct 31 2026 - 08:16:02 EST
Hi Kayra,
On Sat, 2026-10-31 at 14:47 +0300, Kayra Cizmeci wrote:
>
> TICK_NSEC = 4
>
> switch
> |
> v
> Real: 8 9 10 11 12 13 14 15 16 17 18
>
> Time: 8 8 8 9 10 11 12 13 14 15 16
>
> Tick: 8 8 8 8 10 10 10 10 10 10 16
>
>
> So if we enter idle at real-12, and exit at real-13 this happens:
>
> last_tick is 16, so last_tick - 4 = 12. But normally, last_tick needs to
> be 14 and tick_start needs to be 10. Or am I missing something?
Your diagram is correct AFAICT, and that's the case this patch is about.
10 and 14 would follow the old periodic ticks, but after the switch the
tick runs on a grid that is d ahead of them.
Idle ends at 11, before tick_start at 12. The code already accounted
that correctly but warned about it, and v2 drops the warning.
>
> IDK if there is a better solution tho.
> Maybe fixing it from the root would be better. If its even possible to do it
> cleanly...
Someone might have a better idea, but maybe we could realign
tick_next_period when the clocksource switches away from jiffies.
I kept v2 to the warning though, since this is a regression in the
current release, and a change to the tick setup could be a potential
follow-up.
Thanks for the review!
/Stian
Attachment:
signature.asc
Description: This is a digitally signed message part