]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: numa: clear numa hinting information on mprotect
authorMel Gorman <mgorman@suse.de>
Mon, 16 Dec 2013 23:44:45 +0000 (10:44 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 16 Dec 2013 23:44:45 +0000 (10:44 +1100)
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>
mm/huge_memory.c
mm/mprotect.c

index dbafffa5e2eeb3b0fdc65cce4f810398fa79de88..70e7429fd8ea81eca9c9eab3c1277f69ee0c7cbe 100644 (file)
@@ -1532,6 +1532,8 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
                ret = 1;
                if (!prot_numa) {
                        entry = pmdp_get_and_clear(mm, addr, pmd);
+                       if (pmd_numa(entry))
+                               entry = pmd_mknonnuma(entry);
                        entry = pmd_modify(entry, newprot);
                        ret = HPAGE_PMD_NR;
                        BUG_ON(pmd_write(entry));
index 0a07e2dd0a4bcf52247cc29f0d5586c968c82388..eb2f3495b003f31b6bb01859c67fcdf5a3556163 100644 (file)
@@ -54,6 +54,8 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
 
                        if (!prot_numa) {
                                ptent = ptep_modify_prot_start(mm, addr, pte);
+                               if (pte_numa(ptent))
+                                       ptent = pte_mknonnuma(ptent);
                                ptent = pte_modify(ptent, newprot);
                                updated = true;
                        } else {