Skip to content

Commit 1667918

Browse files
Mel Gormantorvalds
authored andcommitted
mm: numa: clear numa hinting information on mprotect
On a protection change it is no longer clear if the page should be still accessible. This patch clears the NUMA hinting fault bits on a protection change. Signed-off-by: Mel Gorman <mgorman@suse.de> Reviewed-by: Rik van Riel <riel@redhat.com> Cc: Alex Thorlton <athorlton@sgi.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3c67f47 commit 1667918

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

mm/huge_memory.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,8 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
15321532
ret = 1;
15331533
if (!prot_numa) {
15341534
entry = pmdp_get_and_clear(mm, addr, pmd);
1535+
if (pmd_numa(entry))
1536+
entry = pmd_mknonnuma(entry);
15351537
entry = pmd_modify(entry, newprot);
15361538
ret = HPAGE_PMD_NR;
15371539
BUG_ON(pmd_write(entry));

mm/mprotect.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
5454

5555
if (!prot_numa) {
5656
ptent = ptep_modify_prot_start(mm, addr, pte);
57+
if (pte_numa(ptent))
58+
ptent = pte_mknonnuma(ptent);
5759
ptent = pte_modify(ptent, newprot);
5860
updated = true;
5961
} else {

0 commit comments

Comments
 (0)