linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Huang Shijie <sjhuang@iluvatar.ai>
To: <akpm@linux-foundation.org>
Cc: <kirill.shutemov@linux.intel.com>, <mike.kravetz@oracle.com>,
	<linux-mm@kvack.org>, Huang Shijie <sjhuang@iluvatar.ai>
Subject: [PATCH] mm:rmap: use the pra.mapcount to do the check
Date: Thu, 4 Apr 2019 13:48:28 +0800	[thread overview]
Message-ID: <20190404054828.2731-1-sjhuang@iluvatar.ai> (raw)

We have the pra.mapcount already, and there is no need to call
the page_mapped() which may do some complicated computing
for compound page.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 mm/rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 76c8dfd3ae1c..6c5843dddb5a 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -850,7 +850,7 @@ int page_referenced(struct page *page,
 	};
 
 	*vm_flags = 0;
-	if (!page_mapped(page))
+	if (!pra.mapcount)
 		return 0;
 
 	if (!page_rmapping(page))
-- 
2.17.1


             reply	other threads:[~2019-04-04  5:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04  5:48 Huang Shijie [this message]
2019-04-04 23:08 ` [PATCH] mm:rmap: use the pra.mapcount to do the check Mike Kravetz
2019-04-05  0:09   ` Andrew Morton
2019-04-05 12:36   ` Kirill A. Shutemov

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=20190404054828.2731-1-sjhuang@iluvatar.ai \
    --to=sjhuang@iluvatar.ai \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    /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;
as well as URLs for NNTP newsgroup(s).