Linux 6.12 To Enhance The Hybrid P/E Core Experience On Intel Lunar Lake

Written by Michael Larabel in Intel on 8 September 2024 at 07:07 AM EDT. 3 Comments
INTEL
The work written about earlier this year on New Intel Linux Patches Continue Working To Improve Hybrid CPU Task Placement looks like it will be merged for the upcoming Linux 6.12 cycle as the patches have now been queued into the power management subsystem's "-next" branch. This latest Intel Core hybrid handling work is particularly focused on hybrid P/E-core processors without SMT / Hyper Threading, such as found with the upcoming Core Ultra 200V "Lunar Lake" processors.

The patch for setting asymmetric CPU capacity on hybrid systems without SMT is queued ahead of the Linux 6.12 merge window. this ensures the hardware P-state highest performance values from the CPU MSRs is properly set on hybrid CPUs without SMT/HT.
"If the given system is hybrid and non-SMT, the new code disables ITMT support in the scheduler (because it may get in the way of asymmetric CPU capacity code in the scheduler that automatically gets enabled by setting asymmetric CPU capacity) after initializing all online CPUs and finds the one with the maximum HWP_HIGHEST_PERF value. Next, it computes the capacity number for each (online) CPU by dividing the product of its HWP_HIGHEST_PERF and SCHED_CAPACITY_SCALE by the maximum HWP_HIGHEST_PERF.

When a CPU goes offline, its capacity is reset to SCHED_CAPACITY_SCALE and if it is the one with the maximum HWP_HIGHEST_PERF value, the capacity numbers for all of the other online CPUs are recomputed. This also takes care of a cleanup during driver operation mode changes.

Analogously, when a new CPU goes online, its capacity number is updated and if its HWP_HIGHEST_PERF value is greater than the current maximum one, the capacity numbers for all of the other online CPUs are recomputed."

Along with that patch is another one for basic support for CPU capacity scaling. Intel engineer and Linux power management subsystem maintainer Rafael Wysocki explains there:
"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."

With this work now in the power management subsystem's "linux-next" branch it should be merged for the upcoming Linux 6.12 merge window barring any last minute issues.

Lunar Lake P / E core slide


As covered already, I'll be testing Intel Core Ultra 200V Lunar Lake on Linux later this month. With these hybrid improvements plus Lunar Lake Xe2 graphics enabled by default with the upcoming v6.12 cycle, it's looking like Linux 6.12 will be the baseline for these next-gen Intel laptops. While these laptops are set to begin shipping in late September, the Linux 6.12 stable kernel release won't be out until November.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week