[RFC] mm:do recheck for freeable page in reclaim path

Wang, Yalin
2015-03-11T09:47:35Z

In reclaim path, if encounter a freeable page,
the try_to_unmap may fail, because the page's pte is
dirty, we can recheck this page as normal non-freeable page,
this means we can swap out this page into swap partition.

Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
---
mm/vmscan.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 260c413..9930850 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1000,6 +1000,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
}
}

+recheck:
if (!force_reclaim)
references = page_check_references(page, sc,
&freeable);
@@ -1045,6 +1046,10 @@ unmap:
switch (try_to_unmap(page,
freeable ? TTU_FREE : ttu_flags)) {
case SWAP_FAIL:
+ if (freeable) {
+ freeable = false;
+ goto recheck;
+ }
goto activate_locked;
case SWAP_AGAIN:
goto keep_locked;
--
2.2.2