From patchwork Thu Oct 19 01:32:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13428161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98709CDB47E for ; Thu, 19 Oct 2023 01:33:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 125F380074; Wed, 18 Oct 2023 21:33:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D69980052; Wed, 18 Oct 2023 21:33:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F06E880074; Wed, 18 Oct 2023 21:33:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id DE6EA80052 for ; Wed, 18 Oct 2023 21:33:12 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 98F35140FEC for ; Thu, 19 Oct 2023 01:33:12 +0000 (UTC) X-FDA: 81360487824.10.827C35E Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf20.hostedemail.com (Postfix) with ESMTP id 2A8901C000A for ; Thu, 19 Oct 2023 01:33:09 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697679191; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=8ZQ/DJs6aZk+SfmDpVY7t6SpTetlhr4pEdEP2Nlcvxg=; b=LMzCodadZ7a6P+jRc678/3/BmxggyNCdDNkYrgCHiS/z07FKHqPuptwPMnZlcpybGMyN7s R/dfxEps71MySevVR0H4LRGKFd31uVZYxS5M5x2ETSFvS+GC8PiOlnDrMSGVfOKZzVvrJn NVwYzWn+zHLkVwPZxowa2pMKGrS8F1o= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697679191; a=rsa-sha256; cv=none; b=UOsXOlphBbsqWtwvw1jWyRvef4JFE26GXi83SF0miyJNEVELesf1itQ8BN7G2a9/zDL8P/ DFclT6hCidZ6aTk7JCD47jtV3HMhJyyNMhTBQ2ax1wi0dTfzef1Y32BWwxan5hDv6oJcF/ 460OU5G1qXN7RWgZ6a7fVqN8Ti8ZbFQ= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S9qr02GrNzNp2c; Thu, 19 Oct 2023 09:29:04 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 19 Oct 2023 09:33:03 +0800 From: Kefeng Wang To: Andrew Morton CC: , Christoph Hellwig , Kefeng Wang Subject: [PATCH] mm: cma: report correct node id Date: Thu, 19 Oct 2023 09:32:53 +0800 Message-ID: <20231019013253.2792048-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 2A8901C000A X-Stat-Signature: 9hkzjpgznnbtgcacopxnndziuih4igbk X-Rspam-User: X-HE-Tag: 1697679189-761536 X-HE-Meta: U2FsdGVkX19OOxIN+JIjdJesFDzHhBzIwimoSRUd9xzeA5hj8zJNH0sKe9qBdHiF95TBInISftRORSSM90QvP+k3M4cpcpqM01BjrTdrh8Q7OfzPq8T7nBUrOvdEX1+/QR7IGDx11fgI7+94zQcOLytOG0EsO57tbip/6zIBvnICclL3RAkKiJrjZEKeSWP//ppetH+cWG1M0x8IXPv+nShSYBE+RkrHvoH1basYsgF0tQg9lPUtzQmi8gDTDNIa9aQLdDlt+NRGx6S/eZsGkM8BX/y+9aMa78qoREkkbr8BPNW8aaD0o/8dOw0+EY0JvJ68MWbADylAbv1QIglGs0w1usXJYwPQ8+2hJY7PAmzQnjKXTdPZMexGcRCCrP8XaAAb9aVqjRKYh+U9yEGNaqW6XfptTkD2+VwGJs7oz5cCPZK/9dhB9TsbSNlDi1oEF8G9CViWyviDfBHeTV8hdT7a/Zs13ydcNFbVLTTGg5QGibv4L2SNNTJUg9d+6E5Bi5+CcNuTrY1KlrqD+iySv9iPFj1JGWFKUFcwKIZeQOsewLJ8ixq3dJdaVUdM17GV19A0oVEfas3RnqWbGYaWB8tokNBZ1YpVKsHbfaGLfSD0IFjv2V19VCIGFKcTMV2y2kO7KVX2T/WCPswRyed0MXE1dQ4NkMapHbsc0AF7BPWYXJPGmrh6PTSG2lfWY2BKfe/nJY4mo09AWCM7P50DQMv9be3YqcZpt6IInnfSOaFR5CaKFXJhVgpXWq8rE/3pmDXDPAnX1rqlBDwnGPUj42f60x4h6DoKLDPWZ3VpQ9h7Z/+v+FcKFZcImMnPkvaXXrjMnmTURcYKfbAJgYdGGf7VlX7OSYdfM16pp/go5ZHG8qtZSPd2rrRy7PArz55J6H0wNHgGF4sFPg3o7jYBB/MwLcaUYnnbm+PCcnXthx07t8VXbtyDnCvs/I4h62m+r6sIypjwZRtpiggeHi+ DIxGiiT5 KUmojibQ6IKow7SC6uATdwnQaYcRXPGWxspAoU+0KAugx7iDVgxnMs07MKOItNd6f8FhikpJopr7Bxz4vlleJI0D70y8RF5t1jGOXf9r0k5brQY7uGnzEVbbewhCdd23TGtGmUXSbnFCQ0uw= 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: Use early_pfn_to_nid() to get correct node id from base instead of the default NUMA_NO_NODE in cma_declare_contiguous_nid(). Signed-off-by: Kefeng Wang --- mm/cma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/cma.c b/mm/cma.c index 2b2494fd6b59..97c27e5fe1a2 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -375,6 +375,9 @@ int __init cma_declare_contiguous_nid(phys_addr_t base, if (ret) goto free_mem; + if (nid == NUMA_NO_NODE) + nid = early_pfn_to_nid(PHYS_PFN(base)); + pr_info("Reserved %ld MiB at %pa on node %d\n", (unsigned long)size / SZ_1M, &base, nid); return 0;