mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stian Halseth <stian@itx.no>
To: Kayra Cizmeci <kayracizmeci@gmail.com>
Cc: Frederic Weisbecker <frederic@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Paul Menzel <pmenzel@molgen.mpg.de>,
	Breno Leitao <leitao@debian.org>,
	Thorsten Leemhuis <linux@leemhuis.info>,
	Thomas Gleixner <tglx@kernel.org>,
	Anna-Maria Behnsen <anna-maria@linutronix.de>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	regressions@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] sched/cputime: Don't warn when the tick period starts after idle exit
Date: Sat, 31 Oct 2026 13:15:49 +0100	[thread overview]
Message-ID: <9bf3339ad6bf6b15668f6c35b57a8f42265b7f6e.camel@itx.no> (raw)
In-Reply-To: <auW3XbhjMjakWAhT@scheduler.schedules>

[-- Attachment #1: Type: text/plain, Size: 1295 bytes --]

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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-10-31 12:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  8:14 Stian Halseth
2026-10-31 11:47 ` Kayra Cizmeci
2026-10-31 12:15   ` Stian Halseth [this message]
2026-10-31 23:11 ` Frederic Weisbecker
2026-11-01  6:50 ` [tip: sched/urgent] " tip-bot2 for Stian Halseth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9bf3339ad6bf6b15668f6c35b57a8f42265b7f6e.camel@itx.no \
    --to=stian@itx.no \
    --cc=anna-maria@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=kayracizmeci@gmail.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@leemhuis.info \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmenzel@molgen.mpg.de \
    --cc=regressions@lists.linux.dev \
    --cc=sshegde@linux.ibm.com \
    --cc=tglx@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®