From: Chen Yu <yu.c.chen@intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: x86 Maintainers <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
"Ricardo Neri" <ricardo.neri@intel.com>,
Tim Chen <tim.c.chen@intel.com>
Subject: Re: [PATCH v2 2/3] x86/sched: Add basic support for CPU capacity scaling
Date: Tue, 13 Aug 2024 09:27:31 +0800 [thread overview]
Message-ID: <ZrqxqCVbw18AP5Ou@chenyu5-mobl2> (raw)
In-Reply-To: <13573795.uLZWGnKmhe@rjwysocki.net>
Hi Rafael,
On 2024-08-12 at 14:42:26 +0200, Rafael J. Wysocki wrote:
> +void arch_set_cpu_capacity(int cpu, unsigned long cap, unsigned long base_cap,
> + unsigned long max_freq, unsigned long base_freq)
> +{
> + if (static_branch_likely(&arch_hybrid_cap_scale_key)) {
> + WRITE_ONCE(per_cpu_ptr(arch_cpu_scale, cpu)->capacity,
> + div_u64(cap << SCHED_CAPACITY_SHIFT, base_cap));
> + WRITE_ONCE(per_cpu_ptr(arch_cpu_scale, cpu)->freq_ratio,
> + div_u64(max_freq << SCHED_CAPACITY_SHIFT, base_freq));
>
Would the capacity update be frequently invoked? Just wonder if we could
first READ_ONCE() to check if the value is already the value we want to
change to, to avoid one write and less cache snoop overhead (in case other
CPU reads this CPU's capacity)
thanks,
Chenyu
next prev parent reply other threads:[~2024-08-13 1:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-12 12:35 [PATCH v2 0/3] x86 / intel_pstate: Set asymmetric CPU capacity on hybrid systems Rafael J. Wysocki
2024-08-12 12:37 ` [PATCH v2 1/3] x86/sched: Introduce arch_rebuild_sched_domains() Rafael J. Wysocki
2024-08-12 12:42 ` [PATCH v2 2/3] x86/sched: Add basic support for CPU capacity scaling Rafael J. Wysocki
2024-08-13 1:27 ` Chen Yu [this message]
2024-08-13 11:07 ` Rafael J. Wysocki
2024-08-26 22:08 ` Ricardo Neri
2024-08-27 11:57 ` Rafael J. Wysocki
2024-08-12 12:44 ` [PATCH v2 3/3] cpufreq: intel_pstate: Set asymmetric CPU capacity on hybrid systems Rafael J. Wysocki
2024-08-26 23:07 ` Ricardo Neri
2024-08-27 11:49 ` Rafael J. Wysocki
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=ZrqxqCVbw18AP5Ou@chenyu5-mobl2 \
--to=yu.c.chen@intel.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=ricardo.neri@intel.com \
--cc=rjw@rjwysocki.net \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@intel.com \
--cc=x86@kernel.org \
/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