Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1598804

[PATCH v1 03/10] mm: remove SWAP_MLOCK check for SWAP_SUCCESS in ttu

From Minchan Kim <minchan@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v1 03/10] mm: remove SWAP_MLOCK check for SWAP_SUCCESS in ttu
Date 2017-03-13 01:40 +0100
Message-ID <tkmbM-Hg-21@gated-at.bofh.it> (permalink)
References <tkmbL-Hg-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


If the page is mapped and rescue in try_to_unmap_one,
page_mapcount(page) == 0 cannot be true so page_mapcount check
in try_to_unmap is enough to return SWAP_SUCCESS.
IOW, SWAP_MLOCK check is redundant so remove it.

Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 mm/rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index d47af09..1cfb3a3 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1530,7 +1530,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;
 }
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v1 00/10] make try_to_unmap simple Minchan Kim <minchan@kernel.org> - 2017-03-13 01:40 +0100
  [PATCH v1 07/10] mm: make ttu's return boolean Minchan Kim <minchan@kernel.org> - 2017-03-13 01:40 +0100
  [PATCH v1 02/10] mm: remove SWAP_DIRTY in ttu Minchan Kim <minchan@kernel.org> - 2017-03-13 01:40 +0100
    Re: [PATCH v1 02/10] mm: remove SWAP_DIRTY in ttu "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-03-13 07:40 +0100
  [PATCH v1 01/10] mm: remove unncessary ret in page_referenced Minchan Kim <minchan@kernel.org> - 2017-03-13 01:40 +0100
    Re: [PATCH v1 01/10] mm: remove unncessary ret in page_referenced "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-03-13 07:30 +0100
  [PATCH v1 09/10] mm: make rmap_one boolean function Minchan Kim <minchan@kernel.org> - 2017-03-13 01:40 +0100
    Re: [PATCH v1 09/10] mm: make rmap_one boolean function Andrew Morton <akpm@linux-foundation.org> - 2017-03-13 20:50 +0100
  [PATCH v1 08/10] mm: make rmap_walk void function Minchan Kim <minchan@kernel.org> - 2017-03-13 01:40 +0100
  [PATCH v1 03/10] mm: remove SWAP_MLOCK check for SWAP_SUCCESS in ttu Minchan Kim <minchan@kernel.org> - 2017-03-13 01:40 +0100

csiph-web