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

Re: [PATCH v1 01/13] xen/arm: re-arrange the static shared memory region


  • To: Penny Zheng <Penny.Zheng@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Tue, 7 Feb 2023 15:55:09 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=tL4oMzGUrykxtEnlElUpdq9qUAZ5V2x4TGyfNNm7mFU=; b=NtVBkM4gYz+rFvX58X3KZ57sqLuTHaEQBm1Sl43+xA5lOBM3Nson4Ig9DA7fVn51PS7XRgkq7dJrnn16DoAO3NkfhaBEN0y2w7HBAUwLXMWciqdCmoQfLpKq81Cs3tzJnI6mMQ0eZgJBWAPqLhnPwN8r/6oH8LWzxyoPh4C71L3WDqiwcVbXJnRiczfRGgSwUSL4Vr/7bWdGyZKws/YkkNUGaI0y32kU+26L/8pEqmOEd+j56yCU7GiV2ilawpL4kJEd3vPUC+HhwzpPwubcjXtgwG6RdCEYaTbGeuyAwRxndHQcN8I4gf2WHx5Q4geZqBAKhPA057pvJ7hqqp9MzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cYWQmr5YD3BqK6/FHIQS06uTeprD8eCYlujPdMb4xsNFCEwV1xkzV+Z1+p1oSDny+HtLNBAKvTGPYdP2qiQi1yuWYDLss0+KabsP6XAUcFq/8c6DM36Jxs4hWS5hcADsUKzYWeDzuu+Qx2AhXSjHi/JUVgNQEOKsooemGIfYBrcrqFxs4zqJYt9nrcDJPSniVlQACnHjwVNo8/DnfXkb0C/uCx/Vdiqw5JxMVFuCV5Y9V2MWt5+1QGOnEAwGSj4pnYWd2L1UC8OTH3JxurAF5LsxN31KsJo94DTNhdrbcGDkvFROM7oiCgn8XJSTQS5PL0ZjRx0Mr4H4/ezAQcfLPQ==
  • Cc: <wei.chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 07 Feb 2023 20:55:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Penny,

On 11/14/22 21:52, Penny Zheng wrote:
> ...
> diff --git a/xen/arch/arm/include/asm/setup.h 
> b/xen/arch/arm/include/asm/setup.h
> index fdbf68aadc..2d4ae0f00a 100644
> --- a/xen/arch/arm/include/asm/setup.h
> +++ b/xen/arch/arm/include/asm/setup.h
> @@ -50,10 +50,6 @@ struct membank {
>      paddr_t start;
>      paddr_t size;
>      enum membank_type type;
> -#ifdef CONFIG_STATIC_SHM
> -    char shm_id[MAX_SHM_ID_LENGTH];
> -    unsigned int nr_shm_borrowers;
> -#endif
>  };
> 
>  struct meminfo {
> @@ -61,6 +57,17 @@ struct meminfo {
>      struct membank bank[NR_MEM_BANKS];
>  };
> 
> +struct shm_membank {
> +    char shm_id[MAX_SHM_ID_LENGTH];
> +    unsigned int nr_shm_borrowers;
> +    struct membank *membank;
> +};
> +
> +struct shm_meminfo {
> +    unsigned int nr_banks;
> +    struct shm_membank bank[NR_MEM_BANKS];
> +};
> +
>  /*
>   * The domU flag is set for kernels and ramdisks of "xen,domain" nodes.
>   * The purpose of the domU flag is to avoid getting confused in
> @@ -105,6 +112,7 @@ struct bootinfo {
>      struct meminfo acpi;
>  #endif
>      bool static_heap;
> +    struct shm_meminfo shm_mem;
>  };
> 
>  struct map_range_data

The reduction in the sizeof struct membank is a welcome improvement, in my 
opinion, because it is multiplied by NR_MEM_BANKS, and IIRC we only have 32k of 
boot stack to play with.

Before this patch:
sizeof(struct kernel_info): 20648
sizeof(struct meminfo): 10248
sizeof(struct shm_meminfo): 10248

When building with EXTRA_CFLAGS_XEN_CORE="Wstack-usage=4096 
-Wno-error=stack-usage=":
arch/arm/domain_build.c: In function ‘construct_domU’:
arch/arm/domain_build.c:3747:19: warning: stack usage is 20720 bytes 
[-Wstack-usage=]
 3747 | static int __init construct_domU(struct domain *d,
      |                   ^~~~~~~~~~~~~~
arch/arm/domain_build.c: In function ‘construct_dom0’:
arch/arm/domain_build.c:3979:19: warning: stack usage is 20688 bytes 
[-Wstack-usage=]
 3979 | static int __init construct_dom0(struct domain *d)
      |                   ^~~~~~~~~~~~~~



After this patch:
sizeof(struct kernel_info): 14504
sizeof(struct meminfo): 6152
sizeof(struct shm_meminfo): 8200

arch/arm/domain_build.c: In function ‘construct_domU’:
arch/arm/domain_build.c:3754:19: warning: stack usage is 14576 bytes 
[-Wstack-usage=]
 3754 | static int __init construct_domU(struct domain *d,
      |                   ^~~~~~~~~~~~~~
arch/arm/domain_build.c: In function ‘construct_dom0’:
arch/arm/domain_build.c:3986:19: warning: stack usage is 14544 bytes 
[-Wstack-usage=]
 3986 | static int __init construct_dom0(struct domain *d)
      |                   ^~~~~~~~~~~~~~

A later patch in this series will increase it again slightly. Note that I'm not 
expecting this series to address these particular warnings, I'm merely pointing 
out the (positive) impact of the change.



 


Rackspace

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