Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3772409pxb; Tue, 26 Jan 2021 04:31:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxugjxuIVF2Nxr4BBWFE8+aP+MMiLk2/mPqsn5EQDbNUlABbOituu+W31fd5S8CB4QRy9mS X-Received: by 2002:a05:6402:5107:: with SMTP id m7mr4368852edd.52.1611664304511; Tue, 26 Jan 2021 04:31:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611664304; cv=none; d=google.com; s=arc-20160816; b=fgFAVv9tJ5uaN/SiVVd+lcRjB/AGGaSWO3JplBzhUjInzGxcx6Pi6lfdQZJ3W+orSC yXd+tLLwPMkbR8N0OJnGl1YaGqNsgi2CAz2sQxWQ6/cyZTiFOgWaEv/Ws/+wqsR1/Uq3 vIL3sx5VdGEPUxou2R5r+2gVzPB23/w65klhgCWfirMrLX12lHtJsW4FAkp24rgwG19f sR2BH+MpSwfllokGf23OsH4VsCXU60a81swJSIOTkZpSOe8yNCHCSs+I2WPEIKL6A2Wl PlCPF3bbLffh0+wUzmvbzPc9LzQza8YBeu+bYASdpFYkAcIioeAL+DVquoc+mKX03DCP NAng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=RtgaCgb/WrvBTvUtwXZ4ekY836CqYO/bqbVXgn5DkdA=; b=SaZTdreMyt6pHsH0UrahCiGA9RALfyQ4sxaVPIEJ5arnjH0/ZuVr6hkiHTHz3aikhF w3S246T5lUThZs3hhHqeh2t53x2hUgKKNR5+ao6p9d4AQttAm/L+8hzEiGx+DGIGJurw oeV8eoyynroIRWvV0u4zQgvkwVYqaN+i9ShsDMxlrZeLrPhmsejhqZOYy5GKCOu5HHXO uI3qpQ7KEwRWBt5HddWZqvUivCH+/QQCnHQbNo9oz59wWxeI1xvMyMWrPhAT5z74AxqP hhatkfaerfl2fk1PMEQlbvXopoPVrMUUMQu3IvGFehEWZ3cQKyYVbJSfU0ax4298xFe1 FZIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d25si7110555edx.430.2021.01.26.04.31.20; Tue, 26 Jan 2021 04:31:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404553AbhAZM2r (ORCPT + 99 others); Tue, 26 Jan 2021 07:28:47 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11598 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404402AbhAZM2g (ORCPT ); Tue, 26 Jan 2021 07:28:36 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DQ5Z86PRDz15yYC; Tue, 26 Jan 2021 20:26:24 +0800 (CST) Received: from [10.174.179.117] (10.174.179.117) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Tue, 26 Jan 2021 20:27:32 +0800 Subject: Re: [PATCH v1] mm/memory_hotplug: MEMHP_MERGE_RESOURCE -> MHP_MERGE_RESOURCE To: David Hildenbrand CC: , Andrew Morton , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , "Michael S. Tsirkin" , Jason Wang , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Pankaj Gupta , Michal Hocko , "Oscar Salvador" , Anshuman Khandual , Wei Yang , , , , linux-kernel References: <20210126115829.10909-1-david@redhat.com> From: Miaohe Lin Message-ID: <9a7a0057-85ac-c7cf-1c2d-88671de4d947@huawei.com> Date: Tue, 26 Jan 2021 20:27:31 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210126115829.10909-1-david@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.117] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/1/26 19:58, David Hildenbrand wrote: > 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/ > > Cc: Andrew Morton > Cc: "K. Y. Srinivasan" > Cc: Haiyang Zhang > Cc: Stephen Hemminger > Cc: Wei Liu > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Boris Ostrovsky > Cc: Juergen Gross > Cc: Stefano Stabellini > Cc: Pankaj Gupta > Cc: Michal Hocko > Cc: Oscar Salvador > Cc: Anshuman Khandual > Cc: Wei Yang > Cc: linux-hyperv@vger.kernel.org > Cc: virtualization@lists.linux-foundation.org > Cc: xen-devel@lists.xenproject.org> Signed-off-by: David Hildenbrand Reviewed-by: Miaohe Lin > --- > drivers/hv/hv_balloon.c | 2 +- > drivers/virtio/virtio_mem.c | 2 +- > drivers/xen/balloon.c | 2 +- > include/linux/memory_hotplug.h | 2 +- > mm/memory_hotplug.c | 2 +- > 5 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c > index 8c471823a5af..2f776d78e3c1 100644 > --- a/drivers/hv/hv_balloon.c > +++ b/drivers/hv/hv_balloon.c > @@ -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); > diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c > index 85a272c9978e..148bea39b09a 100644 > --- a/drivers/virtio/virtio_mem.c > +++ b/drivers/virtio/virtio_mem.c > @@ -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); > diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c > index b57b2067ecbf..671c71245a7b 100644 > --- a/drivers/xen/balloon.c > +++ b/drivers/xen/balloon.c > @@ -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); > > diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h > index 3d99de0db2dd..4b834f5d032e 100644 > --- a/include/linux/memory_hotplug.h > +++ b/include/linux/memory_hotplug.h > @@ -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: > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index 710e469fb3a1..ae497e3ff77c 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -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 */ >