mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends.patch removed from -mm tree
The patch titled
Subject: mm/memory_hotplug: prepare passing flags to add_memory() and friends
has been removed from the -mm tree. Its filename was
mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: David Hildenbrand <[email protected]>
Subject: mm/memory_hotplug: prepare passing flags to add_memory() and friends
We soon want to pass flags, e.g., to mark added System RAM resources. mergeable. Prepare for that.
This patch is based on a similar patch by Oscar Salvador:
https://lkml.kernel.org/r/[email protected]
Signed-off-by David Hildenbrand <[email protected]>
Acked-by Wei Liu <[email protected]>
Reviewed-by Pankaj Gupta <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Dan Williams <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Baoquan He <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Vishal Verma <[email protected]>
Cc Dave Jiang <[email protected]>
Cc "K. Y. Srinivasan" <[email protected]>
Cc Haiyang Zhang <[email protected]>
Cc Stephen Hemminger <[email protected]>
Cc Wei Liu <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Jason Wang <[email protected]>
Cc Boris Ostrovsky <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc "Oliver O'Halloran" <[email protected]>
Cc Pingfan Liu <[email protected]>
Cc Nathan Lynch <[email protected]>
Cc Libor Pechacek <[email protected]>
Cc Anton Blanchard <[email protected]>
Cc Leonardo Bras <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Eric Biederman <[email protected]>
Cc Julien Grall <[email protected]>
Cc Kees Cook <[email protected]>
Cc Roger Pau Monné <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Wei Yang <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
arch/powerpc/platforms/powernv/memtrace.c | 2 - arch/powerpc/platforms/pseries/hotplug-memory.c | 2 - drivers/acpi/acpi_memhotplug.c | 3 +- drivers/base/memory.c | 3 +- drivers/dax/kmem.c | 2 - drivers/hv/hv_balloon.c | 2 - drivers/s390/char/sclp_cmd.c | 2 - drivers/virtio/virtio_mem.c | 2 - drivers/xen/balloon.c | 2 - include/linux/memory_hotplug.h | 16 ++++++++++---- mm/memory_hotplug.c | 14 ++++++------ 11 files changed, 30 insertions(+), 20 deletions(-)
arch/powerpc/platforms/powernv/memtrace.c renamed from arch/powerpc/platforms/powernv/memtrace.c~mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends +1 -1
@@ -224,7 +224,7 @@ static int memtrace_online(void) ent->mem =0 ; } -if (add_memory (ent->nid, ent->start, ent->size)) { +if (add_memory (ent->nid, ent->start, ent->size,MHP_NONE )) {pr_err ("Failed to add trace memory to node %d\n" , ent->nid); ret +=1 ;
arch/powerpc/platforms/pseries/hotplug-memory.c renamed from arch/powerpc/platforms/pseries/hotplug-memory.c~mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends +1 -1
@@ -606,7 +606,7 @@ static int dlpar_add_lmb(struct drmem_lm block_sz =memory_block_size_bytes ();/* Add the memory */ - rc =__add_memory (lmb->nid, lmb->base_addr, block_sz); + rc =__add_memory (lmb->nid, lmb->base_addr, block_sz,MHP_NONE );if (rc) {invalidate_lmb_associativity_index (lmb);return rc;
drivers/acpi/acpi_memhotplug.c renamed from drivers/acpi/acpi_memhotplug.c~mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends +2 -1
@@ -194,7 +194,8 @@ static int acpi_memory_enable_device(strif (node <0 ) node =memory_add_physaddr_to_nid (info->start_addr); - result =__add_memory (node, info->start_addr, info->length); + result =__add_memory (node, info->start_addr, info->length, +MHP_NONE );/* * If the memory block has been used by the kernel, add_memory()
drivers/base/memory.c renamed from drivers/base/memory.c~mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends +2 -1
@@ -432,7 +432,8 @@ static ssize_t probe_store(struct device nid =memory_add_physaddr_to_nid (phys_addr); ret =__add_memory (nid, phys_addr, -MIN_MEMORY_BLOCK_SIZE * sections_per_block); +MIN_MEMORY_BLOCK_SIZE * sections_per_block, +MHP_NONE );if (ret) goto out;
drivers/dax/kmem.c renamed from drivers/dax/kmem.c~mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends +1 -1
@@ -109,7 +109,7 @@ static int dev_dax_kmem_probe(struct dev* this as RAM automatically. */ rc =add_memory_driver_managed (numa_node, range.start, -range_len (&range), kmem_name); +range_len (&range), kmem_name,MHP_NONE );if (rc) { dev_warn(dev, "mapping%d: %#llx-%#llx memory add failed\n",
drivers/hv/hv_balloon.c renamed from drivers/hv/hv_balloon.c~mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends +1 -1
@@ -726,7 +726,7 @@ static void hv_mem_hot_add(unsigned long nid =memory_add_physaddr_to_nid (PFN_PHYS (start_pfn)); ret =add_memory (nid,PFN_PHYS ((start_pfn)), - (HA_CHUNK <<PAGE_SHIFT )); + (HA_CHUNK <<PAGE_SHIFT ),MHP_NONE );if (ret) {pr_err ("hot_add memory failed error is %d\n" , ret);
drivers/s390/char/sclp_cmd.c renamed from drivers/s390/char/sclp_cmd.c~mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends +1 -1
@@ -406,7 +406,7 @@ static void __init add_memory_merged(u16if (!size) goto skip_add;for (addr = start; addr < start + size; addr += block_size) -add_memory (0 , addr, block_size); +add_memory (0 , addr, block_size,MHP_NONE ); skip_add: first_rn = rn; num =1 ;
drivers/virtio/virtio_mem.c renamed from drivers/virtio/virtio_mem.c~mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends +1 -1
@@ -424,7 +424,7 @@ static int virtio_mem_mb_add(struct virtdev_dbg (&vm->vdev->dev,"adding memory block: %lu\n" , mb_id);return add_memory_driver_managed (nid, addr,memory_block_size_bytes (), - vm->resource_name); + vm->resource_name,MHP_NONE ); }/*
drivers/xen/balloon.c renamed from drivers/xen/balloon.c~mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends +1 -1
@@ -331,7 +331,7 @@ static enum bp_state reserve_additional_mutex_unlock (&balloon_mutex);/* add_memory_resource() requires the device_hotplug lock */ lock_device_hotplug (); - rc =add_memory_resource (nid, resource); + rc =add_memory_resource (nid, resource,MHP_NONE );unlock_device_hotplug ();mutex_lock (&balloon_mutex);
include/linux/memory_hotplug.h renamed from include/linux/memory_hotplug.h~mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends +12 -4
@@ -57,6 +57,12 @@ enum { MMOP_ONLINE_MOVABLE, }; +/* Flags for add_memory() and friends to specify memory hotplug details. */ +typedef int __bitwise mhp_t ; + +/* No special request */ +#define MHP_NONE ((__force mhp_t)0) +/* * Extended parameters for memory hotplug: * altmap: alternative allocator for memmap array (optional)
@@ -339,11 +345,13 @@ extern void clear_zone_contiguous(struct#ifdef CONFIG_MEMORY_HOTPLUG extern void __ref free_area_init_core_hotplug (int nid); -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); +extern int __add_memory (int nid,u64 start,u64 size,mhp_t mhp_flags); +extern int add_memory (int nid,u64 start,u64 size,mhp_t mhp_flags); +extern int add_memory_resource (int nid,struct resource *resource, +mhp_t mhp_flags);extern int add_memory_driver_managed (int nid,u64 start,u64 size, -const char *resource_name); +const char *resource_name, +mhp_t mhp_flags);extern void move_pfn_range_to_zone (struct zone *zone,unsigned long start_pfn,unsigned long nr_pages,struct vmem_altmap *altmap,int migratetype);
mm/memory_hotplug.c renamed from mm/memory_hotplug.c~mm-memory_hotplug-prepare-passing-flags-to-add_memory-and-friends +7 -7
@@ -1039,7 +1039,7 @@ static int online_memory_block(struct me* * we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */ -int __ref add_memory_resource (int nid,struct resource *res) +int __ref add_memory_resource (int nid,struct resource *res,mhp_t mhp_flags) {struct mhp_params params = { .pgprot =PAGE_KERNEL };u64 start, size;
@@ -1119,7 +1119,7 @@ error: }/* requires device_hotplug_lock, see add_memory_resource() */ -int __ref __add_memory (int nid,u64 start,u64 size) +int __ref __add_memory (int nid,u64 start,u64 size,mhp_t mhp_flags) {struct resource *res;int ret;
@@ -1128,18 +1128,18 @@ int __ref __add_memory(int nid, u64 starif (IS_ERR (res))return PTR_ERR (res); - ret =add_memory_resource (nid, res); + ret =add_memory_resource (nid, res, mhp_flags);if (ret <0 )release_memory_resource (res);return ret; } -int add_memory (int nid,u64 start,u64 size) +int add_memory (int nid,u64 start,u64 size,mhp_t mhp_flags) {int rc;lock_device_hotplug (); - rc =__add_memory (nid, start, size); + rc =__add_memory (nid, start, size, mhp_flags);unlock_device_hotplug ();return rc;
@@ -1168,7 +1168,7 @@ EXPORT_SYMBOL_GPL(add_memory);* "System RAM ($DRIVER)". */ int add_memory_driver_managed (int nid,u64 start,u64 size, -const char *resource_name) +const char *resource_name,mhp_t mhp_flags) {struct resource *res;int rc;
@@ -1186,7 +1186,7 @@ int add_memory_driver_managed(int nid, u goto out_unlock; } - rc =add_memory_resource (nid, res); + rc =add_memory_resource (nid, res, mhp_flags);if (rc <0 )release_memory_resource (res);
_
Patches currently in -mm which might be from [email protected] are