Skip to content

Commit 1f6c6ac

Browse files
Libo Chenakpm00
authored andcommitted
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]>
1 parent f60b663 commit 1f6c6ac

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
@@ -3329,6 +3329,13 @@ static void task_numa_work(struct callback_head *work)
33293329
if (p->flags & PF_EXITING)
33303330
return;
33313331

3332+
/*
3333+
* Memory is pinned to only one NUMA node via cpuset.mems, naturally
3334+
* no page can be migrated.
3335+
*/
3336+
if (cpusets_enabled() && nodes_weight(cpuset_current_mems_allowed) == 1)
3337+
return;
3338+
33323339
if (!mm->numa_next_scan) {
33333340
mm->numa_next_scan = now +
33343341
msecs_to_jiffies(sysctl_numa_balancing_scan_delay);

0 commit comments

Comments
 (0)