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

Re: [PATCH 08/11] xen/arm: Reduce struct membank size on static shared memory


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 4 Apr 2024 13:19:35 +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=K25hj4GfM6jTPrWZY6x4lXD4sMTp1ZFaW5X/biI5nzg=; b=BSCsgYnT900OT5X0CBqfU0gAMAGzjVBl1mQE1hRnj7NGy6TItll4zx7n5V3KFC6H6YjDiqev20aagj1WhQrfZ+28bXHDXxvHCXX0f6GBUYOdvLwPWBt5WFTN3oXhFGq7knCL9cm/gA9F6Q8Djz9oU3Ovjp7caxFZ5EFuE7lqXsb/YkMVbVZWcZC/NTz240xqKa5nSJLFjH3IwlADLVlDK90P4NQqUY2rYEU0/UIDVt5UTmqHoaeVGwWhmJwVg27g90sr0Ixk60/ZJtSbzTqLwXRmy6OGkNw3jQlbD+TlxRDS3VBNvQnTyZG1mSiliN+PchulsVpsFHm7hX8XBTulXw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C5xtcoYGC2aPQ4DrmhwxEmz9U1APxUjITIGvt+1uDSocMJKlblpC1s7Wku/W59dAivwvl3lg0g5vfwZsH5eqValoa7cQbcAfnD5c9K1Osnx45e6IAgW+O8nzgp2nMRpBpJo1YK6+wIfGPT+uyrKbm8I/2wug4hbtHZlC6fZCY4GLJtw3vsAcIi/PcOK9ijcJ/cVUXJJC30nN0mojRR+GwtXO64u9T4qiF3S+0BBuvG+qzo41Pz2g+mhB6TgQq/2vJSdhU+JBrDx7ei5g6ySR3rCKo9ASNd9oPmTBf4BKK9SGK100u9nZv8WC6p5AuqcQCR7TkMh9vHznoIONeeTt8w==
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 04 Apr 2024 11:19:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Luca,

On 04/04/2024 11:33, Luca Fancellu wrote:
> 
> 
>> On 22 Mar 2024, at 10:30, Michal Orzel <michal.orzel@xxxxxxx> wrote:
>>
>> Hi Luca,
>>
>> On 12/03/2024 14:03, 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
>> NIT: AFAICT the padding will be reused on Arm64 but on Arm32 there will 
>> still be 4B padding.
> 
> Yes, my purpose was to make clear that no additional space was needed
> for that pointer, should I rephrase it or it’s ok?
Since you are modifying this patch anyway, you can take the opportunity to 
rephrase it.
> 
> 
>>>
>>>
>>> +struct shared_meminfo {
>>> +    struct membanks common;
>>> +    struct membank bank[NR_SHMEM_BANKS];
>>> +    struct shmem_membank_extra extra[NR_SHMEM_BANKS];
>>> +};
>> Same as with meminfo, please add a BUILD_BUG_ON for padding between common 
>> and bank.
> 
> Sure
> 
>>>
>>>
>>> -static int __init append_shm_bank_to_domain(struct membanks *shm_mem,
>>> -                                            paddr_t start, paddr_t size,
>>> -                                            const char *shm_id)
>>> +static int __init
>>> +append_shm_bank_to_domain(struct shared_meminfo *kinfo_shm_mem, paddr_t 
>>> start,
>> Is there any particular reason to prepend the shm_mem name with kinfo?
> 
> I think because usually kinfo is used to point to ’struct kernel_info’, 
> instead here we point to
> 'struct shared_meminfo'
> 
>>
>> ~Michal
> 

~Michal



 


Rackspace

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