mm/cma: get nid from physical address
Subsystems (2)
PATCH 1/1 mm/cma: get nid from physical address
The nid passed to cma_declare_contiguous_nid() may be NUMA_NO_NODE, which is not the actual nid. To get the correct nid, we can get the nid from physical address.
--- mm/cma.c | 1 + 1 file changed, 1 insertion(+)
mm/cma.c +1 -0
@@ -361,6 +361,7 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,kmemleak_ignore_phys (addr); base = addr; } + nid =early_pfn_to_nid (PHYS_PFN (base)); ret =cma_init_reserved_mem (base, size, order_per_bit, name, res_cma);if (ret)
Signature · 1 line
2.25.1
Quoted 4 lines · Yajun Deng
The nid passed to
cma_declare_contiguous_nid()may beNUMA_NO_NODE, which is not the actual nid. To get the correct nid, we can get the nid from physical address.
Please check
https://lore.kernel.org/linux-riscv/[email protected]/
Quoted 17 lines
Signed-off-by Yajun Deng <[email protected]>--- mm/cma.c | 1 + 1 file changed, 1 insertion(+)mm/cma.c +1
-0@@ -361,6 +361,7 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,kmemleak_ignore_phys (addr); base = addr; } + nid =early_pfn_to_nid (PHYS_PFN (base)); ret =cma_init_reserved_mem (base, size, order_per_bit, name, res_cma);if (ret)
Quoted 6 lines · Kefeng Wang
Quoted 3 lines · Yajun Deng
The nid passed to
cma_declare_contiguous_nid()may beNUMA_NO_NODE,
Quoted 9 lines
Quoted 4 lines
which is not the actual nid. To get the correct nid, we can get the nid
from physical address.
Please check
Okay, thanks!
Quoted 32 lines
Quoted 31 lines
Signed-off-by Yajun Deng <[email protected]>---
mm/cma.c | 1 +1 file changed, 1 insertion(+)diff --git
a/mm/cma.cb/mm/cma.cindex
3e9724716bad..be6cdde32944100644---
a/mm/cma.c+++
b/mm/cma.c@@ -361,6 +361,7 @@ int
__initcma_declare_contiguous_nid(phys_addr_t base,
kmemleak_ignore_phys(addr);base = addr;
}
+ nid = early_pfn_to_nid(PHYS_PFN(base));
Quoted 1 line
ret =
cma_init_reserved_mem(base, size, order_per_bit, name, res_cma);if (ret)