From: Ricardo Neri <ricardo.neri-calderon@linux.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 v3 1/2] x86/sched: Add basic support for CPU capacity scaling
Date: Tue, 3 Sep 2024 23:22:44 -0700 [thread overview]
Message-ID: <20240904062244.GA3614@ranerica-svr.sc.intel.com> (raw)
In-Reply-To: <10523497.nUPlyArG6x@rjwysocki.net>
On Wed, Aug 28, 2024 at 01:47:25PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> In order be able to compute the sizes of tasks consistently across all
> CPUs in a hybrid system, it is necessary to provide CPU capacity scaling
> information to the scheduler via arch_scale_cpu_capacity(). Moreover,
> the value returned by arch_scale_freq_capacity() for the given CPU must
> correspond to the arch_scale_cpu_capacity() return value for it, or
> utilization computations will be inaccurate.
>
> Add support for it through per-CPU variables holding the capacity and
> maximum-to-base frequency ratio (times SCHED_CAPACITY_SCALE) that will
> be returned by arch_scale_cpu_capacity() and used by scale_freq_tick()
> to compute arch_freq_scale for the current CPU, respectively.
>
> In order to avoid adding measurable overhead for non-hybrid x86 systems,
> which are the vast majority in the field, whether or not the new hybrid
> CPU capacity scaling will be in effect is controlled by a static key.
> This static key is set by calling arch_enable_hybrid_capacity_scale()
> which also allocates memory for the per-CPU data and initializes it.
> Next, arch_set_cpu_capacity() is used to set the per-CPU variables
> mentioned above for each CPU and arch_rebuild_sched_domains() needs
> to be called for the scheduler to realize that capacity-aware
> scheduling can be used going forward.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> v2 -> v3:
> * Rebase after dropping patch [1/3].
> * Rename arch_set_cpu_capacity() arguments.
> * Add empty line to arch_enable_hybrid_capacity_scale().
> * Declare local variables in scale_freq_tick() on one line.
>
> v1 -> v2:
> * Replaces WARN_ON_ONCE() with WARN_ONCE() (2 places)
> * Fix arch_enable_hybrid_capacity_scale() return value when hybrid
> capacity scaling is already enabled.
> * Allow arch_enable_hybrid_capacity_scale() to succeed when
> frequency-invariance is not enabled.
> * Fix arch_set_cpu_capacity() kerneldoc comment
> * Do not disable capacity scaling in disable_freq_invariance_workfn().
> * Relocate arch_hybrid_cap_scale_key definition.
>
> ---
Only one minor comment below...
FWIW:
Reviewed-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Tested-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> # scale invariance
[...]
> +
> +static struct arch_hybrid_cpu_scale __percpu *arch_cpu_scale;
> +
> +/**
> + * arch_enable_hybrid_capacity_scale - Enable hybrid CPU capacity scaling
This looks to me like a kernel-doc comment. The function name should have ().
[...]
> +/**
> + * arch_set_cpu_capacity - Set scale-invariance parameters for a CPU
Same here.
next prev parent reply other threads:[~2024-09-04 6:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 11:45 [PATCH v3 0/2] x86 / intel_pstate: Set asymmetric CPU capacity on hybrid systems Rafael J. Wysocki
2024-08-28 11:47 ` [PATCH v3 1/2] x86/sched: Add basic support for CPU capacity scaling Rafael J. Wysocki
2024-09-03 13:57 ` Peter Zijlstra
2024-09-04 6:22 ` Ricardo Neri [this message]
2024-09-04 11:24 ` Rafael J. Wysocki
2024-08-28 11:48 ` [PATCH v3 2/2] cpufreq: intel_pstate: Set asymmetric CPU capacity on hybrid systems Rafael J. Wysocki
2024-08-30 8:30 ` Shrikanth Hegde
2024-08-30 11:10 ` Rafael J. Wysocki
2024-09-03 13:55 ` Peter Zijlstra
2024-09-03 14:02 ` Rafael J. Wysocki
2024-09-04 6:39 ` Ricardo Neri
2024-09-04 11:29 ` Rafael J. Wysocki
2024-09-04 7:25 ` [PATCH v3 0/2] x86 / " Ricardo Neri
2024-09-04 11:30 ` 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=20240904062244.GA3614@ranerica-svr.sc.intel.com \
--to=ricardo.neri-calderon@linux.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