From: Donet Tom <donettom@linux.ibm.com>
To: Oscar Salvador <osalvador@suse.de>
Cc: Mike Rapoport <rppt@kernel.org>,
David Hildenbrand <david@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
rafael@kernel.org, Danilo Krummrich <dakr@kernel.org>,
Ritesh Harjani <ritesh.list@gmail.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Alison Schofield <alison.schofield@intel.com>,
Yury Norov <yury.norov@gmail.com>,
Dave Jiang <dave.jiang@intel.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] driver/base: Optimize memory block registration to reduce boot time
Date: Thu, 1 May 2025 19:25:43 +0530 [thread overview]
Message-ID: <719c495f-d514-43f5-814d-e956e149f836@linux.ibm.com> (raw)
In-Reply-To: <aBHTeeAWtlrt4gN8@localhost.localdomain>
On 4/30/25 1:08 PM, Oscar Salvador wrote:
> On Mon, Apr 28, 2025 at 10:33:46PM +0530, Donet Tom wrote:
>> During node device initialization, `memory blocks` are registered under
>> 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
>>
> Hi Donet,
>
>> Test Results on My system with 32TB RAM
>> =======================================
>> 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
> That is pretty impressive.
>
>> +void register_memory_blocks_under_node_early(int nid)
>> +{
>> + 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;
> I would just mention what David already said here, reduce identation,
> and maybe declare the variables where they are needed. It might be clearer.
Sure, I will change it.
>> +
>> + do_register_memory_block_under_node(nid, mem, MEMINIT_EARLY);
>> + put_device(&mem->dev);
> I will comment on the "context" on patch#2.
>
>> +void register_memory_blocks_under_node_early(int nid);
> static void ... ?
Yes, We can make it as static. I will add it in next version.
Thanks
Donet
>
>
prev parent reply other threads:[~2025-05-01 13:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 17:03 [PATCH v2 1/2] driver/base: Optimize memory block registration to reduce boot time Donet Tom
2025-04-28 17:03 ` [PATCH v2 2/2] driver/base: Remove unused functions Donet Tom
2025-04-28 21:21 ` David Hildenbrand
2025-04-29 14:07 ` Donet Tom
2025-04-30 7:48 ` Oscar Salvador
2025-05-01 13:49 ` Donet Tom
2025-05-01 15:08 ` Zi Yan
2025-05-01 15:15 ` Donet Tom
2025-04-28 21:19 ` [PATCH v2 1/2] driver/base: Optimize memory block registration to reduce boot time David Hildenbrand
2025-04-29 14:08 ` Donet Tom
2025-04-29 16:37 ` kernel test robot
2025-04-29 17:01 ` kernel test robot
2025-05-01 14:10 ` Donet Tom
2025-04-30 7:38 ` Oscar Salvador
2025-05-01 13:55 ` Donet Tom [this message]
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=719c495f-d514-43f5-814d-e956e149f836@linux.ibm.com \
--to=donettom@linux.ibm.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=alison.schofield@intel.com \
--cc=dakr@kernel.org \
--cc=dave.jiang@intel.com \
--cc=david@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=osalvador@suse.de \
--cc=rafael@kernel.org \
--cc=ritesh.list@gmail.com \
--cc=rppt@kernel.org \
--cc=yury.norov@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).