mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
mm/memory_hotplug: pass online_type to online_memory_block() via arg
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. Link: https://lore.kernel.org/20260712154505.3564379-4-gourry@gourry.net Signed-off-by: Gregory Price <gourry@gourry.net> Acked-by: David Hildenbrand (Red Hat) <david@kernel.org> Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Dan Williams <djbw@kernel.org> Cc: Alison Schofield <alison.schofield@intel.com> Cc: Danilo Krummrich <dakr@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Hannes Reinecke <hare@suse.de> Cc: Liam R. Howlett <liam@infradead.org> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Oscar Salvador <osalvador@suse.de> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Shuah Khan <shuah@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vishal Verma <vishal.l.verma@intel.com> Cc: Vlastimil Babka <vbabka@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
5459c5be28
commit
65c1a93e43
|
|
@ -1340,7 +1340,9 @@ static int check_hotplug_memory_range(u64 start, u64 size)
|
|||
|
||||
static int online_memory_block(struct memory_block *mem, void *arg)
|
||||
{
|
||||
mem->online_type = mhp_get_default_online_type();
|
||||
enum mmop *online_type = arg;
|
||||
|
||||
mem->online_type = *online_type;
|
||||
return device_online(&mem->dev);
|
||||
}
|
||||
|
||||
|
|
@ -1497,6 +1499,7 @@ static int create_altmaps_and_memory_blocks(int nid, struct memory_group *group,
|
|||
int add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags)
|
||||
{
|
||||
struct mhp_params params = { .pgprot = pgprot_mhp(PAGE_KERNEL) };
|
||||
enum mmop online_type = mhp_get_default_online_type();
|
||||
enum memblock_flags memblock_flags = MEMBLOCK_NONE;
|
||||
struct memory_group *group = NULL;
|
||||
u64 start, size;
|
||||
|
|
@ -1585,7 +1588,8 @@ int add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags)
|
|||
|
||||
/* online pages if requested */
|
||||
if (mhp_get_default_online_type() != MMOP_OFFLINE)
|
||||
walk_memory_blocks(start, size, NULL, online_memory_block);
|
||||
walk_memory_blocks(start, size, &online_type,
|
||||
online_memory_block);
|
||||
|
||||
return ret;
|
||||
error:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user