[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <57368cb4-ddbc-4dcb-bee5-42c4c0605c55@intel.com>
Date: Tue, 27 Jan 2026 12:48:16 +0800
From: "Guo, Wangyang" <wangyang.guo@...el.com>
To: K Prateek Nayak <kprateek.nayak@....com>, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>, 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>, Valentin Schneider <vschneid@...hat.com>
Cc: 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 v5] sched/clock: Avoid false sharing for
sched_clock_irqtime
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;
}
Powered by blists - more mailing lists