A request for comments patch series from a NVIDIA engineer would allow Linux to expose a new sysfs control so user-space can express preferred CPU cores. This could be tied into user-space solutions like Thermald for preferring certain CPU cores over the others based on the CPU core temperatures or other external factors. Merged for Linux 7.4 was the new steal governor for VMs and as part of that was adding the preferred CPU mask for helping to reduce vCPU demand when physical CPU cores are contended. Yury Norov of NVIDIA has proposed adding a writable interface to sysfs for also communicating preferred CPU cores from user-space. One of the use-cases portrayed with these initial patches would be tieing it in with the Thermald daemon and could be used to encourage CPU idling on certain cores if they are running too hot. Or similarly with this functionality being exposed via sysfs, any other user-space solution could be devised if desiring a particular CPU core preference. Another example was if both AI training and inference VMs are running on the same server, setting a core preference for the more latency sensitive inference work: "Preferred cpumask is a powerful instrument to hint the fair scheduler on tasks placement under certain conditions like vCPU overcommitment. It may be even more powerful if the final decision on which vCPUs are preferred is delegated to userspace. Considering two VMs running training and inference AI workloads, the inference is more latency critical. In case of contention, the inference VM should keep more preferred vCPUs for better UX. The in-kernel steal governor is the reasonable default approach that works good for cooperative VMs running similar workloads. In case of non-symmetrical VMs, optimal vCPUs throttling may require sharing more information between VMs, or at least knowing their role. This may be naturally addressed on userspace level." The proposed sysfs interface is via /sys/devices/system/cpu/cpu[0-9]*/preferred. The list of active preferred CPU cores would also be accessible via /sys/devices/system/cpu/preferred. The patch series is out for review on the Linux kernel mailing list.
NVIDIA Engineer Works On New User-Space Linux Control For Preferred CPU Cores
Full Article
Original Source
Read the full article at Phoronix →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.