Linux 6.12 To Enhance The Hybrid P/E Core Experience On Intel Lunar Lake
([Intel] 5 Hours Ago
Hybrid CPU + No SMT)
- Reference: 0001490392
- News link: https://www.phoronix.com/news/Linux-6.12-Hybrid-No-SMT-Cap
- Source link:
The work written about earlier this year on [1]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 [2]Core Ultra 200V "Lunar Lake" processors.
The [3]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 [4]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.
[5]
As covered already, [6]I'll be testing Intel Core Ultra 200V Lunar Lake on Linux later this month . With these hybrid improvements plus [7]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.
[1] https://www.phoronix.com/news/Intel-Linux-Mid-2024-Hybrid
[2] https://www.phoronix.com/news/Intel-Lunar-Lake-Launched
[3] https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=929ebc93ccaa8d183a2ba9f1cf769d1bfb847cca
[4] https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5a9d10145a54f7a3fb6297c0082bf030e04db3bc
[5] https://www.phoronix.com/image-viewer.php?id=2024&image=lunarlake_linux_4_lrg
[6] https://www.phoronix.com/news/Intel-Lunar-Lake-Linux-Zenbook
[7] https://www.phoronix.com/news/Linux-6.12-Intel-Xe2-Stable
The [3]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 [4]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.
[5]
As covered already, [6]I'll be testing Intel Core Ultra 200V Lunar Lake on Linux later this month . With these hybrid improvements plus [7]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.
[1] https://www.phoronix.com/news/Intel-Linux-Mid-2024-Hybrid
[2] https://www.phoronix.com/news/Intel-Lunar-Lake-Launched
[3] https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=929ebc93ccaa8d183a2ba9f1cf769d1bfb847cca
[4] https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=5a9d10145a54f7a3fb6297c0082bf030e04db3bc
[5] https://www.phoronix.com/image-viewer.php?id=2024&image=lunarlake_linux_4_lrg
[6] https://www.phoronix.com/news/Intel-Lunar-Lake-Linux-Zenbook
[7] https://www.phoronix.com/news/Linux-6.12-Intel-Xe2-Stable
pWe00Iri3e7Z9lHOX2Qx