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

From: Wang, Yalin
Date: Wed Mar 11 2015 - 05:47:38 EST


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@xxxxxxxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/