mm: show page state only for cma
authorCho KyongHo <pullip.cho@samsung.com>
Tue, 31 Oct 2017 12:03:37 +0000 (21:03 +0900)
committerhskang <hs1218.kang@samsung.com>
Mon, 27 Aug 2018 07:22:48 +0000 (16:22 +0900)
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>
include/linux/migrate.h
mm/debug.c
mm/migrate.c
mm/page_alloc.c

index a2246cf670badb96e6c11c4d13b233db0c93388f..2e83c7d39f353a4782ba4c27d1d78d79828aa431 100644 (file)
@@ -26,6 +26,7 @@ enum migrate_reason {
        MR_MEMPOLICY_MBIND,
        MR_NUMA_MISPLACED,
        MR_CMA,
+       MR_HPA,
        MR_TYPES
 };
 
index 6726bec731c956e904450a9f67e22fc7be8f049c..23609e74518555d907c77714ca8dea988674b4a3 100644 (file)
@@ -24,6 +24,7 @@ char *migrate_reason_names[MR_TYPES] = {
        "mempolicy_mbind",
        "numa_misplaced",
        "cma",
+       "hpa",
 };
 
 const struct trace_print_flags pageflag_names[] = {
index 104b9746942d6d48e049cb7952f6c528691cef68..6bdff23cbace048353cdf066dd544b8130a1342e 100644 (file)
@@ -1406,7 +1406,8 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
                                                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",
index 116007124e12ed65f724fdc92248eb8f8476d666..1fa1c8bd1fe1efb693f6c86104824ca5f71ae192 100644 (file)
@@ -7486,7 +7486,7 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
                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);