Linux-mm Archive on lore.kernel.org
 help / color / 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
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 index

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 ` Mike Kravetz
2019-04-05  0:09   ` Andrew Morton
2019-04-05 12:36   ` Kirill A. Shutemov

Reply instructions:

You may reply publically 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

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git