Skip to content

Commit 2e2675d

Browse files
RaghavendraKT80ingomolnar
authored andcommitted
sched/numa: Move up the access pid reset logic
Recent NUMA hinting faulting activity is reset approximately every VMA_PID_RESET_PERIOD milliseconds. However, if the current task has not accessed a VMA then the reset check is missed and the reset is potentially deferred forever. Check if the PID activity information should be reset before checking if the current task recently trapped a NUMA hinting fault. [ mgorman@techsingularity.net: Rewrite changelog ] Suggested-by: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com> Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20231010083143.19593-5-mgorman@techsingularity.net
1 parent ed2da8b commit 2e2675d

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

kernel/sched/fair.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3260,16 +3260,7 @@ static void task_numa_work(struct callback_head *work)
32603260
continue;
32613261
}
32623262

3263-
/* Do not scan the VMA if task has not accessed */
3264-
if (!vma_is_accessed(vma)) {
3265-
trace_sched_skip_vma_numa(mm, vma, NUMAB_SKIP_PID_INACTIVE);
3266-
continue;
3267-
}
3268-
3269-
/*
3270-
* RESET access PIDs regularly for old VMAs. Resetting after checking
3271-
* vma for recent access to avoid clearing PID info before access..
3272-
*/
3263+
/* RESET access PIDs regularly for old VMAs. */
32733264
if (mm->numa_scan_seq &&
32743265
time_after(jiffies, vma->numab_state->pids_active_reset)) {
32753266
vma->numab_state->pids_active_reset = vma->numab_state->pids_active_reset +
@@ -3278,6 +3269,12 @@ static void task_numa_work(struct callback_head *work)
32783269
vma->numab_state->pids_active[1] = 0;
32793270
}
32803271

3272+
/* Do not scan the VMA if task has not accessed */
3273+
if (!vma_is_accessed(vma)) {
3274+
trace_sched_skip_vma_numa(mm, vma, NUMAB_SKIP_PID_INACTIVE);
3275+
continue;
3276+
}
3277+
32813278
do {
32823279
start = max(start, vma->vm_start);
32833280
end = ALIGN(start + (pages << PAGE_SHIFT), HPAGE_SIZE);

0 commit comments

Comments
 (0)