From: Barry Song <song.bao.hua@hisilicon.com>
To: <akpm@linux-foundation.org>, <mike.kravetz@oracle.com>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
<linuxarm@huawei.com>, Barry Song <song.bao.hua@hisilicon.com>,
"Roman Gushchin" <guro@fb.com>
Subject: [PATCH v2 2/2] mm: hugetlb: fix the name of hugetlb CMA
Date: Wed, 17 Jun 2020 10:31:31 +1200 [thread overview]
Message-ID: <20200616223131.33828-3-song.bao.hua@hisilicon.com> (raw)
In-Reply-To: <20200616223131.33828-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
we should have different names for different CMA areas.
Acked-by: Roman Gushchin <guro@fb.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
-v2:
rebase to 5.8-rc1
add acked-by and reviewed-by
mm/hugetlb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 57ece74e3aae..d54bb7e35005 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -5692,12 +5692,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
prev parent reply other threads:[~2020-06-16 22:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 22:31 [PATCH v2 0/2] mm: fix the names of general cma and hugetlb cma Barry Song
2020-06-16 22:31 ` [PATCH v2 1/2] mm: cma: fix the name of CMA areas Barry Song
2020-06-16 22:31 ` Barry Song [this message]
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=20200616223131.33828-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