mm: page allocator: do not call direct reclaim for THP allocations while compaction is deferred
commit 66199712e9eef5aede09dbcd9dfff87798a66917 upstream.
Stable note: Not tracked in Buzilla. This was part of a series that
reduced interactivity stalls experienced when THP was enabled.
If compaction is deferred, direct reclaim is used to try to free enough
pages for the allocation to succeed. For small high-orders, this has a
reasonable chance of success. However, if the caller has specified
__GFP_NO_KSWAPD to limit the disruption to the system, it makes more sense
to fail the allocation rather than stall the caller in direct reclaim.
This patch skips direct reclaim if compaction is deferred and the caller
Async compaction only considers a subset of pages so it is possible for
compaction to be deferred prematurely and not enter direct reclaim even in
cases where it should. To compensate for this, this patch also defers
compaction only if sync compaction failed.
Signed-off-by: Mel Gorman <firstname.lastname@example.org>
Acked-by: Minchan Kim <email@example.com>
Reviewed-by: Rik van Riel<firstname.lastname@example.org>
Cc: Andrea Arcangeli <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