lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 14 Apr 2023 10:24:42 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Aaron Thompson <dev@...ont.org>
Cc:     Ingo Molnar <mingo@...hat.com>, Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Valentin Schneider <vschneid@...hat.com>,
        Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [RESEND PATCH] sched/clock: Fix local_clock() before
 sched_clock_init()

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@...ont.org>

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ