From mboxrd@z Thu Jan 1 00:00:00 1970 From: Corneliu ZUZU Subject: Re: [PATCH] x86: shrink 'struct domain', was already PAGE_SIZE Date: Mon, 1 Feb 2016 13:28:10 +0200 Message-ID: <56AF414A.5060108@bitdefender.com> References: <1454312541-12422-1-git-send-email-czuzu@bitdefender.com> <56AF3C5D.1010508@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56AF3C5D.1010508@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , xen-devel@lists.xen.org Cc: Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 2/1/2016 1:07 PM, Andrew Cooper wrote: > On 01/02/16 07:42, Corneliu ZUZU wrote: >> The X86 domain structure already occupied PAGE_SIZE (4096). >> >> Looking @ the memory layout of the structure, we could see that >> overall most was occupied by (used the pahole tool on domain.o): >> * sizeof(domain.arch) = sizeof(arch_domain) = 3328 bytes. >> * sizeof(domain.arch.hvm_domain) = 2224 bytes. >> * sizeof(domain.arch.hvm_domain.pl_time) = 1088 bytes. >> This patch attempts to free some space, by making the pl_time >> field in hvm_domain dynamically allocated. >> We xzalloc/xfree it @ hvm_domain_initialise/hvm_domain_destroy. >> >> After this change, the domain structure shrunk w/ 1152 bytes (>1K!). >> >> Signed-off-by: Corneliu ZUZU > Reviewed-by: Andrew Cooper > > Thankyou for doing this - it is exactly the kind of change I had in mind. > > ~Andrew > Glad to hear that and thank you for the prompt review :) I really needed this for another patch. Corneliu.