Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1515906
| From | "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/2] mm: move vma_is_anonymous check within pmd_move_must_withdraw |
| Date | 2016-11-07 09:40 +0100 |
| Message-ID | <sANDc-tf-21@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Architectures like ppc64 want to use page table deposit/withraw
even with huge pmd dax entries. Allow arch to override the
vma_is_anonymous check by moving that to pmd_move_must_withdraw
function
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
include/asm-generic/pgtable.h | 12 ------------
mm/huge_memory.c | 17 +++++++++++++++--
2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index c4f8fd2fd384..324990273ad2 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -653,18 +653,6 @@ static inline pmd_t pmd_read_atomic(pmd_t *pmdp)
}
#endif
-#ifndef pmd_move_must_withdraw
-static inline int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
- spinlock_t *old_pmd_ptl)
-{
- /*
- * With split pmd lock we also need to move preallocated
- * PTE page table if new_pmd is on different PMD page table.
- */
- return new_pmd_ptl != old_pmd_ptl;
-}
-#endif
-
/*
* This function is meant to be used by sites walking pagetables with
* the mmap_sem hold in read mode to protect against MADV_DONTNEED and
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index cdcd25cb30fe..1ac1b0ca63c4 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1424,6 +1424,20 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
return 1;
}
+#ifndef pmd_move_must_withdraw
+static inline int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
+ spinlock_t *old_pmd_ptl)
+{
+ /*
+ * With split pmd lock we also need to move preallocated
+ * PTE page table if new_pmd is on different PMD page table.
+ *
+ * We also don't deposit and withdraw tables for file pages.
+ */
+ return (new_pmd_ptl != old_pmd_ptl) && vma_is_anonymous(vma);
+}
+#endif
+
bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr,
unsigned long new_addr, unsigned long old_end,
pmd_t *old_pmd, pmd_t *new_pmd)
@@ -1458,8 +1472,7 @@ bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr,
pmd = pmdp_huge_get_and_clear(mm, old_addr, old_pmd);
VM_BUG_ON(!pmd_none(*new_pmd));
- if (pmd_move_must_withdraw(new_ptl, old_ptl) &&
- vma_is_anonymous(vma)) {
+ if (pmd_move_must_withdraw(new_ptl, old_ptl)) {
pgtable_t pgtable;
pgtable = pgtable_trans_huge_withdraw(mm, old_pmd);
pgtable_trans_huge_deposit(mm, new_pmd, pgtable);
--
2.10.2
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 1/2] mm: move vma_is_anonymous check within pmd_move_must_withdraw "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> - 2016-11-07 09:40 +0100
[PATCH 2/2] mm: THP page cache support for ppc64 "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> - 2016-11-07 09:40 +0100
Re: [PATCH 2/2] mm: THP page cache support for ppc64 "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-11-11 11:20 +0100
Re: [PATCH 2/2] mm: THP page cache support for ppc64 "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> - 2016-11-11 13:20 +0100
Re: [PATCH 2/2] mm: THP page cache support for ppc64 "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-11-11 17:30 +0100
Re: [PATCH 1/2] mm: move vma_is_anonymous check within pmd_move_must_withdraw "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2016-11-07 10:20 +0100
Re: [PATCH 1/2] mm: move vma_is_anonymous check within pmd_move_must_withdraw kbuild test robot <lkp@intel.com> - 2016-11-07 10:30 +0100
Re: [PATCH 1/2] mm: move vma_is_anonymous check within pmd_move_must_withdraw "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> - 2016-11-07 12:50 +0100
[PATCH V2] mm: move vma_is_anonymous check within pmd_move_must_withdraw "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> - 2016-11-07 15:50 +0100
Re: [PATCH V2] mm: move vma_is_anonymous check within pmd_move_must_withdraw "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-11-11 11:10 +0100
csiph-web