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

Configure Feed

Select the types of activity you want to include in your feed.

mm: change to return bool for pmdp_clear_flush_young()

The pmdp_clear_flush_young() is used to clear the young flag and flush the
TLB, returning whether the young flag was set for this PMD entry. Change
the return type to bool to make the intention clearer.

Link: https://lkml.kernel.org/r/a668b9a974c0d675e7a41f6973bcbe3336e8b373.1774075004.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Baolin Wang and committed by
Andrew Morton
2d46a397 42e26354

+16 -15
+2 -2
arch/s390/include/asm/pgtable.h
··· 1693 1693 } 1694 1694 1695 1695 #define __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH 1696 - static inline int pmdp_clear_flush_young(struct vm_area_struct *vma, 1697 - unsigned long addr, pmd_t *pmdp) 1696 + static inline bool pmdp_clear_flush_young(struct vm_area_struct *vma, 1697 + unsigned long addr, pmd_t *pmdp) 1698 1698 { 1699 1699 VM_BUG_ON(addr & ~HPAGE_MASK); 1700 1700 return pmdp_test_and_clear_young(vma, addr, pmdp);
+2 -2
arch/x86/include/asm/pgtable.h
··· 1301 1301 unsigned long addr, pud_t *pudp); 1302 1302 1303 1303 #define __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH 1304 - extern int pmdp_clear_flush_young(struct vm_area_struct *vma, 1305 - unsigned long address, pmd_t *pmdp); 1304 + bool pmdp_clear_flush_young(struct vm_area_struct *vma, 1305 + unsigned long address, pmd_t *pmdp); 1306 1306 1307 1307 1308 1308 #define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
+3 -3
arch/x86/mm/pgtable.c
··· 503 503 } 504 504 505 505 #ifdef CONFIG_TRANSPARENT_HUGEPAGE 506 - int pmdp_clear_flush_young(struct vm_area_struct *vma, 507 - unsigned long address, pmd_t *pmdp) 506 + bool pmdp_clear_flush_young(struct vm_area_struct *vma, 507 + unsigned long address, pmd_t *pmdp) 508 508 { 509 - int young; 509 + bool young; 510 510 511 511 VM_BUG_ON(address & ~HPAGE_PMD_MASK); 512 512
+5 -5
include/linux/pgtable.h
··· 536 536 537 537 #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH 538 538 #ifdef CONFIG_TRANSPARENT_HUGEPAGE 539 - extern int pmdp_clear_flush_young(struct vm_area_struct *vma, 540 - unsigned long address, pmd_t *pmdp); 539 + bool pmdp_clear_flush_young(struct vm_area_struct *vma, 540 + unsigned long address, pmd_t *pmdp); 541 541 #else 542 542 /* 543 543 * Despite relevant to THP only, this API is called from generic rmap code 544 544 * under PageTransHuge(), hence needs a dummy implementation for !THP 545 545 */ 546 - static inline int pmdp_clear_flush_young(struct vm_area_struct *vma, 547 - unsigned long address, pmd_t *pmdp) 546 + static inline bool pmdp_clear_flush_young(struct vm_area_struct *vma, 547 + unsigned long address, pmd_t *pmdp) 548 548 { 549 549 BUILD_BUG(); 550 - return 0; 550 + return false; 551 551 } 552 552 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ 553 553 #endif
+4 -3
mm/pgtable-generic.c
··· 124 124 #endif 125 125 126 126 #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH 127 - int pmdp_clear_flush_young(struct vm_area_struct *vma, 128 - unsigned long address, pmd_t *pmdp) 127 + bool pmdp_clear_flush_young(struct vm_area_struct *vma, 128 + unsigned long address, pmd_t *pmdp) 129 129 { 130 - int young; 130 + bool young; 131 + 131 132 VM_BUG_ON(address & ~HPAGE_PMD_MASK); 132 133 young = pmdp_test_and_clear_young(vma, address, pmdp); 133 134 if (young)