diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 0af2be3ee849..5eb4807bad20 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3213,6 +3213,15 @@ static bool vma_is_accessed(struct mm_struct *mm, struct vm_area_struct *vma) return true; } + /* + * This vma has not been accessed for a while, and if the number + * the threads in the same process is low, which means no other + * threads can help scan this vma, force a vma scan. + */ + if (READ_ONCE(mm->numa_scan_seq) > + (vma->numab_state->prev_scan_seq + get_nr_threads(current))) + return true; + return false; }