[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/9] xen/x86: introduce a helper to update memory hotplug end


  • To: Wei Chen <wei.chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 12 Jul 2022 13:53:52 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mJ9M9gmzl8bQZRaKWfY14i6pKfIwrPi7ep9GBp2G5d4=; b=jXbBQo3Q44r92YX1Zxapie07meZO8/JXZF+x5BB0CWkc+kI2RZggGZsXmqAS0GfY/VZOR6s2pv47J7vVRZkZdiFdhiLc4wJpunU7AhzyOljUtYmrl/ESyePEf6XA4PedKnBTlDi5buRq6/25yNJQzohqFDVAQx9NYSE6URZJuAdry+Ptn7QGA9FcoFVe9KBq0xieJnf3elcsgnbEVwp38dAxjOydorY1AK/mUV6BH1W1dSMPkQ32tXp9dUCiMthkCzDshLAYbDtrZjqc10xJneyO35A4WwQ6fDgFFyi0Rh93jF9JsfGVHR+74BnVbgcXpwer0HJy5OKERia9JXMDwA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OPbfYdhxewTuzkcdm0w6HkfOIS8+QyUMXppQ0w1mviK3M+oGQI5bEasNDtQBTeVEQTsq0rCfiyL8WY000jQVaEOzpsXvNGXT1atGI88IJ6OBGBJ5ugJfTqpV2vwHGc2QRRkYG1CRghKu/6Kb+i0foXWsuA543d8LAIurXKzzJgfqs/WZpaEdrgyXx2QuFAPuocEojEm6DuA2YV2eOgnsNNS6t+Ea/QlNGPvI8kJWhn73pUiwBSC0fyxibAGTYthKm063B4EjsyILiWOJizziVP726Kcp0h1BESOkUhVpE/uAkmykDnriGeJMSbFovA03fQNG0Pg2iFWtME4R8i+zpw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: nd@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 12 Jul 2022 11:54:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.07.2022 16:54, Wei Chen wrote:
> x86 provides a mem_hotplug variable to maintain the memory hotplug
> end address. We want to move some codes from x86 to common, so that
> it can be reused by other architectures. But not all architectures
> have supported memory hotplug. So in this patch, we introduce this
> helper to replace mem_hotplug direct access in these codes. This
> will give the ability of stubbing this helper to those architectures
> without memory hotplug support.

What remains unclear to me is why Arm can't simply gain the necessary
variable. Sooner or later you'll want to support hotplug there anyway,
I suppose. Mechanically the change is fine. Albeit maybe "top" instead
of "boundary", and maybe also pass "node" even if x86 doesn't need it?

Jan

> Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> ---
> v1 -> v2:
> 1. Refine the commit message.
> 2. Merge v1 patch#9,10 into one patch. Introduce the new functions
>    in the same patch that this patch will be used first time.
> 3. Fold if ( end > mem_hotplug ) to mem_hotplug_update_boundary,
>    in this case, we can drop mem_hotplug_boundary.
> ---
>  xen/arch/x86/include/asm/mm.h | 6 ++++++
>  xen/arch/x86/srat.c           | 3 +--
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
> index 07b59c982b..b3dfbdb52b 100644
> --- a/xen/arch/x86/include/asm/mm.h
> +++ b/xen/arch/x86/include/asm/mm.h
> @@ -476,6 +476,12 @@ static inline int get_page_and_type(struct page_info 
> *page,
>  
>  extern paddr_t mem_hotplug;
>  
> +static inline void mem_hotplug_update_boundary(paddr_t end)
> +{
> +    if ( end > mem_hotplug )
> +        mem_hotplug = end;
> +}
> +
>  
> /******************************************************************************
>   * With shadow pagetables, the different kinds of address start
>   * to get get confusing.
> diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
> index b62a152911..f53431f5e8 100644
> --- a/xen/arch/x86/srat.c
> +++ b/xen/arch/x86/srat.c
> @@ -418,8 +418,7 @@ acpi_numa_memory_affinity_init(const struct 
> acpi_srat_mem_affinity *ma)
>       memblk_nodeid[num_node_memblks] = node;
>       if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) {
>               __set_bit(num_node_memblks, memblk_hotplug);
> -             if (end > mem_hotplug)
> -                     mem_hotplug = end;
> +             mem_hotplug_update_boundary(end);
>       }
>       num_node_memblks++;
>  }




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.