linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: cgel.zte@gmail.com
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.or,
	xu xin <xu.xin16@zte.com.cn>
Subject: [PATCH] mm/khugepaged: use vma_is_anonymous
Date: Sun, 24 Apr 2022 07:16:42 +0000	[thread overview]
Message-ID: <20220424071642.3234971-1-xu.xin16@zte.com.cn> (raw)

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



             reply	other threads:[~2022-04-24  7:16 UTC|newest]

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

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=20220424071642.3234971-1-xu.xin16@zte.com.cn \
    --to=cgel.zte@gmail.com \
    --cc=akpm@linux-foundation.org \
    --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