diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e08d757720dec4a5615739f71e45421008f2de94..c6c330245f7ff0bfdcddfdc8ff8c0ddee686e40a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1038,6 +1038,18 @@ void task_numa_work(struct callback_head *work) } out: + /* + * If the whole process was scanned without updates then no NUMA + * hinting faults are being recorded and scan rate should be lower. + */ + if (mm->numa_scan_offset == 0 && !nr_pte_updates) { + p->numa_scan_period = min(p->numa_scan_period_max, + p->numa_scan_period << 1); + + next_scan = now + msecs_to_jiffies(p->numa_scan_period); + mm->numa_next_scan = next_scan; + } + /* * It is possible to reach the end of the VMA list but the last few * VMAs are not guaranteed to the vma_migratable. If they are not, we