The patch titled Subject: mm: forcibly swapout when we are out of page cache has been added to the -mm tree. Its filename is mm-forcibly-swapout-when-we-are-out-of-page-cache.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Minchan Kim <minchan@xxxxxxxxxx> Subject: mm: forcibly swapout when we are out of page cache If laptop_mode is enable the VM tries to avoid I/O for saving power. But if there isn't reclaimable memory without I/O, we should do I/O to prevent an unnecessary OOM kill, although we sacrifice some power. One example is when we are out of page cache. Remaining memory is only anonymous pages, for swapping out, we needs may_writepage = 1. Signed-off-by: Minchan Kim <minchan@xxxxxxxxxx> Reported-by: Luigi Semenzato <semenzato@xxxxxxxxxx> Cc: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx> Cc: Sonny Rao <sonnyrao@xxxxxxxxxx> Cc: Bryan Freed <bfreed@xxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Rik van Riel <riel@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Mel Gorman <mel@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmscan.c | 6 ++++++ 1 file changed, 6 insertions(+) diff -puN mm/vmscan.c~mm-forcibly-swapout-when-we-are-out-of-page-cache mm/vmscan.c --- a/mm/vmscan.c~mm-forcibly-swapout-when-we-are-out-of-page-cache +++ a/mm/vmscan.c @@ -1728,6 +1728,12 @@ static void get_scan_count(struct lruvec free = zone_page_state(zone, NR_FREE_PAGES); if (unlikely(file + free <= high_wmark_pages(zone))) { scan_balance = SCAN_ANON; + /* + * From now on, we have to swap out + * for peventing OOM kill although + * we sacrifice power consumption. + */ + sc->may_writepage = 1; goto out; } } _ Patches currently in -mm which might be from minchan@xxxxxxxxxx are origin.patch mm-compaction-fix-echo-1-compact_memory-return-error-issue.patch mm-compaction-make-__compact_pgdat-and-compact_pgdat-return-void.patch mm-prevent-addition-of-pages-to-swap-if-may_writepage-is-unset.patch mm-forcibly-swapout-when-we-are-out-of-page-cache.patch mm-forcibly-swapout-when-we-are-out-of-page-cache-fix.patch mm-add-vm-event-counters-for-balloon-pages-compaction.patch block-aio-batch-completion-for-bios-kiocbs-fix-fix-fix-fix-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html