From: David Hildenbrand <david@redhat.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: Donet Tom <donettom@linux.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
Ritesh Harjani <ritesh.list@gmail.com>,
rafael@kernel.org, Danilo Krummrich <dakr@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Alison Schofield <alison.schofield@intel.com>,
Yury Norov <yury.norov@gmail.com>,
Dave Jiang <dave.jiang@intel.com>
Subject: Re: [PATCH v4 1/4] driver/base: Optimize memory block registration to reduce boot time
Date: Fri, 16 May 2025 12:12:26 +0200 [thread overview]
Message-ID: <a3072d7f-235e-4224-9867-4cebb66ca4fb@redhat.com> (raw)
In-Reply-To: <aCcOx34j5mgiwfcx@kernel.org>
>> We'd have to be smart about memory blocks that fall into multiple regions,
>> but it should be a corner case and doable.
>
> This is a corner case that should be handled regardless of the loop order.
> And I don't think it's handled today at all.
>
> If we have a block that crosses node boundaries, current implementation of
> register_mem_block_under_node_early() will register it under the first
> node.
At least upstream behavior should be that it would be linked under all
nodes. At least that's what I remember :)
>
>> OTOH, we usually don't expect having a lot of regions, so iterating over
>> them is probably not a big bottleneck? Anyhow, just wanted to raise it.
>
> There would be at least a region per node and having
>
> for_each_online_node()
> for_each_mem_region()
>
> makes the loop O(n²) for no good reason.
Yes, that's why I mentioned it. If we have many nodes it might
definitely be relevant.
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2025-05-16 10:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 8:19 Donet Tom
2025-05-16 8:19 ` [PATCH v4 2/4] driver/base: remove register_mem_block_under_node_early() Donet Tom
2025-05-16 10:10 ` Mike Rapoport
2025-05-20 10:05 ` Oscar Salvador
2025-05-16 8:19 ` [PATCH v4 3/4] Remove register_memory_blocks_under_node() function call from register_one_node Donet Tom
2025-05-16 9:18 ` David Hildenbrand
2025-05-16 10:58 ` Donet Tom
2025-05-16 10:10 ` Mike Rapoport
2025-05-20 10:06 ` Oscar Salvador
2025-05-16 8:19 ` [PATCH v4 4/4] drivers/base : Rename register_memory_blocks_under_node() and remove context argument Donet Tom
2025-05-16 9:18 ` David Hildenbrand
2025-05-16 10:11 ` Mike Rapoport
2025-05-20 10:07 ` Oscar Salvador
2025-05-16 9:15 ` [PATCH v4 1/4] driver/base: Optimize memory block registration to reduce boot time David Hildenbrand
2025-05-16 10:09 ` Mike Rapoport
2025-05-16 10:12 ` David Hildenbrand [this message]
2025-05-16 11:00 ` Donet Tom
2025-05-16 11:00 ` Donet Tom
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=a3072d7f-235e-4224-9867-4cebb66ca4fb@redhat.com \
--to=david@redhat.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=donettom@linux.ibm.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 \
--cc=ziy@nvidia.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