Skip to content

Commit d59dc7b

Browse files
Rik van RielIngo Molnar
authored andcommitted
sched/numa, mm: Revert to checking pmd/pte_write instead of VMA flags
Commit: 4d94246 ("mm: convert p[te|md]_mknonnuma and remaining page table manipulations") changed NUMA balancing from _PAGE_NUMA to using PROT_NONE, and was quickly found to introduce a regression with NUMA grouping. It was followed up by these commits: 53da3bc ("mm: fix up numa read-only thread grouping logic") bea66fb ("mm: numa: group related processes based on VMA flags instead of page table flags") b191f9b ("mm: numa: preserve PTE write permissions across a NUMA hinting fault") The first of those two commits try alternate approaches to NUMA grouping, which apparently do not work as well as looking at the PTE write permissions. The latter patch preserves the PTE write permissions across a NUMA protection fault. However, it forgets to revert the condition for whether or not to group tasks together back to what it was before v3.19, even though the information is now preserved in the page tables once again. This patch brings the NUMA grouping heuristic back to what it was before commit 4d94246, which the changelogs of subsequent commits suggest worked best. We have all the information again. We should probably use it. Signed-off-by: Rik van Riel <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent b95202a commit d59dc7b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mm/huge_memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ int do_huge_pmd_numa_page(struct fault_env *fe, pmd_t pmd)
11681168
}
11691169

11701170
/* See similar comment in do_numa_page for explanation */
1171-
if (!(vma->vm_flags & VM_WRITE))
1171+
if (!pmd_write(pmd))
11721172
flags |= TNF_NO_GROUP;
11731173

11741174
/*

mm/memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3398,7 +3398,7 @@ static int do_numa_page(struct fault_env *fe, pte_t pte)
33983398
* pte_dirty has unpredictable behaviour between PTE scan updates,
33993399
* background writeback, dirty balancing and application behaviour.
34003400
*/
3401-
if (!(vma->vm_flags & VM_WRITE))
3401+
if (!pte_write(pte))
34023402
flags |= TNF_NO_GROUP;
34033403

34043404
/*

0 commit comments

Comments
 (0)