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 <sjhuang@iluvatar.ai>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Huang Shijie 2019-05-13 17:21:07 -07:00 committed by Linus Torvalds
parent cfcbfb1382
commit 059d8442ea
1 changed files with 1 additions and 1 deletions

View File

@ -850,7 +850,7 @@ int page_referenced(struct page *page,
}; };
*vm_flags = 0; *vm_flags = 0;
if (!page_mapped(page)) if (!pra.mapcount)
return 0; return 0;
if (!page_rmapping(page)) if (!page_rmapping(page))