linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <shy828301@gmail.com>
To: cgel.zte@gmail.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux MM <linux-mm@kvack.org>,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.or>,
	xu xin <xu.xin16@zte.com.cn>
Subject: Re: [PATCH] mm/khugepaged: use vma_is_anonymous
Date: Mon, 25 Apr 2022 11:47:03 -0700	[thread overview]
Message-ID: <CAHbLzkqnxRxoX-3vb32dT4ELzeV69k2Hktqbyv1LP05AWgoc7w@mail.gmail.com> (raw)
In-Reply-To: <20220424071642.3234971-1-xu.xin16@zte.com.cn>

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
>
>


      reply	other threads:[~2022-04-25 18:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-24  7:16 cgel.zte
2022-04-25 18:47 ` Yang Shi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHbLzkqnxRxoX-3vb32dT4ELzeV69k2Hktqbyv1LP05AWgoc7w@mail.gmail.com \
    --to=shy828301@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgel.zte@gmail.com \
    --cc=linux-kernel@vger.kernel.or \
    --cc=linux-mm@kvack.org \
    --cc=xu.xin16@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox