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

Re: [PATCH v2 09/13] xen/arm: Reduce struct membank size on static shared memory


  • To: Luca Fancellu <luca.fancellu@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 10 Apr 2024 12:01:58 +0200
  • 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 (0)
  • 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=YnwQ/yYqH88s0p4ms1VGOnWDamEhOzWM8aaMSIYA6sM=; b=GxmbtQI6gDIUIiCE9LztwsvpiO4tqNP2iJBkjZrofHIM/V4t8FDs8n8GxAAGeCMSL4l0HMdncce0I9d1rooMKXnRX8OKF3zy2qS1Jb+T8UGJE/HYoqWjvBko52uKDfdDNHVFkIsltorxEg5zz2HlJjghhIj4NKNQZSqCSYyN8Q7MvrD40VkwCZ+T87dWAFZRhD+wnxcmaDbvhEgR3EnO4zljP3nan0lYotaP1a6CJw6i6U41+dvnv8HyPQCNDBxrDzmZUS1dxkwDoQyj928lNuk5EvwDHwl0oB2qoq8kJPMq103XuIrw5JLNFA1HV4nQBVtXQ1s2jXCUVv5jDd1zzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lcsR2Tp2SsRtVK+9fyMPSPk4DDSewKKHdbCN8BRhAGtOFz48sZvQ5QfSr2WEGhJlx8hm9l5qb0aQWpQJaa+J9bazzROjLQVDARLN8ZefJAU6EvxGxkaLsOW2j9yp6fx8jMQeI1+HZ86l002Z5f1rdV28PIj4JrGzM/KA2EGjIm6lTg/M8uRqPVDumj6RQ+jQ4vFuwEbtBR7+HOwrBHAkqbFCH0xkhvuAadWiPsQf7ET0HpdqKySJwhP/5RgoGBo1irnSNkzNUxBPIi7XSI33uu14HMZWcarNcCj4Xaigrk1DQNlOLpg+RRfC5273L1FxgmUFtN4xVfog3Z4LiIQhbA==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 10 Apr 2024 10:02:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Luca,

On 09/04/2024 13:45, Luca Fancellu wrote:
> 
> 
> Currently the memory footprint of the static shared memory feature
> is impacting all the struct meminfo instances with memory space
> that is not going to be used.
> 
> To solve this issue, rework the static shared memory extra
> information linked to the memory bank to another structure,
> struct shmem_membank_extra, and exploit the struct membank
> padding to host a pointer to that structure in a union with the
> enum membank_type, with this trick the 'struct membank' has the
> same size with or without the static shared memory, given that
> the 'type' and 'shmem_extra' are never used at the same time,
> hence the 'struct membank' won't grow in size.
> 
> Afterwards, create a new structure 'struct shared_meminfo' which
> has the same interface of 'struct meminfo', but requires less
I would expect some justification for selecting 32 as the max number of shmem 
banks

> banks and hosts the extra information for the static shared memory.
> The fields 'bank' and 'extra' of this structure are meant to be
> linked by the index (e.g. extra[idx] will have the information for
> the bank[idx], for i=0..NR_SHMEM_BANKS), the convinient pointer
> 'shmem_extra' of 'struct membank' is then linked to the related
> 'extra' bank to ease the fruition when a function has access only
> to the 'struct membanks common' of 'struct shared_meminfo'.
> 
> The last part of this work is to move the allocation of the
> static shared memory banks from the 'reserved_mem' to a new
> 'shmem' member of the 'struct bootinfo'.
> Change also the 'shm_mem' member type to be 'struct shared_meminfo'
> in order to match the above changes and allow a memory space
> reduction also in 'struct kernel_info'.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
With the find_unallocated_memory() issue fixed:
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal



 


Rackspace

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