* [PATCH] mm/khugepaged: use vma_is_anonymous
@ 2022-04-24 7:16 cgel.zte
2022-04-25 18:47 ` Yang Shi
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-24 7:16 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, xu xin
From: xu xin <xu.xin16@zte.com.cn>
Cleanup the vma->vm_ops usage. Use vma_is_anonymous instead of
vma->vm_ops to make it more understandable.
Signed-off-by: xu xin <xu.xin16@zte.com.cn>
---
mm/khugepaged.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index cb43c3aee8b2..ba8dbd1825da 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -466,7 +466,7 @@ static bool hugepage_vma_check(struct vm_area_struct *vma,
if (file_thp_enabled(vma))
return true;
- if (!vma->anon_vma || vma->vm_ops)
+ if (!vma->anon_vma || !vma_is_anonymous(vma))
return false;
if (vma_is_temporary_stack(vma))
return false;
@@ -982,7 +982,7 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address,
if (!hugepage_vma_check(vma, vma->vm_flags))
return SCAN_VMA_CHECK;
/* Anon VMA expected */
- if (!vma->anon_vma || vma->vm_ops)
+ if (!vma->anon_vma || !vma_is_anonymous(vma))
return SCAN_VMA_CHECK;
return 0;
}
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mm/khugepaged: use vma_is_anonymous
2022-04-24 7:16 [PATCH] mm/khugepaged: use vma_is_anonymous cgel.zte
@ 2022-04-25 18:47 ` Yang Shi
0 siblings, 0 replies; 2+ messages in thread
From: Yang Shi @ 2022-04-25 18:47 UTC (permalink / raw)
To: cgel.zte; +Cc: Andrew Morton, Linux MM, Linux Kernel Mailing List, xu xin
On Sun, Apr 24, 2022 at 12:16 AM <cgel.zte@gmail.com> wrote:
>
> From: xu xin <xu.xin16@zte.com.cn>
>
> Cleanup the vma->vm_ops usage. Use vma_is_anonymous instead of
> vma->vm_ops to make it more understandable.
Fine to me. Reviewed-by: Yang Shi <shy828301@gmail.com>
>
> Signed-off-by: xu xin <xu.xin16@zte.com.cn>
> ---
> mm/khugepaged.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index cb43c3aee8b2..ba8dbd1825da 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -466,7 +466,7 @@ static bool hugepage_vma_check(struct vm_area_struct *vma,
> if (file_thp_enabled(vma))
> return true;
>
> - if (!vma->anon_vma || vma->vm_ops)
> + if (!vma->anon_vma || !vma_is_anonymous(vma))
> return false;
> if (vma_is_temporary_stack(vma))
> return false;
> @@ -982,7 +982,7 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address,
> if (!hugepage_vma_check(vma, vma->vm_flags))
> return SCAN_VMA_CHECK;
> /* Anon VMA expected */
> - if (!vma->anon_vma || vma->vm_ops)
> + if (!vma->anon_vma || !vma_is_anonymous(vma))
> return SCAN_VMA_CHECK;
> return 0;
> }
> --
> 2.25.1
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-25 18:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24 7:16 [PATCH] mm/khugepaged: use vma_is_anonymous cgel.zte
2022-04-25 18:47 ` Yang Shi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox