From 059d8442ea77dd995c7ec075c6a6cca527b1c244 Mon Sep 17 00:00:00 2001 From: Huang Shijie Date: Mon, 13 May 2019 17:21:07 -0700 Subject: mm/rmap.c: use the pra.mapcount to do the check 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. Link: http://lkml.kernel.org/r/20190404054828.2731-1-sjhuang@iluvatar.ai Signed-off-by: Huang Shijie Acked-by: Kirill A. Shutemov Cc: Mike Kravetz Cc: Rik van Riel Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/rmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/rmap.c b/mm/rmap.c index 0cbed70700ed..e5dfe2ae6b0d 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)) -- cgit v1.2.3