mm: numa: do not clear PTE for pte_numa update
authorMel Gorman <mgorman@suse.de>
Tue, 7 Jan 2014 14:00:40 +0000 (14:00 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2014 20:25:13 +0000 (12:25 -0800)
commita1dc162e3f7f0c34d66981ffbcc83a2d78bc49b9
treea91639ccbe25a1f8e6f40e4b9e2c34ecb4c7bd2c
parentc18e3316d198f4ffcf2129fb8f03940a1f9616bc
mm: numa: do not clear PTE for pte_numa update

commit 0c5f83c23ca703d32f930393825487257a5cde6d upstream.

The TLB must be flushed if the PTE is updated but change_pte_range is
clearing the PTE while marking PTEs pte_numa without necessarily
flushing the TLB if it reinserts the same entry.  Without the flush,
it's conceivable that two processors have different TLBs for the same
virtual address and at the very least it would generate spurious faults.

This patch only unmaps the pages in change_pte_range for a full
protection change.

[riel@redhat.com: write pte_numa pte back to the page tables]
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.com>
Cc: Chegu Vinod <chegu_vinod@hp.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>
mm/mprotect.c