diff options
author | Mel Gorman <mgorman@suse.de> | 2013-12-18 17:08:34 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-09 12:24:23 -0800 |
commit | 0b92137e5f67921fef752f55af7efe35a15d2923 (patch) | |
tree | ffa110c202ccf7cda295de13aa5dd27c6c00d670 /mm | |
parent | 4fc7e47022c61f605101c99e99b2518c3c3df2f8 (diff) | |
download | linux-3.10-0b92137e5f67921fef752f55af7efe35a15d2923.tar.gz linux-3.10-0b92137e5f67921fef752f55af7efe35a15d2923.tar.bz2 linux-3.10-0b92137e5f67921fef752f55af7efe35a15d2923.zip |
mm: clear pmd_numa before invalidating
commit 67f87463d3a3362424efcbe8b40e4772fd34fc61 upstream.
On x86, PMD entries are similar to _PAGE_PROTNONE protection and are
handled as NUMA hinting faults. The following two page table protection
bits are what defines them
_PAGE_NUMA:set _PAGE_PRESENT:clear
A PMD is considered present if any of the _PAGE_PRESENT, _PAGE_PROTNONE,
_PAGE_PSE or _PAGE_NUMA bits are set. If pmdp_invalidate encounters a
pmd_numa, it clears the present bit leaving _PAGE_NUMA which will be
considered not present by the CPU but present by pmd_present. The
existing caller of pmdp_invalidate should handle it but it's an
inconsistent state for a PMD. This patch keeps the state consistent
when calling pmdp_invalidate.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/pgtable-generic.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 0c8323fe6c8..eb900bbaa71 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c @@ -166,6 +166,9 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm) void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) { + pmd_t entry = *pmdp; + if (pmd_numa(entry)) + entry = pmd_mknonnuma(entry); set_pmd_at(vma->vm_mm, address, pmdp, pmd_mknotpresent(*pmdp)); flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); } |