From 0567ea33cfb8908ae9ce00589920e9a75c389094 Mon Sep 17 00:00:00 2001 From: Patrick Daly Date: Thu, 25 Feb 2021 17:16:44 -0800 Subject: [PATCH] BACKPORT: mm: cma: print region name on failure Print the name of the CMA region for convenience. This is useful information to have when cma_alloc() fails. [pdaly@codeaurora.org: print the "count" variable] Link: https://lkml.kernel.org/r/20210209142414.12768-1-georgi.djakov@linaro.org Link: https://lkml.kernel.org/r/20210208115200.20286-1-georgi.djakov@linaro.org Signed-off-by: Patrick Daly Signed-off-by: Georgi Djakov Acked-by: Minchan Kim Reviewed-by: David Hildenbrand Reviewed-by: Randy Dunlap Cc: Minchan Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit a052d4d13d88c2073d1339d9dce02cba7b4dc609) [minchan: Resolved minor conflict with gfp_t in mm/cma.c ] Signed-off-by: Minchan Kim Bug: 181887812 Change-Id: I2300244d9414b4b43166798fe936047647e22ca8 --- mm/cma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/cma.c b/mm/cma.c index 6f72c1948814..1433718e24e3 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -524,8 +524,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, } if (ret && !(gfp_mask & __GFP_NOWARN)) { - pr_err("%s: alloc failed, req-size: %zu pages, ret: %d\n", - __func__, count, ret); + pr_err("%s: %s: alloc failed, req-size: %zu pages, ret: %d\n", + __func__, cma->name, count, ret); cma_debug_show_areas(cma); }