Commit f29d8e9c authored by David Hildenbrand's avatar David Hildenbrand Committed by Linus Torvalds

mm/memory_hotplug: drop "online" parameter from add_memory_resource()

Userspace should always be in charge of how to online memory and if memory
should be onlined automatically in the kernel.  Let's drop the parameter
to overwrite this - XEN passes memhp_auto_online, just like add_memory(),
so we can directly use that instead internally.

Link: http://lkml.kernel.org/r/20181123123740.27652-1-david@redhat.comSigned-off-by: default avatarDavid Hildenbrand <david@redhat.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Reviewed-by: default avatarOscar Salvador <osalvador@suse.de>
Acked-by: default avatarJuergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Arun KS <arunks@codeaurora.org>
Cc: Mathieu Malaterre <malat@debian.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3b6fd6ff
...@@ -352,7 +352,7 @@ static enum bp_state reserve_additional_memory(void) ...@@ -352,7 +352,7 @@ static enum bp_state reserve_additional_memory(void)
mutex_unlock(&balloon_mutex); mutex_unlock(&balloon_mutex);
/* add_memory_resource() requires the device_hotplug lock */ /* add_memory_resource() requires the device_hotplug lock */
lock_device_hotplug(); lock_device_hotplug();
rc = add_memory_resource(nid, resource, memhp_auto_online); rc = add_memory_resource(nid, resource);
unlock_device_hotplug(); unlock_device_hotplug();
mutex_lock(&balloon_mutex); mutex_lock(&balloon_mutex);
......
...@@ -326,7 +326,7 @@ extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn, ...@@ -326,7 +326,7 @@ extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn,
void *arg, int (*func)(struct memory_block *, void *)); void *arg, int (*func)(struct memory_block *, void *));
extern int __add_memory(int nid, u64 start, u64 size); extern int __add_memory(int nid, u64 start, u64 size);
extern int add_memory(int nid, u64 start, u64 size); extern int add_memory(int nid, u64 start, u64 size);
extern int add_memory_resource(int nid, struct resource *resource, bool online); extern int add_memory_resource(int nid, struct resource *resource);
extern int arch_add_memory(int nid, u64 start, u64 size, extern int arch_add_memory(int nid, u64 start, u64 size,
struct vmem_altmap *altmap, bool want_memblock); struct vmem_altmap *altmap, bool want_memblock);
extern void move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn, extern void move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn,
......
...@@ -1078,7 +1078,7 @@ static int online_memory_block(struct memory_block *mem, void *arg) ...@@ -1078,7 +1078,7 @@ static int online_memory_block(struct memory_block *mem, void *arg)
* *
* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG * we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG
*/ */
int __ref add_memory_resource(int nid, struct resource *res, bool online) int __ref add_memory_resource(int nid, struct resource *res)
{ {
u64 start, size; u64 start, size;
bool new_node = false; bool new_node = false;
...@@ -1133,7 +1133,7 @@ int __ref add_memory_resource(int nid, struct resource *res, bool online) ...@@ -1133,7 +1133,7 @@ int __ref add_memory_resource(int nid, struct resource *res, bool online)
mem_hotplug_done(); mem_hotplug_done();
/* online pages if requested */ /* online pages if requested */
if (online) if (memhp_auto_online)
walk_memory_range(PFN_DOWN(start), PFN_UP(start + size - 1), walk_memory_range(PFN_DOWN(start), PFN_UP(start + size - 1),
NULL, online_memory_block); NULL, online_memory_block);
...@@ -1157,7 +1157,7 @@ int __ref __add_memory(int nid, u64 start, u64 size) ...@@ -1157,7 +1157,7 @@ int __ref __add_memory(int nid, u64 start, u64 size)
if (IS_ERR(res)) if (IS_ERR(res))
return PTR_ERR(res); return PTR_ERR(res);
ret = add_memory_resource(nid, res, memhp_auto_online); ret = add_memory_resource(nid, res);
if (ret < 0) if (ret < 0)
release_memory_resource(res); release_memory_resource(res);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment