diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2013-06-05 20:14:04 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-06-20 02:55:07 -0400 |
commit | a6bf2bb03e5bad7e9289d80ecb5faac11630c7ab (patch) | |
tree | 48cd9fb8de2bc5e0fe66e7e67205efe8ab47d78e | |
parent | 6b0b50b0617fad5f2af3b928596a25f7de8dbf50 (diff) |
mm/THP: withdraw the pgtable after pmdp related operations
For architectures like ppc64 we look at deposited pgtable when calling
pmdp_get_and_clear. So do the pgtable_trans_huge_withdraw after finishing
pmdp related operations.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | mm/huge_memory.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 6b785e17b679..5c4fac2d239e 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -1360,9 +1360,15 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, | |||
1360 | struct page *page; | 1360 | struct page *page; |
1361 | pgtable_t pgtable; | 1361 | pgtable_t pgtable; |
1362 | pmd_t orig_pmd; | 1362 | pmd_t orig_pmd; |
1363 | pgtable = pgtable_trans_huge_withdraw(tlb->mm, pmd); | 1363 | /* |
1364 | * For architectures like ppc64 we look at deposited pgtable | ||
1365 | * when calling pmdp_get_and_clear. So do the | ||
1366 | * pgtable_trans_huge_withdraw after finishing pmdp related | ||
1367 | * operations. | ||
1368 | */ | ||
1364 | orig_pmd = pmdp_get_and_clear(tlb->mm, addr, pmd); | 1369 | orig_pmd = pmdp_get_and_clear(tlb->mm, addr, pmd); |
1365 | tlb_remove_pmd_tlb_entry(tlb, pmd, addr); | 1370 | tlb_remove_pmd_tlb_entry(tlb, pmd, addr); |
1371 | pgtable = pgtable_trans_huge_withdraw(tlb->mm, pmd); | ||
1366 | if (is_huge_zero_pmd(orig_pmd)) { | 1372 | if (is_huge_zero_pmd(orig_pmd)) { |
1367 | tlb->mm->nr_ptes--; | 1373 | tlb->mm->nr_ptes--; |
1368 | spin_unlock(&tlb->mm->page_table_lock); | 1374 | spin_unlock(&tlb->mm->page_table_lock); |