[PATCH 0/6] sched/numa: Complete scanning of partial and inactive VMAs

From: Mel Gorman
Date: Tue Oct 10 2023 - 04:32:06 EST


NUMA Balancing currently uses PID fault activity within a VMA to
determine if it is worth updating PTEs to trap NUMA hinting faults.
While this is reduces overhead, it misses two important corner case.
The first is that if Task A partially scans a VMA that is active and
Task B resumes the scan but is inactive, then the remainder of the VMA
may be missed. Similarly, if a VMA is inactive for a period of time then
it may never be scanned again.

Patches 1-3 improve the documentation of the current per-VMA tracking
and adds a trace point for scan activity. Patch 4 addresses a corner
case where the PID activity information may not be reset after the
expected timeout. Patches 5-6 complete the scanning of partial and
inactive VMAs within the scan sequence.

This could be improved further but it would deserve a separate series on
top with supporting data justifying the change. Otherwise and gain/loss
due to the additional changes could be masked by this series on its own.

include/linux/mm.h | 4 +-
include/linux/mm_types.h | 36 +++++++++-
include/linux/sched/numa_balancing.h | 10 +++
include/trace/events/sched.h | 52 ++++++++++++++
kernel/sched/fair.c | 103 ++++++++++++++++++++++-----
5 files changed, 182 insertions(+), 23 deletions(-)

--
2.35.3