mm/rmap.c: use the pra.mapcount to do the check
authorHuang Shijie <sjhuang@iluvatar.ai>
Tue, 14 May 2019 00:21:07 +0000 (17:21 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 May 2019 16:47:49 +0000 (09:47 -0700)
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>
mm/rmap.c

index 0cbed70700ed333dbac1493684a928268dbee1d1..e5dfe2ae6b0d5dfc4a0b38c58c8e2c762b0b7696 100644 (file)
--- 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))