mm: unify the allocation of pglist_data instances
Subsystems (11)
v2 cover mm: unify the allocation of pglist_data instances
This patches is created to fix the __pa() warning messages when CONFIG_DEBUG_VIRTUAL=y by unifying the allocation of pglist_data instances.
In current implementation of node_data, if CONFIG_NEED_MULTIPLE_NODES=y, pglist_data is allocated by a memblock API. If CONFIG_NEED_MULTIPLE_NODES=n, we use a global variable named "contig_page_data".
If CONFIG_DEBUG_VIRTUAL is not enabled. __pa() can handle both allocation and symbol cases. But if CONFIG_DEBUG_VIRTUAL is set, we will have the "virt_to_phys used for non-linear address" warning when booting.
To fix the warning, always allocate pglist_data by memblock APIs and remove the usage of contig_page_data.
Warning message:
[ 0.000000] ------------[ cut here ]------------ [ 0.000000] virt_to_phys used for non-linear address: (____ptrval____) (contig_page_data+0x0/0x1c00) [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x58/0x68 [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.13.0-rc1-00074-g1140ab592e2e #3 [ 0.000000] Hardware name: linux,dummy-virt (DT) [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--) [ 0.000000] pc : __virt_to_phys+0x58/0x68 [ 0.000000] lr : __virt_to_phys+0x54/0x68 [ 0.000000] sp : ffff800011833e70 [ 0.000000] x29: ffff800011833e70 x28: 00000000418a0018 x27: 0000000000000000 [ 0.000000] x26: 000000000000000a x25: ffff800011b70000 x24: ffff800011b70000 [ 0.000000] x23: fffffc0001c00000 x22: ffff800011b70000 x21: 0000000047ffffb0 [ 0.000000] x20: 0000000000000008 x19: ffff800011b082c0 x18: ffffffffffffffff [ 0.000000] x17: 0000000000000000 x16: ffff800011833bf9 x15: 0000000000000004 [ 0.000000] x14: 0000000000000fff x13: ffff80001186a548 x12: 0000000000000000 [ 0.000000] x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 [ 0.000000] x8 : ffff8000115c9000 x7 : 737520737968705f x6 : ffff800011b62ef8 [ 0.000000] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 [ 0.000000] x2 : 0000000000000000 x1 : ffff80001159585e x0 : 0000000000000058 [ 0.000000] Call trace: [ 0.000000] __virt_to_phys+0x58/0x68 [ 0.000000] check_usemap_section_nr+0x50/0xfc [ 0.000000] sparse_init_nid+0x1ac/0x28c [ 0.000000] sparse_init+0x1c4/0x1e0 [ 0.000000] bootmem_init+0x60/0x90 [ 0.000000] setup_arch+0x184/0x1f0 [ 0.000000] start_kernel+0x78/0x488 [ 0.000000] ---[ end trace f68728a0d3053b60 ]---
[1] https://lore.kernel.org/patchwork/patch/1425110/
Change since v1:
- use memblock_alloc() to create pglist_data when CONFIG_NUMA=n
Miles Chen (2):
mm: introduce prepare_node_data
mm: replace contig_page_data with node_data
Documentation/admin-guide/kdump/vmcoreinfo.rst | 13 ------------- arch/powerpc/kexec/core.c | 5 ----- include/linux/gfp.h | 3 --- include/linux/mm.h | 2 ++ include/linux/mmzone.h | 4 ++-- kernel/crash_core.c | 1 - mm/memblock.c | 3 +-- mm/page_alloc.c | 16 ++++++++++++++++ mm/sparse.c | 2 ++ 9 files changed, 23 insertions(+), 26 deletions(-)
base-commit: 8ac91e6c6033ebc12c5c1e4aa171b81a662bd70f
Signature · 5 lines
2.18.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
PATCH v2 1/2 mm: introduce prepare_node_data
When CONFIG_NEED_MULTIPLE_NODES=y (CONFIG_NUMA=y),
the pglist_data is allocated by a memblock API and stored in an array named node_data[].
When CONFIG_NEED_MULTIPLE_NODES=n (CONFIG_NUMA=n), the pglist_data is defined as global variable contig_page_data. The difference causes problems when we enable CONFIG_DEBUG_VIRTUAL and use __pa() to get the physical address of NODE_DATA.
To solve the issue, introduce prepare_node_data() to allocate pglist_data when CONFIG_NUMA=n and stored it to node_data. i.e., Use the same way to allocate node_data[] when CONFIG_NUMA=y or CONFIG_NUMA=n.prepare_node_data() is called in sparer_init() and free_area_init().
This is the first step to replace contig_page_data with allocated pglist_data.
--- include/linux/mm.h | 2 ++ include/linux/mmzone.h | 1 + mm/memblock.c | 1 + mm/page_alloc.c | 16 ++++++++++++++++ mm/sparse.c | 2 ++ 5 files changed, 22 insertions(+)
include/linux/mm.h +2 -0
@@ -2462,9 +2462,11 @@ static inline int early_pfn_to_nid(unsigned long pfn) {return 0 ; } +extern void prepare_node_data (void );#else /* please see mm/page_alloc.c */ extern int __meminit early_pfn_to_nid (unsigned long pfn); +static inline void prepare_node_data (void ) {};#endif extern void set_dma_reserve (unsigned long new_dma_reserve);
include/linux/mmzone.h +1 -0
@@ -1045,6 +1045,7 @@ extern char numa_zonelist_order[];extern struct pglist_data contig_page_data;#define NODE_DATA (nid) (&contig_page_data) +extern struct pglist_data *node_data[];#define NODE_MEM_MAP (nid) mem_map#else /* CONFIG_NEED_MULTIPLE_NODES */
mm/memblock.c +1 -0
@@ -95,6 +95,7 @@#ifndef CONFIG_NEED_MULTIPLE_NODES struct pglist_data __refdata contig_page_data;EXPORT_SYMBOL (contig_page_data); +struct pglist_data *node_data[MAX_NUMNODES ];#endif unsigned long max_low_pfn;
mm/page_alloc.c +16 -0
@@ -1659,6 +1659,20 @@ int __meminit early_pfn_to_nid(unsigned long pfn)return nid; } +#else +void __init prepare_node_data (void ) +{ +if (node_data[0 ]) +return ; + + node_data[0 ] =memblock_alloc (sizeof (struct pglist_data ), +SMP_CACHE_BYTES ); + +if (!node_data[0 ]) +panic ("Cannot allocate node_data\n" ); + +memset (node_data[0 ],0 ,sizeof (struct pglist_data )); +}#endif /* CONFIG_NEED_MULTIPLE_NODES */ void __init memblock_free_pages(struct page *page, unsigned long pfn,
@@ -7697,6 +7711,8 @@ void __init free_area_init(unsigned long *max_zone_pfn)int i, nid, zone;bool descending; +prepare_node_data (); +/* Record where the zone boundaries are */ memset (arch_zone_lowest_possible_pfn,0 ,sizeof (arch_zone_lowest_possible_pfn));
mm/sparse.c +2 -0
@@ -580,6 +580,8 @@ void __init sparse_init(void)memblocks_present (); +prepare_node_data (); + pnum_begin =first_present_section_nr (); nid_begin =sparse_early_nid (__nr_to_section (pnum_begin));
Signature · 5 lines
2.18.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
PATCH v2 2/2 mm: replace contig_page_data with node_data
In reply to Miles ChenReplace contig_page_data with node_data. Change the definition of NODE_DATA(nid) from (&contig_page_data) to (node_data[0]).
Remove contig_page_data from the tree.
--- Documentation/admin-guide/kdump/vmcoreinfo.rst | 13 ------------- arch/powerpc/kexec/core.c | 5 ----- include/linux/gfp.h | 3 --- include/linux/mmzone.h | 3 +-- kernel/crash_core.c | 1 - mm/memblock.c | 2 -- 6 files changed, 1 insertion(+), 26 deletions(-)
Documentation/admin-guide/kdump/vmcoreinfo.rst +0 -13
@@ -81,14 +81,6 @@ into that mem_map array. Used to map an address to the corresponding struct page. -contig_page_data ----------------- - -Makedumpfile gets the pglist_data structure from this symbol, which is -used to describe the memory layout. - -User-space tools use this to exclude free pages when dumping memory. - mem_section|(mem_section, NR_SECTION_ROOTS)|(mem_section, section_mem_map) --------------------------------------------------------------------------
@@ -531,11 +523,6 @@ node_data|(node_data, MAX_NUMNODES) See above. -contig_page_data ----------------- - -See above. - vmemmap_list ------------
arch/powerpc/kexec/core.c +0 -5
@@ -68,13 +68,8 @@ void machine_kexec_cleanup(struct kimage *image)void arch_crash_save_vmcoreinfo (void ) { -#ifdef CONFIG_NEED_MULTIPLE_NODES VMCOREINFO_SYMBOL (node_data);VMCOREINFO_LENGTH (node_data,MAX_NUMNODES ); -#endif -#ifndef CONFIG_NEED_MULTIPLE_NODES -VMCOREINFO_SYMBOL (contig_page_data); -#endif #if defined(CONFIG_PPC64 ) && defined(CONFIG_SPARSEMEM_VMEMMAP )VMCOREINFO_SYMBOL (vmemmap_list);VMCOREINFO_SYMBOL (mmu_vmemmap_psize);
include/linux/gfp.h +0 -3
@@ -493,9 +493,6 @@ static inline int gfp_zonelist(gfp_t flags)* This zone list contains a maximum of MAX_NUMNODES*MAX_NR_ZONES zones. * There are two zonelists per node, one for all zones with memory and * one containing just zones from the node the zonelist belongs to. -* -* For the normal case of non-DISCONTIGMEM systems the NODE_DATA() gets -* optimized to &contig_page_data at compile-time. */ static inline struct zonelist *node_zonelist (int nid,gfp_t flags) {
include/linux/mmzone.h +1 -2
@@ -1043,9 +1043,8 @@ extern char numa_zonelist_order[];#ifndef CONFIG_NEED_MULTIPLE_NODES -extern struct pglist_data contig_page_data; -#define NODE_DATA (nid) (&contig_page_data)extern struct pglist_data *node_data[]; +#define NODE_DATA (nid) (node_data[0])#define NODE_MEM_MAP (nid) mem_map#else /* CONFIG_NEED_MULTIPLE_NODES */
kernel/crash_core.c +0 -1
@@ -457,7 +457,6 @@ static int __init crash_save_vmcoreinfo_init(void)#ifndef CONFIG_NEED_MULTIPLE_NODES VMCOREINFO_SYMBOL (mem_map); -VMCOREINFO_SYMBOL (contig_page_data);#endif #ifdef CONFIG_SPARSEMEM VMCOREINFO_SYMBOL_ARRAY (mem_section);
mm/memblock.c +0 -2
@@ -93,8 +93,6 @@*/ #ifndef CONFIG_NEED_MULTIPLE_NODES -struct pglist_data __refdata contig_page_data; -EXPORT_SYMBOL (contig_page_data);struct pglist_data *node_data[MAX_NUMNODES ];#endif
Signature · 5 lines
2.18.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerHello Miles,
Quoted 8 lines · Miles Chen
This patches is created to fix the
__pa()warning messages whenCONFIG_DEBUG_VIRTUAL=yby unifying the allocation ofpglist_datainstances.In current implementation of
node_data, ifCONFIG_NEED_MULTIPLE_NODES=y,pglist_datais allocated by a memblock API. IfCONFIG_NEED_MULTIPLE_NODES=n, we use a global variable named "contig_page_data".
Quoted 7 lines
If
CONFIG_DEBUG_VIRTUALis not enabled.__pa()can handle both allocation and symbol cases. But ifCONFIG_DEBUG_VIRTUALis set, we will have the "virt_to_physused for non-linear address" warning when booting.To fix the warning, always allocate
pglist_databy memblock APIs and remove the usage ofcontig_page_data.
Somehow I was sure that we can allocate pglist_data before it is accessed in sparse_init() somewhere outside mm/sparse.c. It's really not the case and having two places that may allocated this structure is surely worth than your previous suggestion.
Sorry about that.
Quoted 56 lines
Warning message:
[ 0.000000] ------------[ cut here ]------------ [ 0.000000] virt_to_phys used for non-linear address: (____ptrval____) (contig_page_data+0x0/0x1c00) [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x58/0x68 [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.13.0-rc1-00074-g1140ab592e2e #3 [ 0.000000] Hardware name: linux,dummy-virt (DT) [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--) [ 0.000000] pc : __virt_to_phys+0x58/0x68 [ 0.000000] lr : __virt_to_phys+0x54/0x68 [ 0.000000] sp : ffff800011833e70 [ 0.000000] x29: ffff800011833e70 x28: 00000000418a0018 x27: 0000000000000000 [ 0.000000] x26: 000000000000000a x25: ffff800011b70000 x24: ffff800011b70000 [ 0.000000] x23: fffffc0001c00000 x22: ffff800011b70000 x21: 0000000047ffffb0 [ 0.000000] x20: 0000000000000008 x19: ffff800011b082c0 x18: ffffffffffffffff [ 0.000000] x17: 0000000000000000 x16: ffff800011833bf9 x15: 0000000000000004 [ 0.000000] x14: 0000000000000fff x13: ffff80001186a548 x12: 0000000000000000 [ 0.000000] x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 [ 0.000000] x8 : ffff8000115c9000 x7 : 737520737968705f x6 : ffff800011b62ef8 [ 0.000000] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 [ 0.000000] x2 : 0000000000000000 x1 : ffff80001159585e x0 : 0000000000000058 [ 0.000000] Call trace: [ 0.000000] __virt_to_phys+0x58/0x68 [ 0.000000] check_usemap_section_nr+0x50/0xfc [ 0.000000] sparse_init_nid+0x1ac/0x28c [ 0.000000] sparse_init+0x1c4/0x1e0 [ 0.000000] bootmem_init+0x60/0x90 [ 0.000000] setup_arch+0x184/0x1f0 [ 0.000000] start_kernel+0x78/0x488 [ 0.000000] ---[ end trace f68728a0d3053b60 ]---[1] https://lore.kernel.org/patchwork/patch/1425110/
Change since v1:
- usememblock_alloc()to createpglist_datawhenCONFIG_NUMA=nMiles Chen (2):
mm: introduceprepare_node_data
mm: replacecontig_page_datawithnode_dataDocumentation/admin-guide/kdump/vmcoreinfo.rst | 13 ------------- arch/powerpc/kexec/core.c | 5 ----- include/linux/gfp.h | 3 --- include/linux/mm.h | 2 ++ include/linux/mmzone.h | 4 ++-- kernel/crash_core.c | 1 - mm/memblock.c | 3 +-- mm/page_alloc.c | 16 ++++++++++++++++ mm/sparse.c | 2 ++ 9 files changed, 23 insertions(+), 26 deletions(-)base-commit:
8ac91e6c6033ebc12c5c1e4aa171b81a662bd70fSignature · 1 line
2.18.0
Signature · 7 lines
Sincerely yours, Mike. _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 19 lines · Mike Rapoport
Hello Miles,
Quoted 8 lines · Miles Chen
This patches is created to fix the
__pa()warning messages whenCONFIG_DEBUG_VIRTUAL=yby unifying the allocation ofpglist_datainstances.In current implementation of
node_data, ifCONFIG_NEED_MULTIPLE_NODES=y,pglist_datais allocated by a memblock API. IfCONFIG_NEED_MULTIPLE_NODES=n, we use a global variable named "contig_page_data".Quoted 7 lines
If
CONFIG_DEBUG_VIRTUALis not enabled.__pa()can handle both allocation and symbol cases. But ifCONFIG_DEBUG_VIRTUALis set, we will have the "virt_to_physused for non-linear address" warning when booting.To fix the warning, always allocate
pglist_databy memblock APIs and remove the usage ofcontig_page_data.
Quoted 6 lines
Somehow I was sure that we can allocate
pglist_databefore it is accessed insparse_init()somewhere outsidemm/sparse.c. It's really not the case and having two places that may allocated this structure is surely worth than your previous suggestion.Sorry about that.
Do you mean taht to call allocation function arch/*, somewhere after paging_init() (so we can access pglist_data) and before sparse_init() and free_area_init()?
Miles
Quoted 53 lines
Quoted 53 lines
Warning message:
[ 0.000000] ------------[ cut here ]------------ [ 0.000000] virt_to_phys used for non-linear address: (____ptrval____) (contig_page_data+0x0/0x1c00) [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x58/0x68 [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.13.0-rc1-00074-g1140ab592e2e #3 [ 0.000000] Hardware name: linux,dummy-virt (DT) [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--) [ 0.000000] pc : __virt_to_phys+0x58/0x68 [ 0.000000] lr : __virt_to_phys+0x54/0x68 [ 0.000000] sp : ffff800011833e70 [ 0.000000] x29: ffff800011833e70 x28: 00000000418a0018 x27: 0000000000000000 [ 0.000000] x26: 000000000000000a x25: ffff800011b70000 x24: ffff800011b70000 [ 0.000000] x23: fffffc0001c00000 x22: ffff800011b70000 x21: 0000000047ffffb0 [ 0.000000] x20: 0000000000000008 x19: ffff800011b082c0 x18: ffffffffffffffff [ 0.000000] x17: 0000000000000000 x16: ffff800011833bf9 x15: 0000000000000004 [ 0.000000] x14: 0000000000000fff x13: ffff80001186a548 x12: 0000000000000000 [ 0.000000] x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 [ 0.000000] x8 : ffff8000115c9000 x7 : 737520737968705f x6 : ffff800011b62ef8 [ 0.000000] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 [ 0.000000] x2 : 0000000000000000 x1 : ffff80001159585e x0 : 0000000000000058 [ 0.000000] Call trace: [ 0.000000] __virt_to_phys+0x58/0x68 [ 0.000000] check_usemap_section_nr+0x50/0xfc [ 0.000000] sparse_init_nid+0x1ac/0x28c [ 0.000000] sparse_init+0x1c4/0x1e0 [ 0.000000] bootmem_init+0x60/0x90 [ 0.000000] setup_arch+0x184/0x1f0 [ 0.000000] start_kernel+0x78/0x488 [ 0.000000] ---[ end trace f68728a0d3053b60 ]---Change since v1:
- usememblock_alloc()to createpglist_datawhenCONFIG_NUMA=nMiles Chen (2):
mm: introduceprepare_node_data
mm: replacecontig_page_datawithnode_dataDocumentation/admin-guide/kdump/vmcoreinfo.rst | 13 ------------- arch/powerpc/kexec/core.c | 5 ----- include/linux/gfp.h | 3 --- include/linux/mm.h | 2 ++ include/linux/mmzone.h | 4 ++-- kernel/crash_core.c | 1 - mm/memblock.c | 3 +-- mm/page_alloc.c | 16 ++++++++++++++++ mm/sparse.c | 2 ++ 9 files changed, 23 insertions(+), 26 deletions(-)
Quoted 5 lines
Quoted 4 lines
base-commit:
8ac91e6c6033ebc12c5c1e4aa171b81a662bd70fSignature · 1 line
2.18.0
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Mike Rapoport
maintainerQuoted 25 lines · Miles Chen
Quoted 24 lines · Mike Rapoport
Hello Miles,
Quoted 8 lines · Miles Chen
This patches is created to fix the
__pa()warning messages whenCONFIG_DEBUG_VIRTUAL=yby unifying the allocation ofpglist_datainstances.In current implementation of
node_data, ifCONFIG_NEED_MULTIPLE_NODES=y,pglist_datais allocated by a memblock API. IfCONFIG_NEED_MULTIPLE_NODES=n, we use a global variable named "contig_page_data".Quoted 7 lines
If
CONFIG_DEBUG_VIRTUALis not enabled.__pa()can handle both allocation and symbol cases. But ifCONFIG_DEBUG_VIRTUALis set, we will have the "virt_to_physused for non-linear address" warning when booting.To fix the warning, always allocate
pglist_databy memblock APIs and remove the usage ofcontig_page_data.Somehow I was sure that we can allocate
pglist_databefore it is accessed insparse_init()somewhere outsidemm/sparse.c. It's really not the case and having two places that may allocated this structure is surely worth than your previous suggestion.
Quoted 5 lines
Quoted 1 line
Sorry about that.
Do you mean taht to call allocation function
arch/*, somewhere afterpaging_init()(so we can accesspglist_data) and beforesparse_init()andfree_area_init()?
No, I meant that your original patch is better than adding allocation of NODE_DATA(0) in two places.
Quoted 61 lines
Miles
Quoted 58 lines
Quoted 57 lines
Warning message:
[ 0.000000] ------------[ cut here ]------------ [ 0.000000] virt_to_phys used for non-linear address: (____ptrval____) (contig_page_data+0x0/0x1c00) [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x58/0x68 [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.13.0-rc1-00074-g1140ab592e2e #3 [ 0.000000] Hardware name: linux,dummy-virt (DT) [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--) [ 0.000000] pc : __virt_to_phys+0x58/0x68 [ 0.000000] lr : __virt_to_phys+0x54/0x68 [ 0.000000] sp : ffff800011833e70 [ 0.000000] x29: ffff800011833e70 x28: 00000000418a0018 x27: 0000000000000000 [ 0.000000] x26: 000000000000000a x25: ffff800011b70000 x24: ffff800011b70000 [ 0.000000] x23: fffffc0001c00000 x22: ffff800011b70000 x21: 0000000047ffffb0 [ 0.000000] x20: 0000000000000008 x19: ffff800011b082c0 x18: ffffffffffffffff [ 0.000000] x17: 0000000000000000 x16: ffff800011833bf9 x15: 0000000000000004 [ 0.000000] x14: 0000000000000fff x13: ffff80001186a548 x12: 0000000000000000 [ 0.000000] x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 [ 0.000000] x8 : ffff8000115c9000 x7 : 737520737968705f x6 : ffff800011b62ef8 [ 0.000000] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 [ 0.000000] x2 : 0000000000000000 x1 : ffff80001159585e x0 : 0000000000000058 [ 0.000000] Call trace: [ 0.000000] __virt_to_phys+0x58/0x68 [ 0.000000] check_usemap_section_nr+0x50/0xfc [ 0.000000] sparse_init_nid+0x1ac/0x28c [ 0.000000] sparse_init+0x1c4/0x1e0 [ 0.000000] bootmem_init+0x60/0x90 [ 0.000000] setup_arch+0x184/0x1f0 [ 0.000000] start_kernel+0x78/0x488 [ 0.000000] ---[ end trace f68728a0d3053b60 ]---Change since v1:
- usememblock_alloc()to createpglist_datawhenCONFIG_NUMA=nMiles Chen (2):
mm: introduceprepare_node_data
mm: replacecontig_page_datawithnode_dataDocumentation/admin-guide/kdump/vmcoreinfo.rst | 13 ------------- arch/powerpc/kexec/core.c | 5 ----- include/linux/gfp.h | 3 --- include/linux/mm.h | 2 ++ include/linux/mmzone.h | 4 ++-- kernel/crash_core.c | 1 - mm/memblock.c | 3 +-- mm/page_alloc.c | 16 ++++++++++++++++ mm/sparse.c | 2 ++ 9 files changed, 23 insertions(+), 26 deletions(-)base-commit:
8ac91e6c6033ebc12c5c1e4aa171b81a662bd70fSignature · 1 line
2.18.0
Signature · 7 lines
Sincerely yours, Mike. _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 26 lines · Mike Rapoport
Quoted 25 lines · Miles Chen
Quoted 24 lines · Mike Rapoport
Hello Miles,
Quoted 8 lines · Miles Chen
This patches is created to fix the
__pa()warning messages whenCONFIG_DEBUG_VIRTUAL=yby unifying the allocation ofpglist_datainstances.In current implementation of
node_data, ifCONFIG_NEED_MULTIPLE_NODES=y,pglist_datais allocated by a memblock API. IfCONFIG_NEED_MULTIPLE_NODES=n, we use a global variable named "contig_page_data".Quoted 7 lines
If
CONFIG_DEBUG_VIRTUALis not enabled.__pa()can handle both allocation and symbol cases. But ifCONFIG_DEBUG_VIRTUALis set, we will have the "virt_to_physused for non-linear address" warning when booting.To fix the warning, always allocate
pglist_databy memblock APIs and remove the usage ofcontig_page_data.Somehow I was sure that we can allocate
pglist_databefore it is accessed insparse_init()somewhere outsidemm/sparse.c. It's really not the case and having two places that may allocated this structure is surely worth than your previous suggestion.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Sorry about that.
Do you mean taht to call allocation function
arch/*, somewhere afterpaging_init()(so we can accesspglist_data) and beforesparse_init()andfree_area_init()?No, I meant that your original patch is better than adding allocation of
NODE_DATA(0)in two places.
Got it. will you re-review the original patch?
Quoted 56 lines
Quoted 56 lines
Miles
Quoted 53 lines
Quoted 53 lines
Warning message:
[ 0.000000] ------------[ cut here ]------------ [ 0.000000] virt_to_phys used for non-linear address: (____ptrval____) (contig_page_data+0x0/0x1c00) [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x58/0x68 [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.13.0-rc1-00074-g1140ab592e2e #3 [ 0.000000] Hardware name: linux,dummy-virt (DT) [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--) [ 0.000000] pc : __virt_to_phys+0x58/0x68 [ 0.000000] lr : __virt_to_phys+0x54/0x68 [ 0.000000] sp : ffff800011833e70 [ 0.000000] x29: ffff800011833e70 x28: 00000000418a0018 x27: 0000000000000000 [ 0.000000] x26: 000000000000000a x25: ffff800011b70000 x24: ffff800011b70000 [ 0.000000] x23: fffffc0001c00000 x22: ffff800011b70000 x21: 0000000047ffffb0 [ 0.000000] x20: 0000000000000008 x19: ffff800011b082c0 x18: ffffffffffffffff [ 0.000000] x17: 0000000000000000 x16: ffff800011833bf9 x15: 0000000000000004 [ 0.000000] x14: 0000000000000fff x13: ffff80001186a548 x12: 0000000000000000 [ 0.000000] x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 [ 0.000000] x8 : ffff8000115c9000 x7 : 737520737968705f x6 : ffff800011b62ef8 [ 0.000000] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 [ 0.000000] x2 : 0000000000000000 x1 : ffff80001159585e x0 : 0000000000000058 [ 0.000000] Call trace: [ 0.000000] __virt_to_phys+0x58/0x68 [ 0.000000] check_usemap_section_nr+0x50/0xfc [ 0.000000] sparse_init_nid+0x1ac/0x28c [ 0.000000] sparse_init+0x1c4/0x1e0 [ 0.000000] bootmem_init+0x60/0x90 [ 0.000000] setup_arch+0x184/0x1f0 [ 0.000000] start_kernel+0x78/0x488 [ 0.000000] ---[ end trace f68728a0d3053b60 ]---Change since v1:
- usememblock_alloc()to createpglist_datawhenCONFIG_NUMA=nMiles Chen (2):
mm: introduceprepare_node_data
mm: replacecontig_page_datawithnode_dataDocumentation/admin-guide/kdump/vmcoreinfo.rst | 13 ------------- arch/powerpc/kexec/core.c | 5 ----- include/linux/gfp.h | 3 --- include/linux/mm.h | 2 ++ include/linux/mmzone.h | 4 ++-- kernel/crash_core.c | 1 - mm/memblock.c | 3 +-- mm/page_alloc.c | 16 ++++++++++++++++ mm/sparse.c | 2 ++ 9 files changed, 23 insertions(+), 26 deletions(-)
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
base-commit:
8ac91e6c6033ebc12c5c1e4aa171b81a662bd70fSignature · 1 line
2.18.0
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec