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.
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.