AMD Developing New Heterogeneous CPU Core Driver For Linux Systems
- Reference: 0001487842
- News link: https://www.phoronix.com/news/AMD-Heterogeneous-Core-Driver
- Source link:
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 [3]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."
[4]This patch series has the initial ~860 lines of code making up this AMD HFI driver. A healthy chunk of that is the new [5]documentation that explains the classic and dense cores, the amd_hfi driver handling, and how the thread classification and ranking is carried out.
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 [6]Strix Point on Linux.
Separately, a different [7]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 [8]merged back in Linux 6.9 and now being further refined so that it's more reliable and robust.
[1] https://www.phoronix.com/news/Ryzen-AI-Heterogeneous-Core-Top
[2] https://www.phoronix.com/news/AMD-Heterogeneous-Linux-6.5
[3] https://www.phoronix.com/search/Hardware+Feedback+Interface
[4] https://lore.kernel.org/platform-driver-x86/cover.1724748733.git.perry.yuan@amd.com/
[5] https://lore.kernel.org/platform-driver-x86/c4c66679fc6f8432c0402c8def2dc1b09eaa812d.1724748733.git.perry.yuan@amd.com/
[6] https://www.phoronix.com/search/Strix+Point
[7] https://lore.kernel.org/linux-pm/20240826211358.2694603-1-superm1@kernel.org/
[8] https://www.phoronix.com/news/Linux-6.9-rc1-Released
pWe00Iri3e7Z9lHOX2Qx