The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Guo, Wangyang" <wangyang.guo@intel.com>
To: K Prateek Nayak <kprateek.nayak@amd.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	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>,
	Valentin Schneider <vschneid@redhat.com>
Cc: 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 v5] sched/clock: Avoid false sharing for sched_clock_irqtime
Date: Tue, 27 Jan 2026 12:48:16 +0800	[thread overview]
Message-ID: <57368cb4-ddbc-4dcb-bee5-42c4c0605c55@intel.com> (raw)
In-Reply-To: <95da1e97-bcfb-4a47-affc-fcec6e729d5b@amd.com>

On 1/27/2026 11:38 AM, K Prateek Nayak wrote:
> Hello Wangyang,
> 
> On 1/27/2026 8:46 AM, Wangyang Guo wrote:
>> @@ -238,6 +239,8 @@ static int __init sched_clock_init_late(void)
>>   
>>   	if (__sched_clock_stable_early)
>>   		__set_sched_clock_stable();
>> +	else
>> +		disable_sched_clock_irqtime();  /* disable if clock unstable. */
> 
> nit. I think we should check for irqtime_enabled() before since
> static_key_disable() would grab the cpus_read_lock() unnecessarily even
> if irqtime wasn't enabled - possible with PA-RISC where a slow processor
> registers the generic sched clock not eabling irqtime and then marks the
> sched_clock unstable on SMP which would hit this without having irqtime
> enabled.
> 
> Same is case with "tsc=noirqtime" and then tsc turns unstable at early
> boot.

Added in v6 as below:
https://lore.kernel.org/all/20260127044159.2254247-1-wangyang.guo@intel.com/

@@ -238,6 +239,8 @@ static int __init sched_clock_init_late(void)

  	if (__sched_clock_stable_early)
  		__set_sched_clock_stable();
+	else if (irqtime_enabled())
+		disable_sched_clock_irqtime();  /* disable if clock unstable. */

  	return 0;
  }


      reply	other threads:[~2026-01-27  4:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27  3:16 [PATCH v5] sched/clock: Avoid false sharing for sched_clock_irqtime Wangyang Guo
2026-01-27  3:38 ` K Prateek Nayak
2026-01-27  4:48   ` Guo, Wangyang [this message]

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=57368cb4-ddbc-4dcb-bee5-42c4c0605c55@intel.com \
    --to=wangyang.guo@intel.com \
    --cc=benjamin.lei@intel.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.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 \
    /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