From: Barry Song <song.bao.hua@hisilicon.com>
To: <akpm@linux-foundation.org>, <mike.kravetz@oracle.com>
Cc: <guro@fb.com>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
Barry Song <song.bao.hua@hisilicon.com>
Subject: [PATCH 2/2] mm: hugetlb: fix the name of hugetlb CMA
Date: Wed, 3 Jun 2020 20:40:25 +1200 [thread overview]
Message-ID: <20200603084025.62740-3-song.bao.hua@hisilicon.com> (raw)
In-Reply-To: <20200603084025.62740-1-song.bao.hua@hisilicon.com>
once we enable CMA_DEBUGFS, we will get the below errors:
directory 'cma-hugetlb' with parent 'cma' already present
only the first numa node will get a directory in debugfs.
we should have different names for different CMA areas.
Cc: Roman Gushchin <guro@fb.com>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
mm/hugetlb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index bcabbe02192b..4ebc4edc3b40 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -5586,12 +5586,14 @@ void __init hugetlb_cma_reserve(int order)
reserved = 0;
for_each_node_state(nid, N_ONLINE) {
int res;
+ char name[20];
size = min(per_node, hugetlb_cma_size - reserved);
size = round_up(size, PAGE_SIZE << order);
+ snprintf(name, 20, "hugetlb%d", nid);
res = cma_declare_contiguous_nid(0, size, 0, PAGE_SIZE << order,
- 0, false, "hugetlb",
+ 0, false, name,
&hugetlb_cma[nid], nid);
if (res) {
pr_warn("hugetlb_cma: reservation failed: err %d, node %d",
--
2.23.0
next prev parent reply other threads:[~2020-06-03 8:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 8:40 [PATCH 0/2] mm: fix the names of general cma and hugetlb cma Barry Song
2020-06-03 8:40 ` [PATCH 1/2] mm: cma: fix the name of CMA areas Barry Song
2020-06-03 14:12 ` Roman Gushchin
2020-06-03 17:27 ` Mike Kravetz
2020-06-03 8:40 ` Barry Song [this message]
2020-06-03 14:13 ` [PATCH 2/2] mm: hugetlb: fix the name of hugetlb CMA Roman Gushchin
2020-06-03 17:28 ` Mike Kravetz
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=20200603084025.62740-3-song.bao.hua@hisilicon.com \
--to=song.bao.hua@hisilicon.com \
--cc=akpm@linux-foundation.org \
--cc=guro@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxarm@huawei.com \
--cc=mike.kravetz@oracle.com \
/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;
as well as URLs for NNTP newsgroup(s).