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 pudp_test_and_clear_young()

The pudp_test_and_clear_young() is used to clear the young flag, returning
whether the young flag was set for this PUD entry. Change the return type
to bool to make the intention clearer.

Link: https://lkml.kernel.org/r/2c56fe52c1bf9404145274d7e91d4a65060f6c7c.1774075004.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.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: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Baolin Wang and committed by
Andrew Morton
fb87c882 2d46a397

+14 -14
+5 -5
arch/powerpc/include/asm/book3s/64/pgtable.h
··· 1172 1172 return ((old & _PAGE_ACCESSED) != 0); 1173 1173 } 1174 1174 1175 - static inline int __pudp_test_and_clear_young(struct mm_struct *mm, 1176 - unsigned long addr, pud_t *pudp) 1175 + static inline bool __pudp_test_and_clear_young(struct mm_struct *mm, 1176 + unsigned long addr, pud_t *pudp) 1177 1177 { 1178 1178 unsigned long old; 1179 1179 1180 1180 if ((pud_raw(*pudp) & cpu_to_be64(_PAGE_ACCESSED | H_PAGE_HASHPTE)) == 0) 1181 - return 0; 1181 + return false; 1182 1182 old = pud_hugepage_update(mm, addr, pudp, _PAGE_ACCESSED, 0); 1183 1183 return ((old & _PAGE_ACCESSED) != 0); 1184 1184 } ··· 1303 1303 bool pmdp_test_and_clear_young(struct vm_area_struct *vma, 1304 1304 unsigned long address, pmd_t *pmdp); 1305 1305 #define __HAVE_ARCH_PUDP_TEST_AND_CLEAR_YOUNG 1306 - extern int pudp_test_and_clear_young(struct vm_area_struct *vma, 1307 - unsigned long address, pud_t *pudp); 1306 + bool pudp_test_and_clear_young(struct vm_area_struct *vma, 1307 + unsigned long address, pud_t *pudp); 1308 1308 1309 1309 1310 1310 #define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
+2 -2
arch/powerpc/mm/book3s64/pgtable.c
··· 104 104 return __pmdp_test_and_clear_young(vma->vm_mm, address, pmdp); 105 105 } 106 106 107 - int pudp_test_and_clear_young(struct vm_area_struct *vma, 108 - unsigned long address, pud_t *pudp) 107 + bool pudp_test_and_clear_young(struct vm_area_struct *vma, 108 + unsigned long address, pud_t *pudp) 109 109 { 110 110 return __pudp_test_and_clear_young(vma->vm_mm, address, pudp); 111 111 }
+2 -2
arch/riscv/include/asm/pgtable.h
··· 1109 1109 return ptep_set_access_flags(vma, address, (pte_t *)pudp, pud_pte(entry), dirty); 1110 1110 } 1111 1111 1112 - static inline int pudp_test_and_clear_young(struct vm_area_struct *vma, 1113 - unsigned long address, pud_t *pudp) 1112 + static inline bool pudp_test_and_clear_young(struct vm_area_struct *vma, 1113 + unsigned long address, pud_t *pudp) 1114 1114 { 1115 1115 return ptep_test_and_clear_young(vma, address, (pte_t *)pudp); 1116 1116 }
+2 -2
arch/x86/include/asm/pgtable.h
··· 1297 1297 #define __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG 1298 1298 bool pmdp_test_and_clear_young(struct vm_area_struct *vma, 1299 1299 unsigned long addr, pmd_t *pmdp); 1300 - extern int pudp_test_and_clear_young(struct vm_area_struct *vma, 1301 - unsigned long addr, pud_t *pudp); 1300 + bool pudp_test_and_clear_young(struct vm_area_struct *vma, 1301 + unsigned long addr, pud_t *pudp); 1302 1302 1303 1303 #define __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH 1304 1304 bool pmdp_clear_flush_young(struct vm_area_struct *vma,
+3 -3
arch/x86/mm/pgtable.c
··· 470 470 #endif 471 471 472 472 #ifdef CONFIG_TRANSPARENT_HUGEPAGE 473 - int pudp_test_and_clear_young(struct vm_area_struct *vma, 474 - unsigned long addr, pud_t *pudp) 473 + bool pudp_test_and_clear_young(struct vm_area_struct *vma, 474 + unsigned long addr, pud_t *pudp) 475 475 { 476 - int ret = 0; 476 + bool ret = false; 477 477 478 478 if (pud_young(*pudp)) 479 479 ret = test_and_clear_bit(_PAGE_BIT_ACCESSED,