From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B45C9C433DF for ; Tue, 16 Jun 2020 22:33:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7A2F1207D3 for ; Tue, 16 Jun 2020 22:33:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A2F1207D3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=hisilicon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 25D076B0006; Tue, 16 Jun 2020 18:33:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 20F176B0008; Tue, 16 Jun 2020 18:33:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 14AF66B000A; Tue, 16 Jun 2020 18:33:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id F10356B0006 for ; Tue, 16 Jun 2020 18:33:43 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B27FA824556B for ; Tue, 16 Jun 2020 22:33:43 +0000 (UTC) X-FDA: 76936528326.12.dog72_010e19226e02 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 88A9E1801F9E3 for ; Tue, 16 Jun 2020 22:33:43 +0000 (UTC) X-HE-Tag: dog72_010e19226e02 X-Filterd-Recvd-Size: 2442 Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Tue, 16 Jun 2020 22:33:42 +0000 (UTC) Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 538AE8A8B1807A1B4389; Wed, 17 Jun 2020 06:33:39 +0800 (CST) Received: from SWX921481.china.huawei.com (10.126.203.10) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Wed, 17 Jun 2020 06:33:29 +0800 From: Barry Song To: , CC: , , , Barry Song , "Roman Gushchin" Subject: [PATCH v2 2/2] mm: hugetlb: fix the name of hugetlb CMA Date: Wed, 17 Jun 2020 10:31:31 +1200 Message-ID: <20200616223131.33828-3-song.bao.hua@hisilicon.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200616223131.33828-1-song.bao.hua@hisilicon.com> References: <20200616223131.33828-1-song.bao.hua@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.203.10] X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 88A9E1801F9E3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Reviewed-by: Mike Kravetz Signed-off-by: Barry Song --- -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 =3D 0; for_each_node_state(nid, N_ONLINE) { int res; + char name[20]; =20 size =3D min(per_node, hugetlb_cma_size - reserved); size =3D round_up(size, PAGE_SIZE << order); =20 + snprintf(name, 20, "hugetlb%d", nid); res =3D 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", --=20 2.23.0