public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Pavel Tatashin <pasha.tatashin@oracle.com>
Subject: Re: [RFC] tick_sched_timer() is not properly aligned, fixed by chance
Date: Thu, 6 Apr 2023 17:02:54 +0200	[thread overview]
Message-ID: <20230406150254.ZrawA2Y-@linutronix.de> (raw)
In-Reply-To: <87mt3lqnde.ffs@tglx>

On 2023-04-06 13:08:29 [+0200], Thomas Gleixner wrote:
> On Thu, Apr 06 2023 at 12:55, Peter Zijlstra wrote:
> > On Thu, Apr 06, 2023 at 11:57:35AM +0200, Sebastian Andrzej Siewior wrote:
> >
> >> The tick_sched_timer story is that it uses ktime_get() to set the
> >
> > But but but, ktime_get() does not use sched_clock(), it has it's own TSC
> > reader.
> 
> Correct and at that point during early boot the clocksource which feeds
> ktime_get() should be jiffies and not some other random clocksource.
> 
> Sebastian, can you please evaluate which clocksource is used for
> ktime_get() at the point where the first clock event device is set up?

The first one added is hpet. It points to "jiffies" as name and
jiffies_read() as ->read().

Before the change/ with PeterZ change I get from ktime_get() for
base/nsec something like:
|[    0.004000] tick_next_period Name: jiffies jiffies_read+0x0/0x10
|[    0.004000] tick_next_period base/nsec: -401771248 405771248
|[    0.004000] tick_next_period hpet 4000000

base/nsec is different on each boot but it always ends up with 4000000.
With the optimisation, ktime_get() is:
| [    1.179079] tick_next_period base/nsec: 647439581 518613145
| [    1.179646] tick_next_period hpet 1166052726

so something is using it during init. And this is
	read_persistent_wall_and_boot_offset()

> Thanks,
> 
>         tglx
> 
Sebastian

  reply	other threads:[~2023-04-06 15:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06  9:57 [RFC] tick_sched_timer() is not properly aligned, fixed by chance Sebastian Andrzej Siewior
2023-04-06 10:55 ` Peter Zijlstra
2023-04-06 11:08   ` Thomas Gleixner
2023-04-06 15:02     ` Sebastian Andrzej Siewior [this message]
2023-04-06 17:13       ` Thomas Gleixner
2023-04-18 12:26         ` [PATCH] timekeeping: Align tick_sched_timer() with the HZ tick Sebastian Andrzej Siewior
2023-06-13 22:59           ` [PATCH] timekeeping: Align tick_sched_timer() with the HZ tick. -- regression report Mathias Krause
2023-06-15  9:03             ` Richard W.M. Jones
2023-06-15 11:40               ` Mathias Krause
2023-06-15  9:22             ` Sebastian Andrzej Siewior
2023-06-16 18:53             ` [tip: timers/urgent] tick/common: Align tick period during sched_timer setup tip-bot2 for Thomas Gleixner
2023-04-18 13:14 ` [tip: timers/core] tick/common: Align tick period with the HZ tick tip-bot2 for Sebastian Andrzej Siewior

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=20230406150254.ZrawA2Y-@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pasha.tatashin@oracle.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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