mm: make cma the first choice for movable request

cma entertains only movable requests, so it is better to fill up
the cma regions first so that MIGRATE_MOVABLE regions remain
available to satisfy a steal by unmovable requests, thus
improving the chances of unmovable allocation successes during
low memory situtations.

Change-Id: I01904b86feb5307c17c17072ca9360cf0c17b408
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
This commit is contained in:
Vinayak Menon 2018-05-14 09:37:54 +05:30
parent 2b6a49e9a1
commit 8915754213

View File

@ -2299,14 +2299,14 @@ do_steal:
static struct page *__rmqueue(struct zone *zone, unsigned int order,
int migratetype)
{
struct page *page;
struct page *page = NULL;
retry:
page = __rmqueue_smallest(zone, order, migratetype);
if (unlikely(!page)) {
if (migratetype == MIGRATE_MOVABLE)
page = __rmqueue_cma_fallback(zone, order);
if (migratetype == MIGRATE_MOVABLE)
page = __rmqueue_cma_fallback(zone, order);
if (!page) {
page = __rmqueue_smallest(zone, order, migratetype);
if (!page && __rmqueue_fallback(zone, order, migratetype))
goto retry;
}