From: Huang Shijie Date: Tue, 14 May 2019 00:21:07 +0000 (-0700) Subject: mm/rmap.c: use the pra.mapcount to do the check X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=059d8442ea77dd995c7ec075c6a6cca527b1c244;p=linux.git 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 --- diff --git a/mm/rmap.c b/mm/rmap.c index 0cbed70700ed3..e5dfe2ae6b0d5 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))