diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 69807b231c85..fca040c7acdf 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7504,6 +7504,10 @@ bool is_pageblock_removable_nolock(struct page *page) #if (defined(CONFIG_MEMORY_ISOLATION) && defined(CONFIG_COMPACTION)) || defined(CONFIG_CMA) +#ifdef CONFIG_AMLOGIC_MODIFY +#define cma_debug pr_debug +#endif /* CONFIG_AMLOGIC_MODIFY */ + static unsigned long pfn_max_align_down(unsigned long pfn) { return pfn & ~(max_t(unsigned long, MAX_ORDER_NR_PAGES, @@ -7532,7 +7536,8 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, if (fatal_signal_pending(current)) { ret = -EINTR; #ifdef CONFIG_AMLOGIC_MODIFY /* for debug */ - pr_err("cma %s %d, ret:%d\n", __func__, __LINE__, ret); + cma_debug("cma %s %d, ret:%d\n", + __func__, __LINE__, ret); #endif /* CONFIG_AMLOGIC_MODIFY */ break; } @@ -7543,7 +7548,7 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, if (!pfn) { ret = -EINTR; #ifdef CONFIG_AMLOGIC_MODIFY /* for debug */ - pr_err("cma %s %d, ret:%d\n", + cma_debug("cma %s %d, ret:%d\n", __func__, __LINE__, ret); #endif /* CONFIG_AMLOGIC_MODIFY */ break; @@ -7552,7 +7557,8 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, } else if (++tries == 5) { ret = ret < 0 ? ret : -EBUSY; #ifdef CONFIG_AMLOGIC_MODIFY /* for debug */ - pr_err("cma %s %d, ret:%d\n", __func__, __LINE__, ret); + cma_debug("cma %s %d, ret:%d\n", + __func__, __LINE__, ret); #endif /* CONFIG_AMLOGIC_MODIFY */ break; } @@ -7567,7 +7573,7 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, if (ret < 0) { putback_movable_pages(&cc->migratepages); #ifdef CONFIG_AMLOGIC_MODIFY /* for debug */ - pr_err("cma %s %d, ret:%d\n", __func__, __LINE__, ret); + cma_debug("cma %s %d, ret:%d\n", __func__, __LINE__, ret); #endif /* CONFIG_AMLOGIC_MODIFY */ return ret; } @@ -7615,7 +7621,7 @@ static void cma_boost_work_func(struct work_struct *work) atomic_add(BOOST_BUSY, ok); /* tell caller busy */ if (ret) { - pr_err("%s, failed, ret:%d, ok:%d\n", + cma_debug("%s, failed, ret:%d, ok:%d\n", __func__, ret, atomic_read(ok)); } } @@ -7661,7 +7667,7 @@ int alloc_contig_boost(unsigned long start_pfn, unsigned long count) ret = -EINVAL; if (ret) { - pr_err("%s, failed, ret:%d, ok:%d\n", + cma_debug("%s, failed, ret:%d, ok:%d\n", __func__, ret, atomic_read(&ok)); } @@ -7739,7 +7745,7 @@ int alloc_contig_range(unsigned long start, unsigned long end, false); #ifdef CONFIG_AMLOGIC_MODIFY if (ret) { /* for debug */ - pr_err("cma %s %d, ret:%d\n", __func__, __LINE__, ret); + cma_debug("cma %s %d, ret:%d\n", __func__, __LINE__, ret); return ret; } #else @@ -7828,7 +7834,7 @@ int alloc_contig_range(unsigned long start, unsigned long end, /* Make sure the range is really isolated. */ if (test_pages_isolated(outer_start, end, false)) { - pr_debug("%s: [%lx, %lx) PFNs busy\n", + cma_debug("%s: [%lx, %lx) PFNs busy\n", __func__, outer_start, end); ret = -EBUSY; goto done; @@ -7839,7 +7845,7 @@ int alloc_contig_range(unsigned long start, unsigned long end, if (!outer_end) { ret = -EBUSY; #ifdef CONFIG_AMLOGIC_MODIFY - pr_err("cma %s %d, ret:%d\n", __func__, __LINE__, ret); + cma_debug("cma %s %d, ret:%d\n", __func__, __LINE__, ret); #endif /* CONFIG_AMLOGIC_MODIFY */ goto done; } @@ -7870,7 +7876,7 @@ void free_contig_range(unsigned long pfn, unsigned nr_pages) page = pfn_to_page(pfn); batch = (1 << start_order); free_order = __free_pages_cma(page, start_order, &count); - pr_debug("pages:%4d, free:%2d, start:%2d, batch:%4d, pfn:%ld\n", + cma_debug("pages:%4d, free:%2d, start:%2d, batch:%4d, pfn:%ld\n", nr_pages, free_order, start_order, batch, pfn); nr_pages -= batch;