On Mon, Apr 28, 2025 at 10:33:46PM +0530, Donet Tom wrote:
During node device initialization, `memory blocks` are registered underHi Donet,
each NUMA node. The `memory blocks` to be registered are identified using
the node’s start and end PFNs, which are obtained from the node's pg_data
Test Results on My system with 32TB RAMThat is pretty impressive.
=======================================
1. Boot time with CONFIG_DEFERRED_STRUCT_PAGE_INIT enabled.
Without this patch
------------------
Startup finished in 1min 16.528s (kernel)
With this patch
---------------
Startup finished in 17.236s (kernel) - 78% Improvement
+void register_memory_blocks_under_node_early(int nid)I would just mention what David already said here, reduce identation,
+{
+ struct memblock_region *r;
+ unsigned long start_block_id;
+ unsigned long end_block_id;
+ struct memory_block *mem;
+ unsigned long block_id;
+
+ for_each_mem_region(r) {
+ if (r->nid == nid) {
+ start_block_id = phys_to_block_id(r->base);
+ end_block_id = phys_to_block_id(r->base + r->size - 1);
+
+ for (block_id = start_block_id; block_id <= end_block_id; block_id++) {
+ mem = find_memory_block_by_id(block_id);
+ if (!mem)
+ continue;
and maybe declare the variables where they are needed. It might be clearer.
+I will comment on the "context" on patch#2.
+ do_register_memory_block_under_node(nid, mem, MEMINIT_EARLY);
+ put_device(&mem->dev);
+void register_memory_blocks_under_node_early(int nid);static void ... ?