linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Roman Gushchin <guro@fb.com>
To: Barry Song <song.bao.hua@hisilicon.com>
Cc: <akpm@linux-foundation.org>, <mike.kravetz@oracle.com>,
	<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>
Subject: Re: [PATCH 2/2] mm: hugetlb: fix the name of hugetlb CMA
Date: Wed, 3 Jun 2020 07:13:42 -0700	[thread overview]
Message-ID: <20200603141342.GB559132@carbon.DHCP.thefacebook.com> (raw)
In-Reply-To: <20200603084025.62740-3-song.bao.hua@hisilicon.com>

On Wed, Jun 03, 2020 at 08:40:25PM +1200, Barry Song wrote:
> 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>

Acked-by: Roman Gushchin <guro@fb.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
> 
> 
> 


  reply	other threads:[~2020-06-03 14:15 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 ` [PATCH 2/2] mm: hugetlb: fix the name of hugetlb CMA Barry Song
2020-06-03 14:13   ` Roman Gushchin [this message]
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=20200603141342.GB559132@carbon.DHCP.thefacebook.com \
    --to=guro@fb.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxarm@huawei.com \
    --cc=mike.kravetz@oracle.com \
    --cc=song.bao.hua@hisilicon.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