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] [day] [month] [year] [list]
Message-ID: <802dccf4-4357-40b1-89a9-94962b6f7dbf@amd.com>
Date: Fri, 23 Jan 2026 22:18:30 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: Vincent Guittot <vincent.guittot@...aro.org>
CC: Wangyang Guo <wangyang.guo@...el.com>, Peter Zijlstra
	<peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>, Juri Lelli
	<juri.lelli@...hat.com>, Dietmar Eggemann <dietmar.eggemann@....com>, "Steven
 Rostedt" <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>, Mel Gorman
	<mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>,
	<linux-kernel@...r.kernel.org>, Shrikanth Hegde <sshegde@...ux.ibm.com>,
	Benjamin Lei <benjamin.lei@...el.com>, Tim Chen <tim.c.chen@...ux.intel.com>,
	Tianyou Li <tianyou.li@...el.com>
Subject: Re: [PATCH v3] sched/clock: Avoid false sharing for
 sched_clock_irqtime

Hello Vincent,

On 1/23/2026 9:28 PM, Vincent Guittot wrote:
>> If TSC / any potentially unstable clock is marked unstable before
>> sched_clock_init_late(), we never flip __sched_clock_stable.
>>
>> On x86 side, since we already start using TSC for native_sched_clock()
>> super early, we have defensive measures (and a __use_tsc static key on
>> the x86 side too) to switch the sched clock back to jiffies if we
>> realise TSC was unstable before we hit sched_clock_init_late().
>>
>> This is necessary since post the sched_clock_init(),
>> "sched_clock_running" is true and the local clocks will always uses
>> sched_clock_noinstr() and it must be switch to jiffies on the x86 side
>> since arch defines it.
> 
> sched_clock_init_late() is always called so can't we check if
> irqtime_enabled and clock is unstable then we disable irqtime
> accounting

That can be done, yes.

Wangyang, can you also consolidate the irqtime disable bits (TSC and
generic) to trigger at sched_clock_init_late() if the clock was found
unstable and in __sched_clock_work()? 

Both context can directly do a static_branch_disable() without
needing an extra delayed work.

-- 
Thanks and Regards,
Prateek


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ