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: Vinayak Menon <vinmenon@codeaurora.org>
This commit is contained in:
@@ -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];
|
||||
/*
|
||||
* Assumes that all types of movable pages can be
|
||||
* served by cma. Fix this if that changes.
|
||||
*/
|
||||
if (mtype == MIGRATE_MOVABLE)
|
||||
return 1;
|
||||
|
||||
if (is_migrate_cma(fallbacktype)) {
|
||||
can_use = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (fallbacktype == MIGRATE_TYPES)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return can_use;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void tune_lmk_zone_param(struct zonelist *zonelist, int classzone_idx,
|
||||
|
||||
Reference in New Issue
Block a user