Re: [PATCH] sched/cputime: Don't warn when the tick period starts after idle exit
From: Stian Halseth
Date: Fri Oct 30 2026 - 16:48:53 EST
Hi Breno,
On Fri, 2026-10-30 at 09:14 -0700, Breno Leitao wrote:
> On Sun, Oct 25, 2026 at 11:02:02AM +0100, Stian Halseth wrote:
> > I could not hit the window in a KVM guest, but instrumented, the guest
> > showed the sched timer armed 5.9 ms after now at HZ=250 right after a
> > jiffies -> hpet switch, and tick stops saving a ts->last_tick more than
> > a tick ahead. The fix boots without warnings there.
>
> I am seeing this on my testing real hosts:
>
> clocksource: Switched to clocksource tsc-early
> ------------[ cut here ]------------
> WARNING: kernel/sched/cputime.c:481 at
> kcpustat_dyntick_stop+0x15e/0x1d0, CPU#2: swapper/2/0 [warn]
Thanks, that is the same case that Paul reported.
The first idle period of a CPU right after the switch to tsc-early. Your
registers have tick_start 49844000000 (RAX/R14) and now 49843761206 (RBX), so
the idle exit came 239 us before the start of the first tick period, and
R12 is that difference.
I don't see anything accounted wrong, and the warning is the only problem.
Thispatch drops it.
If you can confirm it goes quiet on those hosts with the patch, maybe you
could provide a Tested-By?
/Stian
Attachment:
signature.asc
Description: This is a digitally signed message part