From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: akpm@linux-foundation.org, aneesh.kumar@linux.vnet.ibm.com,
iamjoonsoo.kim@lge.com
Subject: [PATCH] mm/cma: Warn if the CMA area could not be activated
Date: Mon, 5 Jun 2017 08:07:29 +0530 [thread overview]
Message-ID: <20170605023729.26303-1-khandual@linux.vnet.ibm.com> (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
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
reply other threads:[~2017-06-05 2:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170605023729.26303-1-khandual@linux.vnet.ibm.com \
--to=khandual@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox