mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Aaron Thompson <dev@aaront.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <vschneid@redhat.com>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH] sched/clock: Fix local_clock() before sched_clock_init()
Date: Fri, 14 Apr 2023 10:24:42 +0200	[thread overview]
Message-ID: <20230414082442.GV4253@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230413175012.2201-1-dev@aaront.org>

On Thu, Apr 13, 2023 at 05:50:12PM +0000, Aaron Thompson wrote:
> Have local_clock() return sched_clock() if sched_clock_init() has not
> yet run. sched_clock_cpu() has this check but it was not included in the
> new noinstr implementation of local_clock().
> 
> The effect can be seen on x86 with CONFIG_PRINTK_TIME enabled, for
> instance. scd->clock quickly reaches the value of TICK_NSEC and that
> value is returned until sched_clock_init() runs.
> 
> dmesg without this patch:
> 
>     [    0.000000] kvm-clock: ...
>     [    0.000002] kvm-clock: ...
>     [    0.000672] clocksource: ...
>     [    0.001000] tsc: ...
>     [    0.001000] e820: ...
>     [    0.001000] e820: ...
>      ...
>     [    0.001000] ..TIMER: ...
>     [    0.001000] clocksource: ...
>     [    0.378956] Calibrating delay loop ...
>     [    0.379955] pid_max: ...
> 
> dmesg with this patch:
> 
>     [    0.000000] kvm-clock: ...
>     [    0.000001] kvm-clock: ...
>     [    0.000675] clocksource: ...
>     [    0.002685] tsc: ...
>     [    0.003331] e820: ...
>     [    0.004190] e820: ...
>      ...
>     [    0.421939] ..TIMER: ...
>     [    0.422842] clocksource: ...
>     [    0.424582] Calibrating delay loop ...
>     [    0.425580] pid_max: ...
> 
> Fixes: 776f22913b8e ("sched/clock: Make local_clock() noinstr")
> Signed-off-by: Aaron Thompson <dev@aaront.org>

Thanks!

  reply	other threads:[~2023-04-14  8:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 17:50 Aaron Thompson
2023-04-14  8:24 ` Peter Zijlstra [this message]
2023-04-22  7:43 ` [tip: sched/core] " tip-bot2 for Aaron Thompson

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=20230414082442.GV4253@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dev@aaront.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /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®