lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251011085052.1237082-1-tianyaxiong@kylinos.cn>
Date: Sat, 11 Oct 2025 16:50:52 +0800
From: Yaxiong Tian <tianyaxiong@...inos.cn>
To: rafael@...nel.org
Cc: christian.loehle@....com,
	dietmar.eggemann@....com,
	linux-kernel@...r.kernel.org,
	linux-pm@...r.kernel.org,
	lukasz.luba@....com,
	srinivas.pandruvada@...ux.intel.com
Subject: Re:[PATCH v1 3/3] cpufreq: intel_pstate: Simplify the energy model for hybrid systems

> Since em_cpu_energy() computes the cost of using a given CPU to
> do work as a product of the utilization of that CPU and a constant
> positive cost coefficient supplied through an energy model, EAS
> evenly distributes the load among CPUs represented by identical
> one-CPU PDs regardless of what is there in the energy model.
> 
> Namely, two CPUs represented by identical PDs have the same energy
> model data and if the PDs are one-CPU, max_util is always equal to the
> utilization of the given CPU, possibly increased by the utilization
> of a task that is waking up.  The cost coefficient is a monotonically
> increasing (or at least non-decreasing) function of max_util, so the
> CPU with higher utilization will generally get a higher (or at least
> not lower) cost coefficient.  After multiplying that coefficient by
> CPU utilization, the resulting number will always be higher for the
> CPU with higher utilization.  Accordingly, whenever these two CPUs
> are compared, the cost of running a waking task will always be higher
> for the CPU with higher utilization which leads to the even distribution
> of load mentioned above.
> 
> For this reason, the energy model can be adjusted in arbitrary
> ways without disturbing the even distribution of load among CPUs
> represented by indentical one-CPU PDs.  In particular, for all of
> those CPUs, the energy model can provide one cost coefficient that
> does not depend on the performance level.

But if the cost is a constant that does not depend on performance levels, 
then the energy increment for running a waking task on these CPUs would be 
the same. For example, for a task with utilization u, whether it is placed 
on CPU A or CPU B, since the cost is the same, the energy increment generated 
would be identical. In this case, EAS should not perform load balancing 
between them.

> 
> Moreover, if there are two different CPU types, A and B, each having
> a performance-independent cost coefficient in the EM, then these
> cost coefficients determine the utilization levels at which CPUs
> of type A and B will be regarded as equally expensive for running
> a waking task.  For example, if the cost coefficient for CPU type
> A is 1, the cost coefficient for CPU type B is 2, and the utilization
> of the waking task is x, a CPU of type A will be regarded as "cost-
> equivalent" to a CPU of type B if its utilization is the sum of x and
> twice the utilization of the latter.  Similarly, for the cost
> coefficients equal to 2 and 3, respectively, the "cost equivalence"
> utilization of CPU type A will be the sum of x/2 and the CPU type B
> utilization multiplied by 3/2.  In the limit of negligibly small x,
> the "cost equivalence" utilization of CPU type A is just the
> utilization of CPU type B multiplied by the ratio of the cost
> coefficients for B and A.  That ratio can be regarded as an effective
> "cost priority" of CPU type A relative to CPU type B, as it indicates
> how much more on average the former needs to be loaded so it can be
> regarded as cost-equivalent to the latter (for low-utilization tasks).
> 
> Use the above observations for simplifying the default energy model
> for hybrid platforms in intel_pstate as follows:
> 
>  * A performance-independent cost coefficient is introduced for each CPU
>    type.
> 
>  * The number of states in each PD is reduced to 2 (it is not necessary
>    to use more of them because the cost per scale-invariant utilization
>    point does not depend on the performance level any more).
> 
>  * CPUs without L3 cache (LPE-cores) that are expected to be the most
>    energy-efficient ones are prioritized over any other CPUs.
> 
>  * The CPU type value from CPUID (now easliy accessible through
>    cpu_data[]) is used for identifying P-cores and E-cores instead
>    of hybrid scaling factors which are less reliable.
> 
>  * E-cores are preferred to P-cores.
> 
> The cost coefficients for different CPU types that can appear in a
> hybrid system (P-cores, E-cores, and LPE-cores that are effectively
> E-cores without L3 cache and with lower capacity) are chosen in
> accordance with the following rules:
> 
>  * The cost priority of LPE-cores relative to E-cores is 1.5.
> 
>  * The cost priority of E-cores relative to P-cores is 2, which
>    also means that the cost priority of LPE-cores relative to
>    P-cores is 3.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ