From: Minchan Kim Date: Wed, 3 May 2017 21:54:07 +0000 (-0700) Subject: mm: remove SWAP_MLOCK check for SWAP_SUCCESS in ttu X-Git-Tag: v4.12-rc1~107^2~52 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=22ffb33f4620b502799877d4186502bfe20621ea;p=karo-tx-linux.git mm: remove SWAP_MLOCK check for SWAP_SUCCESS in ttu If the page is mapped and rescue in try_to_unmap_one, the page_mapcount() of a page cannot be zero, so the page_mapcount check in try_to_unmap is enough to return SWAP_SUCCESS. IOW, SWAP_MLOCK check is redundant so remove it. Link: http://lkml.kernel.org/r/1489555493-14659-4-git-send-email-minchan@kernel.org Signed-off-by: Minchan Kim Cc: Anshuman Khandual Cc: Hillf Danton Cc: Johannes Weiner Cc: Kirill A. Shutemov Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/rmap.c b/mm/rmap.c index f6aa18d8a420..dfe40557ea29 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1535,7 +1535,7 @@ int try_to_unmap(struct page *page, enum ttu_flags flags) else ret = rmap_walk(page, &rwc); - if (ret != SWAP_MLOCK && !page_mapcount(page)) + if (!page_mapcount(page)) ret = SWAP_SUCCESS; return ret; }