Intel Posts Reworked Linux Patches To Improve Hybrid CPU + HT/SMT Kernel Behavior

Written by Michael Larabel in Intel on 23 November 2022 at 09:30 AM EST. 5 Comments
INTEL
Back in August an Intel engineer posted a patch series to help Linux on Intel hybrid CPUs with Hyper Threading. That work benefiting newer Alder Lake and Raptor Lake processors is around avoiding unnecessary migrations within SMT domains. Finally an updated version of that patch series has now been posted as this Intel hybrid improvement works its way toward the kernel.

Intel engineer Ricardo Neri has updated the x86 scheduler patches for the Linux kernel to avoid unnecessary migrations within SMT domains on Intel hybrid processors with a mix of the performance "P" and energy-efficiency "E" cores. The v2 patches avoid potentially regressing non-x86 architectures, address various issues raised during the prior code review, and have other code rework.


Ricardo Neri summed up this latest patch series as:
"asym_packing load balancing is used to balance load among physical cores with SMT (e.g., Intel processors that support Intel Turbo Boost Max 3.0 and hybrid processors) and among SMT siblings of a physical cores (e.g., Power7).

The current implementation is sufficient for the latter case as it favors higher-priority SMT siblings. In the former case, however, we must consider the fact that the throughput of a CPU degrades if one or more of its SMT siblings are busy. Hence, a lower-priority CPU that is fully idle is more desirable than a high-priority CPU with busy SMT siblings.

To fit the current implementation of asym_packing, x86 artificially assigns a lower priority to the higher-numbered SMT siblings. In reality, there is no difference between any of the SMT siblings of a core.

Do not use different priorities for each SMT sibling. Instead, tweak the asym_packing load balancing logic to consider the idle state of the SMT siblings of a CPU.

Removing these artificial priorities avoids superfluous migrations and let lower-priority cores inspect all SMT siblings for the busiest queue. The latter is also necessary to support IPC classes of tasks, as the destination CPU will need to inspect the tasks running on CPUs of equal priority.

This patchset should not break Power7 SMT8. Functionality does not change for architectures that do not implement the new check_smt parameter of sched_prefer_asym()."

See this patch series if interested in the work. Hopefully this x86 scheduler improvement will manage to get squared away in time for next month's Linux 6.2 merge window.
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