Thread (30 messages) 30 messages, 4 authors, 2026-02-05

Re: [PATCH 1/9] mm/memory_hotplug: pass online_type to online_memory_block() via arg

From: Gregory Price <gourry@gourry.net>
Date: 2026-02-02 17:46:28
Also in: linux-cxl, linux-fsdevel, linux-mm, lkml, nvdimm

On Mon, Feb 02, 2026 at 05:10:29PM +0000, Jonathan Cameron wrote:
On Thu, 29 Jan 2026 16:04:34 -0500
Gregory Price [off-list ref] wrote:
quoted
Modify online_memory_block() to accept the online type through its arg
parameter rather than calling mhp_get_default_online_type() internally.
This prepares for allowing callers to specify explicit online types.

Update the caller in add_memory_resource() to pass the default online
type via a local variable.

No functional change.

Cc: Oscar Salvador <osalvador@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
Signed-off-by: Gregory Price <gourry@gourry.net>
Trivial comment inline. I don't really care either way.
Pushing the policy up to the caller and ensuring it's explicitly constant
for all the memory blocks (as opposed to relying on locks) seems sensible to me
even without anything else.
quoted
 
 	/* online pages if requested */
-	if (mhp_get_default_online_type() != MMOP_OFFLINE)
-		walk_memory_blocks(start, size, NULL, online_memory_block);
+	if (mhp_get_default_online_type() != MMOP_OFFLINE) {
+		int online_type = mhp_get_default_online_type();
Maybe move the local variable outside the loop to avoid the double call.
ack.  will update for next version w/ Ben's notes and the build fix.

Thanks!
~Gregory
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help