Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 263316a1 authored by Vinayak Menon's avatar Vinayak Menon
Browse files

lowmemorykiller: fix cma accounting



lowmemorykiller checks if the current request can be
served from CMA region or not by looking at the gfp_mask.
But the logic used is no more valid as MIGRATE_CMA is not
a fallback for MIGRATE_MOVABLE. Fix it.

Change-Id: Ie8f132a52d8106810332fd2db5a341b299feacfb
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 1f668377
Loading
Loading
Loading
Loading
+7 −18
Original line number Diff line number Diff line
@@ -264,27 +264,16 @@ static DEFINE_MUTEX(scan_mutex);

static int can_use_cma_pages(gfp_t gfp_mask)
{
	int can_use = 0;
	int mtype = gfpflags_to_migratetype(gfp_mask);
	int i = 0;
	int *mtype_fallbacks = get_migratetype_fallbacks(mtype);

	if (is_migrate_cma(mtype)) {
		can_use = 1;
	} else {
		for (i = 0;; i++) {
			int fallbacktype = mtype_fallbacks[i];

			if (is_migrate_cma(fallbacktype)) {
				can_use = 1;
				break;
			}
	/*
	 * Assumes that all types of movable pages can be
	 * served by cma. Fix this if that changes.
	 */
	if (mtype == MIGRATE_MOVABLE)
		return 1;

			if (fallbacktype == MIGRATE_TYPES)
				break;
		}
	}
	return can_use;
	return 0;
}

void tune_lmk_zone_param(struct zonelist *zonelist, int classzone_idx,