linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, Christoph Hellwig <hch@lst.de>,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: [PATCH] mm: cma: report correct node id
Date: Thu, 19 Oct 2023 09:32:53 +0800	[thread overview]
Message-ID: <20231019013253.2792048-1-wangkefeng.wang@huawei.com> (raw)

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 <wangkefeng.wang@huawei.com>
---
 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;
-- 
2.27.0



             reply	other threads:[~2023-10-19  1:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19  1:32 Kefeng Wang [this message]
2023-10-19  5:02 ` Christoph Hellwig
2023-10-19  7:02   ` Kefeng Wang
2023-10-20  4:47     ` Christoph Hellwig
2023-10-20  6:14       ` Kefeng Wang
2023-10-25 16:37 ` Nathan Chancellor
2023-10-25 16:42   ` Andrew Morton
2023-10-30  4:22   ` Kefeng Wang
2023-10-30  9:34   ` Kefeng Wang
2023-11-01 17:29     ` Nathan Chancellor
2023-11-02  2:55       ` Kefeng Wang

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=20231019013253.2792048-1-wangkefeng.wang@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linux-mm@kvack.org \
    /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