AMD Hardware Feedback Interface "HFI" Driver Updated For Heterogeneous CPUs

Written by Michael Larabel in AMD on 11 October 2024 at 06:40 AM EDT. 1 Comment
AMD
Back in August I wrote about AMD beginning work on a new Linux driver to help with heterogeneous core CPUs. On Thursday a second iteration of the AMD HFI Linux driver patches were posted with this driver continuing to work its way toward the mainline kernel.

The AMD Hardware Feedback Interface (HFI) driver is designed to help with their heterogeneous core processors that contain a mix of classic and dense "C" cores. This HFI driver may also be useful for their 3D V-Cache processors where only some cores/CCDs have access to the larger L3 cache -- though on the 3D V-Cache side, yesterday AMD Linux engineers also posted a 3D V-Cache Performance Optimizer driver.

AMD Ryzen 5 8500G with Zen 4 and Zen 4C cores


Mario Limonciello who has taken over work on this AMD HFI Linux driver explains of its operation and intent:
"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 will later allow the scheduler to select the best core while threads are classified into the specified workload class."

As for the impact, enabling the AMD HFI driver on heterogeneous core CPUs should be good for a 2~5% performance improvement across different benchmarks. But there is the downside of higher latency on context switching:
"On applicable hardware this series has between a 2% and 5% improvement across various benchmarks.

There is however a cost associated with clearing history on the process context switch. On average it increases the delay by 119ns, and also has a wider range in delays (the standard deviation is 25% greater)."

Those wanting to try out the AMD HFI driver can find it on the Linux power management list while it undergoes review and hopefully will be upstreamed in the near future.
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