AMD Developing New Heterogeneous CPU Core Driver For Linux Systems

Written by Michael Larabel in AMD on 27 August 2024 at 08:23 AM EDT. 4 Comments
AMD
AMD for months has already been working on heterogeneous core topology optimizations for Linux within the AMD P-State CPUFreq driver and other heterogeneous CPU topology improvements for dealing with Ryzen systems sporting a mix of "classic" (full) cores with the denser "C" cores. Today though they've announced a brand new "Heterogeneous Core Driver" for further enhancing Linux support for AMD platforms sporting a combination of core types.

The AMD Heterogeneous Core Driver makes use of the Hardware Feedback Interface to provide for more detailed knowledge to the kernel about the core performance/power capabilities to help better with deciding where a thread (task) should be placed. Intel similarly makes use of the Hardware Feedback Interface (HFI) as part of their P vs. E core handling on Linux.

With today's first patch series presenting this open-source AMD Heterogeneous Core Driver for Linux, the patch cover letter explains:
"The AMD Heterogeneous core design and Hardware Feedback Interface (HFI) provide behavioral classification and a dynamically updated ranking table for the scheduler to use when choosing cores for tasks.

Threads are classified during runtime into enumerated classes. Currently, the driver supports 3 classes (0 through 2). These classes represent thread performance/power characteristics that may benefit from special scheduling behaviors. The real-time thread classification is consumed by the operating system and is used to inform the scheduler of where the thread should be placed for optimal performance or energy efficiency.

The thread classification helps to select CPU from a ranking table that describes an efficiency and performance ranking for each classification from two dimensions.

The ranking data provided by the ranking table are numbers ranging from 0 to 255, where a higher performance value indicates higher performance capability and a higher efficiency value indicates greater efficiency. All the CPU cores are ranked into different class IDs. Within each class ranking, the cores may have different ranking values. Therefore, picking from each classification ID allows the scheduler to select the best core while threads are classified into the specified workload class. The cores ranking table is provided with PCCT subspace type 4 shared memory, which includes the memory base address and length."

This patch series has the initial ~860 lines of code making up this AMD HFI driver. A healthy chunk of that is the new documentation that explains the classic and dense cores, the amd_hfi driver handling, and how the thread classification and ranking is carried out.

AMD_HFI Kconfig help text


As part of this driver is adding a new X86_FEATURE_WORKLOAD_CLASS "workload classification" feature bit. This is used for indicating workload-based heuristic feedback to the operating system for scheduling decisions.

This new "AMD_HFI" driver is now undergoing code review. Given the Linux v6.12 merge window is opening up in just a few weeks, it's unlikely the driver will be deemed reviewed, tested, and ready for merging by then. Thus at the earliest we're likely looking at the driver potentially being ready for Linux v6.13 that in turn will reach a stable release in early 2025. I'll be running some benchmarks on my side with these new AMD heterogeneous core driver patches to see if they help further enhance the likes of Strix Point on Linux.

Separately, a different patch series was posted on Monday for tuning the AMD Preferred Core detection in the AMD P-State driver. The initial AMD Preferred Core support for Linux systems was merged back in Linux 6.9 and now being further refined so that it's more reliable and robust.
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