From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Wangyang Guo <wangyang.guo@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
"Steven Rostedt" <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
<linux-kernel@vger.kernel.org>,
Shrikanth Hegde <sshegde@linux.ibm.com>,
Benjamin Lei <benjamin.lei@intel.com>,
Tim Chen <tim.c.chen@linux.intel.com>,
Tianyou Li <tianyou.li@intel.com>
Subject: Re: [PATCH v3] sched/clock: Avoid false sharing for sched_clock_irqtime
Date: Fri, 23 Jan 2026 22:18:30 +0530 [thread overview]
Message-ID: <802dccf4-4357-40b1-89a9-94962b6f7dbf@amd.com> (raw)
In-Reply-To: <CAKfTPtDc=aiXXYZKx3wQzV70=KbK0DKSOQLqHjMT+CPrTmdm_g@mail.gmail.com>
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
next prev parent reply other threads:[~2026-01-23 16:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 2:39 Wangyang Guo
2026-01-16 9:43 ` K Prateek Nayak
2026-01-16 10:22 ` Vincent Guittot
2026-01-16 14:22 ` K Prateek Nayak
2026-01-16 16:41 ` Vincent Guittot
2026-01-19 4:13 ` K Prateek Nayak
2026-01-22 10:36 ` Vincent Guittot
2026-01-23 4:51 ` K Prateek Nayak
2026-01-23 15:58 ` Vincent Guittot
2026-01-23 16:48 ` K Prateek Nayak [this message]
2026-01-26 2:25 ` Guo, Wangyang
2026-01-16 16:58 ` Shrikanth Hegde
2026-01-26 2:28 ` Guo, Wangyang
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=802dccf4-4357-40b1-89a9-94962b6f7dbf@amd.com \
--to=kprateek.nayak@amd.com \
--cc=benjamin.lei@intel.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sshegde@linux.ibm.com \
--cc=tianyou.li@intel.com \
--cc=tim.c.chen@linux.intel.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=wangyang.guo@intel.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®