migrate_pages() is not only called by cma but also by compaction and
memory hotplug-out.
"
fbca0939fc96 [COMMON] mm: show page state on migration failure"
inserts printing simple states of the pages that are failed in
migration to another pages. Migration for cma and memory hotplug-out
seldom fails but that of compaction does not since compaction tries
to migrate all anonymous pages. Therefore the state of the unmigrated
pages is not necessary for compaction. Rather it may suffer from too
many unnecessary mirgration failre log messages.
Change-Id: Ica55bbcacc94a7b16dc76410b404852a98bc482a
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
MR_MEMPOLICY_MBIND,
MR_NUMA_MISPLACED,
MR_CMA,
+ MR_HPA,
MR_TYPES
};
"mempolicy_mbind",
"numa_misplaced",
"cma",
+ "hpa",
};
const struct trace_print_flags pageflag_names[] = {
private, page, pass > 2, mode,
reason);
- if ((rc != -EAGAIN) && (rc != MIGRATEPAGE_SUCCESS)) {
+ if ((reason == MR_CMA) && (rc != -EAGAIN) &&
+ (rc != MIGRATEPAGE_SUCCESS)) {
phys_addr_t pa = page_to_phys(page);
pr_err("%s failed(%d): PA%pa,mapcnt%d,cnt%d\n",
cc->nr_migratepages -= nr_reclaimed;
ret = migrate_pages(&cc->migratepages, alloc_migrate_target,
- NULL, 0, cc->mode, MR_CMA);
+ NULL, 0, cc->mode, drain ? MR_CMA : MR_HPA);
}
if (ret < 0) {
putback_movable_pages(&cc->migratepages);