mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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>
This commit is contained in:
parent
2d46a39747
commit
fb87c88272
|
|
@ -1172,13 +1172,13 @@ static inline bool __pmdp_test_and_clear_young(struct mm_struct *mm,
|
|||
return ((old & _PAGE_ACCESSED) != 0);
|
||||
}
|
||||
|
||||
static inline int __pudp_test_and_clear_young(struct mm_struct *mm,
|
||||
unsigned long addr, pud_t *pudp)
|
||||
static inline bool __pudp_test_and_clear_young(struct mm_struct *mm,
|
||||
unsigned long addr, pud_t *pudp)
|
||||
{
|
||||
unsigned long old;
|
||||
|
||||
if ((pud_raw(*pudp) & cpu_to_be64(_PAGE_ACCESSED | H_PAGE_HASHPTE)) == 0)
|
||||
return 0;
|
||||
return false;
|
||||
old = pud_hugepage_update(mm, addr, pudp, _PAGE_ACCESSED, 0);
|
||||
return ((old & _PAGE_ACCESSED) != 0);
|
||||
}
|
||||
|
|
@ -1303,8 +1303,8 @@ extern int pudp_set_access_flags(struct vm_area_struct *vma,
|
|||
bool pmdp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long address, pmd_t *pmdp);
|
||||
#define __HAVE_ARCH_PUDP_TEST_AND_CLEAR_YOUNG
|
||||
extern int pudp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long address, pud_t *pudp);
|
||||
bool pudp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long address, pud_t *pudp);
|
||||
|
||||
|
||||
#define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
|
||||
|
|
|
|||
|
|
@ -104,8 +104,8 @@ bool pmdp_test_and_clear_young(struct vm_area_struct *vma,
|
|||
return __pmdp_test_and_clear_young(vma->vm_mm, address, pmdp);
|
||||
}
|
||||
|
||||
int pudp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long address, pud_t *pudp)
|
||||
bool pudp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long address, pud_t *pudp)
|
||||
{
|
||||
return __pudp_test_and_clear_young(vma->vm_mm, address, pudp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1109,8 +1109,8 @@ static inline int pudp_set_access_flags(struct vm_area_struct *vma,
|
|||
return ptep_set_access_flags(vma, address, (pte_t *)pudp, pud_pte(entry), dirty);
|
||||
}
|
||||
|
||||
static inline int pudp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long address, pud_t *pudp)
|
||||
static inline bool pudp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long address, pud_t *pudp)
|
||||
{
|
||||
return ptep_test_and_clear_young(vma, address, (pte_t *)pudp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1297,8 +1297,8 @@ extern int pudp_set_access_flags(struct vm_area_struct *vma,
|
|||
#define __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG
|
||||
bool pmdp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long addr, pmd_t *pmdp);
|
||||
extern int pudp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long addr, pud_t *pudp);
|
||||
bool pudp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long addr, pud_t *pudp);
|
||||
|
||||
#define __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH
|
||||
bool pmdp_clear_flush_young(struct vm_area_struct *vma,
|
||||
|
|
|
|||
|
|
@ -470,10 +470,10 @@ bool pmdp_test_and_clear_young(struct vm_area_struct *vma,
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||
int pudp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long addr, pud_t *pudp)
|
||||
bool pudp_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long addr, pud_t *pudp)
|
||||
{
|
||||
int ret = 0;
|
||||
bool ret = false;
|
||||
|
||||
if (pud_young(*pudp))
|
||||
ret = test_and_clear_bit(_PAGE_BIT_ACCESSED,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user