[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: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Thu, 4 Apr 2024 09:33:55 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=v2BiQgMdgcwo9JQ200aWwl3N+V94lEXCpNNe51ZpZYk=; b=efa/23sexi1Iaf+L/VXLXboX61poZkNSgh/JLHFN3oB/9S9Mk+HW0kiw6Dg7R1hCochP6JQDMVKEkkjnouSz+lY/DIDSYEJ1UibBke69qfJJkaWSIKEM+FPycDuidNw1RUq3TPc5OXmFyvtXM/DATYr3VNhOSBdhEz10ng+S7C46YXLgxLoKQsX66FiVtr2hnnIr/HmJ3owOGdLGvIfQ0v33ZMMv3hHx/oU6V6cu4skAEdyzFWayrlNsuVkluneYLRVaks/+BiB3m7OtXO4A7ZBwgsrDjQ9IDba+Yq2iKjcjNCIR8fjywM9YGeT5b6A23auSe6J6hiuqinzM5VycKw==
  • 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=v2BiQgMdgcwo9JQ200aWwl3N+V94lEXCpNNe51ZpZYk=; b=OtPM+RPyXIKwdSQsYQUJ1yxQmQhMxz0Zle6D4dMXmSSnxEFtkgKfP8TKgolqwy9CzvKG52ZHeNO9PWPv5Ir5g4zeCYNdGBPGHr3BNbfFeRZA+33tSDH9nCXvxflWFIlNZ8H182Jt4522d85muzHn3AK8LWXYOHe7kfK6jLcyG5ri2rFoLkWGpVHVlasjMgQSl57hS7FQfT1sNWjYS4jd4/oz1gwds9MvNtQI0Cmyd8PnYjvPzyw5/5jghqAsg1Hj4px2hH5qtwwOyW83F4oG3j462zPuNEHU86CBLo06gztZp8fzgy7U1Ka/DCen8smCHNOHLCFVELkGzvnuQ83RVQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=KNli5a21K0BXkxCFjawtzIq0uAueiPSTVXNM44xwhiB6NAX8jcAoem6sbM8oXf95w9O4HMSHqdHFRglta1IEr+Bfgco8pQxRkRQt/yRuHxH9K+0fMDQE/JMvl9aYiSEpmc+a9KId8E3Tdv+qwk8JboeOMy+sq6IiISEApBsjkx8rb5AfvAnGQnYGbHYnWNnkgauo7dAIb4SUOulZSw+OjQOZJgoQ76JIBzNG+gCYPf+Aez8T0C0eY9h+2eyjpaMZeQHtkWZH3iYsOI2FWxFqyZ8EeiwAoMlQjt/y4omjYunddSfOlkjQTmqiG8nzUQ/zecEQzmIyEPRsvsVsfz7fPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VKUSJE1HW+9e64S/mk5VxREWnfOUGzqUZ9rcZalF3ZfgaY3nI6G2U56n9McV3a/B4TAjWLhpR17DT1juabsBRxwUtFCo1sXW592qku60GOujWMyBVqH8CIe+H1pFMZD4zfvZTKPXTvqM7c9YEXL9ezuwiH+9yAKAiF1xDvxs9KMIkOk5OFGaVUqXMGFnwb1aS/B/QPLpSHGhiqAmxHPnQ1m0zlZS7AoR22UHtaENxNQoVUMaFXWo/6/PQ3U+dr0y5uhC8HQc6uJ3P884gVn6MQ49vMjhKsxRDLKXiKi/07qoHEJED0cjt/I7JlVW5cMsX5FPCNwFm27c+mkMZYEtFg==
  • 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 09:34:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHadH3fZ6dDv0/IQEuODzMfw6ES3rFDntIAgBRekoA=
  • Thread-topic: [PATCH 08/11] xen/arm: Reduce struct membank size on static shared memory


> 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?


>> 
>> 
>> +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


 


Rackspace

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