commit 808c209dc82ce79147122ca78e7047bc74a16149 Author: Robin H. Johnson Date: Wed Nov 30 10:32:57 2016 -0800 mm: ratelimit & trace PFNs busy. Signed-off-by: Robin H. Johnson Acked-by: Michal Nazarewicz diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6de9440e3ae2..3c28ec3d18f8 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7289,8 +7289,16 @@ 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_info("%s: [%lx, %lx) PFNs busy\n", - __func__, outer_start, end); + static DEFINE_RATELIMIT_STATE(ratelimit_pfn_busy, + DEFAULT_RATELIMIT_INTERVAL, + DEFAULT_RATELIMIT_BURST); + if (__ratelimit(&ratelimit_pfn_busy)) { + pr_info("%s: [%lx, %lx) PFNs busy\n", + __func__, outer_start, end); + if (IS_ENABLED(CONFIG_CMA_DEBUG)) + dump_stack(); + } + ret = -EBUSY; goto done; }