mm: vmscan: do not OOM if aborting reclaim to start compaction
commit 7335084d446b83cbcb15da80497d03f0c1dc9e21 upstream.
Stable note: Not tracked in Bugzilla. This patch makes later patches
easier to apply but otherwise has little to justify it. The
problem it fixes was never observed but the source of the
theoretical problem did not exist for very long.
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 <firstname.lastname@example.org>
Reviewed-by: Rik van Riel <email@example.com>
Cc: Andrea Arcangeli <firstname.lastname@example.org>
Cc: Minchan Kim <email@example.com>
Cc: Dave Jones <firstname.lastname@example.org>
Cc: Jan Kara <email@example.com>
Cc: Andy Isaacson <firstname.lastname@example.org>
Cc: Nai Xia <email@example.com>
Cc: Johannes Weiner <firstname.lastname@example.org>
Signed-off-by: Andrew Morton <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
Signed-off-by: Greg Kroah-Hartman <email@example.com>
1 file changed