linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: cma: report correct node id
@ 2023-10-19  1:32 Kefeng Wang
  2023-10-19  5:02 ` Christoph Hellwig
  2023-10-25 16:37 ` Nathan Chancellor
  0 siblings, 2 replies; 11+ messages in thread
From: Kefeng Wang @ 2023-10-19  1:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, Christoph Hellwig, Kefeng Wang

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



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-11-02  2:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-19  1:32 [PATCH] mm: cma: report correct node id Kefeng Wang
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox