Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1657225

[PATCH] mm/cma: Warn if the CMA area could not be activated

From Anshuman Khandual <khandual@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH] mm/cma: Warn if the CMA area could not be activated
Date 2017-06-05 04:40 +0200
Message-ID <tOQ5X-5bh-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


While activating the CMA area, we check to make sure that all the
PFNs in the range are inside the same zone. This is a requirement
for alloc_contig_range() to work. Any CMA area failing the check
is disabled for good. This happens silently right now making all
future cma_alloc() allocations failure inevitable. Here we add a
error message stating that the CMA area could not be activated
which makes its easier to explain any future cma_alloc() failures
on it. While at this, change the bail out goto label from 'err'
to 'not_in_zone' which makes more sense.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
 mm/cma.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/cma.c b/mm/cma.c
index 978b4a1..9e45491 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -127,7 +127,7 @@ static int __init cma_activate_area(struct cma *cma)
 			 * to be in the same zone.
 			 */
 			if (page_zone(pfn_to_page(pfn)) != zone)
-				goto err;
+				goto not_in_zone;
 		}
 		init_cma_reserved_pageblock(pfn_to_page(base_pfn));
 	} while (--i);
@@ -141,7 +141,8 @@ static int __init cma_activate_area(struct cma *cma)
 
 	return 0;
 
-err:
+not_in_zone:
+	pr_err("CMA area %s could not be activated\n", cma->name);
 	kfree(cma->bitmap);
 	cma->count = 0;
 	return -EINVAL;
-- 
1.8.5.2

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] mm/cma: Warn if the CMA area could not be activated Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-06-05 04:40 +0200

csiph-web