Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm, thp: remove infrastructure for handling splitting PMDs

With new refcounting we don't need to mark PMDs splitting. Let's drop
code to handle this.

pmdp_splitting_flush() is not needed too: on splitting PMD we will do
pmdp_clear_flush() + set_pte_at(). pmdp_clear_flush() will do IPI as
needed for fast_gup.

[arnd@arndb.de: fix unterminated ifdef in header file]
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Jerome Marchand <jmarchan@redhat.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: Vlastimil Babka <vbabka@suse.cz>
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: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Kirill A. Shutemov and committed by
Linus Torvalds
0ebd7446 b7ed934a

+2 -27
-9
arch/arm/include/asm/pgtable-3level.h
··· 88 88 89 89 #define L_PMD_SECT_VALID (_AT(pmdval_t, 1) << 0) 90 90 #define L_PMD_SECT_DIRTY (_AT(pmdval_t, 1) << 55) 91 - #define L_PMD_SECT_SPLITTING (_AT(pmdval_t, 1) << 56) 92 91 #define L_PMD_SECT_NONE (_AT(pmdval_t, 1) << 57) 93 92 #define L_PMD_SECT_RDONLY (_AT(pteval_t, 1) << 58) 94 93 ··· 231 232 232 233 #ifdef CONFIG_TRANSPARENT_HUGEPAGE 233 234 #define pmd_trans_huge(pmd) (pmd_val(pmd) && !pmd_table(pmd)) 234 - #define pmd_trans_splitting(pmd) (pmd_isset((pmd), L_PMD_SECT_SPLITTING)) 235 - 236 - #ifdef CONFIG_HAVE_RCU_TABLE_FREE 237 - #define __HAVE_ARCH_PMDP_SPLITTING_FLUSH 238 - void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, 239 - pmd_t *pmdp); 240 - #endif 241 235 #endif 242 236 243 237 #define PMD_BIT_FUNC(fn,op) \ ··· 238 246 239 247 PMD_BIT_FUNC(wrprotect, |= L_PMD_SECT_RDONLY); 240 248 PMD_BIT_FUNC(mkold, &= ~PMD_SECT_AF); 241 - PMD_BIT_FUNC(mksplitting, |= L_PMD_SECT_SPLITTING); 242 249 PMD_BIT_FUNC(mkwrite, &= ~L_PMD_SECT_RDONLY); 243 250 PMD_BIT_FUNC(mkdirty, |= L_PMD_SECT_DIRTY); 244 251 PMD_BIT_FUNC(mkyoung, |= PMD_SECT_AF);
+2 -3
arch/arm/lib/uaccess_with_memcpy.c
··· 52 52 * 53 53 * Lock the page table for the destination and check 54 54 * to see that it's still huge and whether or not we will 55 - * need to fault on write, or if we have a splitting THP. 55 + * need to fault on write. 56 56 */ 57 57 if (unlikely(pmd_thp_or_huge(*pmd))) { 58 58 ptl = &current->mm->page_table_lock; 59 59 spin_lock(ptl); 60 60 if (unlikely(!pmd_thp_or_huge(*pmd) 61 - || pmd_hugewillfault(*pmd) 62 - || pmd_trans_splitting(*pmd))) { 61 + || pmd_hugewillfault(*pmd))) { 63 62 spin_unlock(ptl); 64 63 return 0; 65 64 }
-15
arch/arm/mm/flush.c
··· 415 415 */ 416 416 __cpuc_flush_dcache_area(page_address(page), PAGE_SIZE); 417 417 } 418 - 419 - #ifdef CONFIG_TRANSPARENT_HUGEPAGE 420 - #ifdef CONFIG_HAVE_RCU_TABLE_FREE 421 - void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, 422 - pmd_t *pmdp) 423 - { 424 - pmd_t pmd = pmd_mksplitting(*pmdp); 425 - VM_BUG_ON(address & ~PMD_MASK); 426 - set_pmd_at(vma->vm_mm, address, pmdp, pmd); 427 - 428 - /* dummy IPI to serialise against fast_gup */ 429 - kick_all_cpus_sync(); 430 - } 431 - #endif /* CONFIG_HAVE_RCU_TABLE_FREE */ 432 - #endif /* CONFIG_TRANSPARENT_HUGEPAGE */