mm/memory_hotplug: MEMHP_MERGE_RESOURCE -> MHP_MERGE_RESOURCE
authorDavid Hildenbrand <david@redhat.com>
Fri, 26 Feb 2021 01:17:17 +0000 (17:17 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Feb 2021 17:41:00 +0000 (09:41 -0800)
Let's make "MEMHP_MERGE_RESOURCE" consistent with "MHP_NONE", "mhp_t" and
"mhp_flags".  As discussed recently [1], "mhp" is our internal acronym for
memory hotplug now.

[1] https://lore.kernel.org/linux-mm/c37de2d0-28a1-4f7d-f944-cfd7d81c334d@redhat.com/

Link: https://lkml.kernel.org/r/20210126115829.10909-1-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Acked-by: Wei Liu <wei.liu@kernel.org>
Reviewed-by: Pankaj Gupta <pankaj.gupta@cloud.ionos.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Wei Yang <richard.weiyang@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/hv/hv_balloon.c
drivers/virtio/virtio_mem.c
drivers/xen/balloon.c
include/linux/memory_hotplug.h
mm/memory_hotplug.c

index 8c471823a5afa8d46a7292e49dfc8f44923080a2..2f776d78e3c1a27740d4517363d8525bd19e89f9 100644 (file)
@@ -726,7 +726,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size,
 
                nid = memory_add_physaddr_to_nid(PFN_PHYS(start_pfn));
                ret = add_memory(nid, PFN_PHYS((start_pfn)),
-                               (HA_CHUNK << PAGE_SHIFT), MEMHP_MERGE_RESOURCE);
+                               (HA_CHUNK << PAGE_SHIFT), MHP_MERGE_RESOURCE);
 
                if (ret) {
                        pr_err("hot_add memory failed error is %d\n", ret);
index 9fc9ec4a25f56a10c57754b436b0096bc4b1ded6..d44e43869f17e112bed16dc236f598d9f5b1721c 100644 (file)
@@ -623,7 +623,7 @@ static int virtio_mem_add_memory(struct virtio_mem *vm, uint64_t addr,
        /* Memory might get onlined immediately. */
        atomic64_add(size, &vm->offline_size);
        rc = add_memory_driver_managed(vm->nid, addr, size, vm->resource_name,
-                                      MEMHP_MERGE_RESOURCE);
+                                      MHP_MERGE_RESOURCE);
        if (rc) {
                atomic64_sub(size, &vm->offline_size);
                dev_warn(&vm->vdev->dev, "adding memory failed: %d\n", rc);
index b57b2067ecbfb86e19df7ef3826c9b7b7c34b287..671c71245a7b2f6c2e985c81b8c5c9b5bd1e9bcf 100644 (file)
@@ -331,7 +331,7 @@ static enum bp_state reserve_additional_memory(void)
        mutex_unlock(&balloon_mutex);
        /* add_memory_resource() requires the device_hotplug lock */
        lock_device_hotplug();
-       rc = add_memory_resource(nid, resource, MEMHP_MERGE_RESOURCE);
+       rc = add_memory_resource(nid, resource, MHP_MERGE_RESOURCE);
        unlock_device_hotplug();
        mutex_lock(&balloon_mutex);
 
index ca5e8d137726a0d7b0860f7e731b53c38906812a..08eeef679ab765fe632685436f333ec43ccab511 100644 (file)
@@ -53,7 +53,7 @@ typedef int __bitwise mhp_t;
  * with this flag set, the resource pointer must no longer be used as it
  * might be stale, or the resource might have changed.
  */
-#define MEMHP_MERGE_RESOURCE   ((__force mhp_t)BIT(0))
+#define MHP_MERGE_RESOURCE     ((__force mhp_t)BIT(0))
 
 /*
  * Extended parameters for memory hotplug:
index ac1c686a59898d0fae16333157f9b0372b4b46aa..6a02c3f42717e3864a86e46e56acc9440f2c8789 100644 (file)
@@ -1153,7 +1153,7 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags)
         * In case we're allowed to merge the resource, flag it and trigger
         * merging now that adding succeeded.
         */
-       if (mhp_flags & MEMHP_MERGE_RESOURCE)
+       if (mhp_flags & MHP_MERGE_RESOURCE)
                merge_system_ram_resource(res);
 
        /* online pages if requested */