Linux 6.5 Scheduler Patch Will To Help AMD Systems With Multiple LLCs Per Die
There is a Linux kernel scheduler patch now queued via TIP's sched/core branch that can help with task scheduling on AMD processors sporting multiple last-level caches (LLCs / L3 cache) per die. This minor improvement came after a discovery by a Linux kernel developer on his AMD Zen 2 desktop.
This change that should be merged for Linux 6.5 now that it's in tip/tip.git's sched/core branch is a multi-LLC-aware select_idle_sibling() implementation. Currently when the scheduler looks for an idle CPU in the scheduler domain, it wouldn't look outside of the current group of cores sharing an LLC. But now with this multi-LLC version it will consider other LLCs should the local LLC come up empty.
The patch by longtime Linux kernel engineer Peter Zijlstra explains:
Those with modern AMD systems in particular and wanting to test out this patch prior to the expected Linux 6.5 merge window can find it via the sched/core branch.
This change that should be merged for Linux 6.5 now that it's in tip/tip.git's sched/core branch is a multi-LLC-aware select_idle_sibling() implementation. Currently when the scheduler looks for an idle CPU in the scheduler domain, it wouldn't look outside of the current group of cores sharing an LLC. But now with this multi-LLC version it will consider other LLCs should the local LLC come up empty.
The patch by longtime Linux kernel engineer Peter Zijlstra explains:
sched/fair: Multi-LLC select_idle_sibling()
[Linux developer Tejun Heo] reported that when he targets workqueues towards a specific LLC on his Zen2 machine with 3 cores / LLC and 4 LLCs in total, he gets significant idle time.
This is, of course, because of how select_idle_sibling() will not consider anything outside of the local LLC, and since all these tasks are short running the periodic idle load balancer is ineffective.
And while it is good to keep work cache local, it is better to not have significant idle time. Therefore, have select_idle_sibling() try other LLCs inside the same node when the local one comes up empty.
Those with modern AMD systems in particular and wanting to test out this patch prior to the expected Linux 6.5 merge window can find it via the sched/core branch.
Add A Comment