diff options
author | Mel Gorman <mgorman@suse.de> | 2015-03-07 10:20:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-03-12 17:07:41 -0400 |
commit | ba68bc0115ebfc37f911db4e87bf5f7991f89698 (patch) | |
tree | 4d4806b791a737f9b54ff691f7092f683831d70e /mm | |
parent | 09d35919b06e8508b51ee8a643a67b56f7bea0dd (diff) |
mm: thp: Return the correct value for change_huge_pmd
The wrong value is being returned by change_huge_pmd since commit
10c1045f28e8 ("mm: numa: avoid unnecessary TLB flushes when setting
NUMA hinting entries") which allows a fallthrough that tries to adjust
non-existent PTEs. This patch corrects it.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/huge_memory.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 89b9075f8c11..626e93db28ba 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -1487,6 +1487,7 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | |||
1487 | 1487 | ||
1488 | if (__pmd_trans_huge_lock(pmd, vma, &ptl) == 1) { | 1488 | if (__pmd_trans_huge_lock(pmd, vma, &ptl) == 1) { |
1489 | pmd_t entry; | 1489 | pmd_t entry; |
1490 | ret = 1; | ||
1490 | 1491 | ||
1491 | /* | 1492 | /* |
1492 | * Avoid trapping faults against the zero page. The read-only | 1493 | * Avoid trapping faults against the zero page. The read-only |
@@ -1495,11 +1496,10 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | |||
1495 | */ | 1496 | */ |
1496 | if (prot_numa && is_huge_zero_pmd(*pmd)) { | 1497 | if (prot_numa && is_huge_zero_pmd(*pmd)) { |
1497 | spin_unlock(ptl); | 1498 | spin_unlock(ptl); |
1498 | return 0; | 1499 | return ret; |
1499 | } | 1500 | } |
1500 | 1501 | ||
1501 | if (!prot_numa || !pmd_protnone(*pmd)) { | 1502 | if (!prot_numa || !pmd_protnone(*pmd)) { |
1502 | ret = 1; | ||
1503 | entry = pmdp_get_and_clear_notify(mm, addr, pmd); | 1503 | entry = pmdp_get_and_clear_notify(mm, addr, pmd); |
1504 | entry = pmd_modify(entry, newprot); | 1504 | entry = pmd_modify(entry, newprot); |
1505 | ret = HPAGE_PMD_NR; | 1505 | ret = HPAGE_PMD_NR; |