Skip to content

Commit 304e6b6

Browse files
committed
sched/numa: skip VMA scanning on memory pinned to one NUMA node via cpuset.mems
JIRA: https://issues.redhat.com/browse/RHEL-110301 commit 1f6c6ac Author: Libo Chen <[email protected]> Date: Wed Apr 23 19:45:22 2025 -0700 sched/numa: skip VMA scanning on memory pinned to one NUMA node via cpuset.mems Patch series "sched/numa: Skip VMA scanning on memory pinned to one NUMA node via cpuset.mems", v5. This patch (of 2): When the memory of the current task is pinned to one NUMA node by cgroup, there is no point in continuing the rest of VMA scanning and hinting page faults as they will just be overhead. With this change, there will be no more unnecessary PTE updates or page faults in this scenario. We have seen up to a 6x improvement on a typical java workload running on VMs with memory and CPU pinned to one NUMA node via cpuset in a two-socket AARCH64 system. With the same pinning, on a 18-cores-per-socket Intel platform, we have seen 20% improvment in a microbench that creates a 30-vCPU selftest KVM guest with 4GB memory, where each vCPU reads 4KB pages in a fixed number of loops. Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Libo Chen <[email protected]> Tested-by: Chen Yu <[email protected]> Tested-by: Srikanth Aithal <[email protected]> Tested-by: Venkat Rao Bagalkote <[email protected]> Cc: "Chen, Tim C" <[email protected]> Cc: Chris Hyser <[email protected]> Cc: Daniel Jordan <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Juri Lelli <[email protected]> Cc: K Prateek Nayak <[email protected]> Cc: Lorenzo Stoakes <[email protected]> Cc: Madadi Vineeth Reddy <[email protected]> Cc: Mel Gorman <mgorman <[email protected]> Cc: Michal Koutný <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Raghavendra K T <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Vincent Guittot <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Phil Auld <[email protected]>
1 parent bf4d389 commit 304e6b6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/sched/fair.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3306,6 +3306,13 @@ static void task_numa_work(struct callback_head *work)
33063306
if (p->flags & PF_EXITING)
33073307
return;
33083308

3309+
/*
3310+
* Memory is pinned to only one NUMA node via cpuset.mems, naturally
3311+
* no page can be migrated.
3312+
*/
3313+
if (cpusets_enabled() && nodes_weight(cpuset_current_mems_allowed) == 1)
3314+
return;
3315+
33093316
if (!mm->numa_next_scan) {
33103317
mm->numa_next_scan = now +
33113318
msecs_to_jiffies(sysctl_numa_balancing_scan_delay);

0 commit comments

Comments
 (0)