The patch titled Subject: mm: vmscan: do not OOM if aborting reclaim to start compaction has been removed from the -mm tree. Its filename was mm-vmscan-do-not-oom-if-aborting-reclaim-to-start-compaction.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ From: Mel Gorman <mgorman@xxxxxxx> Subject: mm: vmscan: do not OOM if aborting reclaim to start compaction During direct reclaim it is possible that reclaim will be aborted so that compaction can be attempted to satisfy a high-order allocation. If this decision is made before any pages are reclaimed, it is possible that 0 is returned to the page allocator potentially triggering an OOM. This has not been observed but it is a possibility so this patch addresses it. Signed-off-by: Mel Gorman <mgorman@xxxxxxx> Reviewed-by: Rik van Riel <riel@xxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Minchan Kim <minchan.kim@xxxxxxxxx> Cc: Dave Jones <davej@xxxxxxxxxx> Cc: Jan Kara <jack@xxxxxxx> Cc: Andy Isaacson <adi@xxxxxxxxxxxxx> Cc: Nai Xia <nai.xia@xxxxxxxxx> Cc: Johannes Weiner <jweiner@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmscan.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff -puN mm/vmscan.c~mm-vmscan-do-not-oom-if-aborting-reclaim-to-start-compaction mm/vmscan.c --- a/mm/vmscan.c~mm-vmscan-do-not-oom-if-aborting-reclaim-to-start-compaction +++ a/mm/vmscan.c @@ -2263,6 +2263,7 @@ static unsigned long do_try_to_free_page struct zoneref *z; struct zone *zone; unsigned long writeback_threshold; + bool should_abort_reclaim; get_mems_allowed(); delayacct_freepages_start(); @@ -2274,7 +2275,8 @@ static unsigned long do_try_to_free_page sc->nr_scanned = 0; if (!priority) disable_swap_token(sc->target_mem_cgroup); - if (shrink_zones(priority, zonelist, sc)) + should_abort_reclaim = shrink_zones(priority, zonelist, sc); + if (should_abort_reclaim) break; /* @@ -2342,6 +2344,10 @@ out: if (oom_killer_disabled) return 0; + /* Aborting reclaim to try compaction? don't OOM, then */ + if (should_abort_reclaim) + return 1; + /* top priority shrink_zones still had more to do? don't OOM, then */ if (global_reclaim(sc) && !all_unreclaimable(zonelist, sc)) return 1; _ Patches currently in -mm which might be from mgorman@xxxxxxx are origin.patch mm-fix-null-ptr-dereference-in-__count_immobile_pages.patch mm-__count_immobile_pages-make-sure-the-node-is-online.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