New Intel Linux Patches Continue Working To Improve Hybrid CPU Task Placement
([Intel] 5 Hours Ago
Intel P-State Scheduling)
- Reference: 0001483277
- News link: https://www.phoronix.com/news/Intel-Linux-Mid-2024-Hybrid
- Source link:
Building off some "request for comments" patches sent out in April, a new set of patches appeared on Friday for the Intel P-State Linux driver for setting the asymmetric CPU capacity on hybrid systems. This is another attempt at helping to improve the Linux kernel scheduler behavior in ensuring optimal task placement between Intel Core processors having a mix of P and E cores. This patch series in particular helps when SMT / Hyper Threading support is disabled or like with upcoming Lunar Lake processors where there is no HT support.
There has been a lot of Linux kernel improvements merged by Intel engineers already to further improve the kernel scheduler's task placement on modern Core CPUs with a mix of P and E cores. That effort isn't over yet with a new series having debuted this week to help Linux on these modern Intel Core desktops and laptops.
Linux power management subsystem maintainer Rafael Wysocki of Intel posted the new patches on Friday and explained:
"The purpose of this series is to provide the scheduler with asymmetric CPU capacity information on x86 hybrid systems based on Intel hardware.
The asymmetric CPU capacity information is important on hybrid systems as it allows utilization to be computed for tasks in a consistent way across all CPUs in the system, regardless of their capacity. This, in turn, allows the schedutil cpufreq governor to set CPU performance levels consistently in the cases when tasks migrate between CPUs of different capacities. It should also help to improve task placement and load balancing decisions on hybrid systems and it is key for anything along the lines of EAS.
The information in question comes from the MSR_HWP_CAPABILITIES register and is provided to the scheduler by the intel_pstate driver, as per the changelog of patch [3/3]. Patch [2/3] introduces the arch infrastructure needed for that (in the form of a per-CPU capacity variable) and patch [1/3] is a preliminary code adjustment."
Compared to the RFC patches from April, the new version properly takes care of frequency invariance handling and other changes.
These patches also need Simultaneous Multi-Threading / Hyper Threading disabled for proper handling. The third patch notes:
"Make intel_pstate use the HWP_HIGHEST_PERF values from MSR_HWP_CAPABILITIES to set asymmetric CPU capacity information via the previously introduced arch_set_cpu_capacity() on hybrid systems without SMT.
...
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."
Back in April the kernel developers said they were running their hybrid CPUs in the "nosmt" configuration to disable SMT support. With the upcoming Lunar Lake processors, there is no longer SMT/HT support. Intel argues its for better performance and from this kernel patch work also apparent it eases the burden around better task placement / scheduling behavior between P and E cores. Wysocki [1]commented on the earlier RFC patch series about hybrid scheduling in the context of SMT:
"nosmt is one way to run without SMT. Another one is to disable SMT in the BIOS setup.
Anyway, the point here is that with SMT, accurate tracking of task utilization is rather hopeless."
The [2]v1 patch series is now out for review. Though given the timing it won't be mainlined until the Linux 6.12 kernel at the earliest... Linux 6.12 will see its merge window open in September and a stable release around November. Meanwhile [3]Intel Core Ultra Series 2 "Lunar Lake" hybrid processors are launching on 3 September and thus there still may be some less than ideal scheduling behavior between P and E cores to deal with on Linux with current kernel versions.
[1] https://lore.kernel.org/linux-pm/CAJZ5v0hGiwoytVmVr=h8JJ1yf5KTcr+p7BrRgSUM-L_X6fciUA@mail.gmail.com/
[2] https://lore.kernel.org/linux-pm/4908113.GXAFRqVoOG@rjwysocki.net/#t
[3] https://www.phoronix.com/news/Intel-Lunar-Lake-3-September
There has been a lot of Linux kernel improvements merged by Intel engineers already to further improve the kernel scheduler's task placement on modern Core CPUs with a mix of P and E cores. That effort isn't over yet with a new series having debuted this week to help Linux on these modern Intel Core desktops and laptops.
Linux power management subsystem maintainer Rafael Wysocki of Intel posted the new patches on Friday and explained:
"The purpose of this series is to provide the scheduler with asymmetric CPU capacity information on x86 hybrid systems based on Intel hardware.
The asymmetric CPU capacity information is important on hybrid systems as it allows utilization to be computed for tasks in a consistent way across all CPUs in the system, regardless of their capacity. This, in turn, allows the schedutil cpufreq governor to set CPU performance levels consistently in the cases when tasks migrate between CPUs of different capacities. It should also help to improve task placement and load balancing decisions on hybrid systems and it is key for anything along the lines of EAS.
The information in question comes from the MSR_HWP_CAPABILITIES register and is provided to the scheduler by the intel_pstate driver, as per the changelog of patch [3/3]. Patch [2/3] introduces the arch infrastructure needed for that (in the form of a per-CPU capacity variable) and patch [1/3] is a preliminary code adjustment."
Compared to the RFC patches from April, the new version properly takes care of frequency invariance handling and other changes.
These patches also need Simultaneous Multi-Threading / Hyper Threading disabled for proper handling. The third patch notes:
"Make intel_pstate use the HWP_HIGHEST_PERF values from MSR_HWP_CAPABILITIES to set asymmetric CPU capacity information via the previously introduced arch_set_cpu_capacity() on hybrid systems without SMT.
...
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."
Back in April the kernel developers said they were running their hybrid CPUs in the "nosmt" configuration to disable SMT support. With the upcoming Lunar Lake processors, there is no longer SMT/HT support. Intel argues its for better performance and from this kernel patch work also apparent it eases the burden around better task placement / scheduling behavior between P and E cores. Wysocki [1]commented on the earlier RFC patch series about hybrid scheduling in the context of SMT:
"nosmt is one way to run without SMT. Another one is to disable SMT in the BIOS setup.
Anyway, the point here is that with SMT, accurate tracking of task utilization is rather hopeless."
The [2]v1 patch series is now out for review. Though given the timing it won't be mainlined until the Linux 6.12 kernel at the earliest... Linux 6.12 will see its merge window open in September and a stable release around November. Meanwhile [3]Intel Core Ultra Series 2 "Lunar Lake" hybrid processors are launching on 3 September and thus there still may be some less than ideal scheduling behavior between P and E cores to deal with on Linux with current kernel versions.
[1] https://lore.kernel.org/linux-pm/CAJZ5v0hGiwoytVmVr=h8JJ1yf5KTcr+p7BrRgSUM-L_X6fciUA@mail.gmail.com/
[2] https://lore.kernel.org/linux-pm/4908113.GXAFRqVoOG@rjwysocki.net/#t
[3] https://www.phoronix.com/news/Intel-Lunar-Lake-3-September
pWe00Iri3e7Z9lHOX2Qx