]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
x86, thp: remove infrastructure for handling splitting PMDs
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Sat, 16 Jan 2016 00:53:35 +0000 (16:53 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 16 Jan 2016 01:56:32 +0000 (17:56 -0800)
With new refcounting we don't need to mark PMDs splitting.  Let's drop
code to handle this.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Tested-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Steve Capper <steve.capper@linaro.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/include/asm/pgtable.h
arch/x86/include/asm/pgtable_types.h
arch/x86/mm/gup.c
arch/x86/mm/pgtable.c

index d3eee663c41fccdf031e0f72f9847b6a26f493cf..61e706c9f7100a5e51d5c5ca000657281f138e5a 100644 (file)
@@ -162,11 +162,6 @@ static inline int pmd_large(pmd_t pte)
 }
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-static inline int pmd_trans_splitting(pmd_t pmd)
-{
-       return pmd_val(pmd) & _PAGE_SPLITTING;
-}
-
 static inline int pmd_trans_huge(pmd_t pmd)
 {
        return pmd_val(pmd) & _PAGE_PSE;
@@ -808,10 +803,6 @@ extern int pmdp_clear_flush_young(struct vm_area_struct *vma,
                                  unsigned long address, pmd_t *pmdp);
 
 
-#define __HAVE_ARCH_PMDP_SPLITTING_FLUSH
-extern void pmdp_splitting_flush(struct vm_area_struct *vma,
-                                unsigned long addr, pmd_t *pmdp);
-
 #define __HAVE_ARCH_PMD_WRITE
 static inline int pmd_write(pmd_t pmd)
 {
index a471cadb9630e7b8f46340139efaf4f467a24aff..d1b76f88ccd1ef81af5fcec69793c7bdd3592c08 100644 (file)
@@ -22,7 +22,6 @@
 #define _PAGE_BIT_PAT_LARGE    12      /* On 2MB or 1GB pages */
 #define _PAGE_BIT_SPECIAL      _PAGE_BIT_SOFTW1
 #define _PAGE_BIT_CPA_TEST     _PAGE_BIT_SOFTW1
-#define _PAGE_BIT_SPLITTING    _PAGE_BIT_SOFTW2 /* only valid on a PSE pmd */
 #define _PAGE_BIT_HIDDEN       _PAGE_BIT_SOFTW3 /* hidden by kmemcheck */
 #define _PAGE_BIT_SOFT_DIRTY   _PAGE_BIT_SOFTW3 /* software dirty tracking */
 #define _PAGE_BIT_NX           63       /* No execute: only valid after cpuid check */
@@ -46,7 +45,6 @@
 #define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE)
 #define _PAGE_SPECIAL  (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL)
 #define _PAGE_CPA_TEST (_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST)
-#define _PAGE_SPLITTING        (_AT(pteval_t, 1) << _PAGE_BIT_SPLITTING)
 #define __HAVE_ARCH_PTE_SPECIAL
 
 #ifdef CONFIG_KMEMCHECK
index 65b0261d4bf3d0647d9946f0ee30545859352e32..f8cb3e8ac250ecc8ae288ec0135f5689ca7cc0b9 100644 (file)
@@ -156,18 +156,7 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
                pmd_t pmd = *pmdp;
 
                next = pmd_addr_end(addr, end);
-               /*
-                * The pmd_trans_splitting() check below explains why
-                * pmdp_splitting_flush has to flush the tlb, to stop
-                * this gup-fast code from running while we set the
-                * splitting bit in the pmd. Returning zero will take
-                * the slow path that will call wait_split_huge_page()
-                * if the pmd is still in splitting state. gup-fast
-                * can't because it has irq disabled and
-                * wait_split_huge_page() would never return as the
-                * tlb flush IPI wouldn't run.
-                */
-               if (pmd_none(pmd) || pmd_trans_splitting(pmd))
+               if (pmd_none(pmd))
                        return 0;
                if (unlikely(pmd_large(pmd) || !pmd_present(pmd))) {
                        /*
index ee9c2e3a71999e547996e94a209954d8cc58c445..4eb287e25043ed17639832a1d6b3f71b528ab69e 100644 (file)
@@ -505,19 +505,6 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma,
 
        return young;
 }
-
-void pmdp_splitting_flush(struct vm_area_struct *vma,
-                         unsigned long address, pmd_t *pmdp)
-{
-       int set;
-       VM_BUG_ON(address & ~HPAGE_PMD_MASK);
-       set = !test_and_set_bit(_PAGE_BIT_SPLITTING,
-                               (unsigned long *)pmdp);
-       if (set) {
-               /* need tlb flush only to serialize against gup-fast */
-               flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
-       }
-}
 #endif
 
 /**