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

Re: [Xen-devel] [PATCH] x86: shrink 'struct domain', was already PAGE_SIZE


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxx
  • From: Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx>
  • Date: Mon, 1 Feb 2016 13:28:10 +0200
  • Cc: Keir Fraser <keir@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Mon, 01 Feb 2016 11:28:24 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=rBfwsE/wnCfTnVo+sCBTP7yWQq1FZ1AE67fPA0AJ93UM6KCDiRSCwfZYDZNzR7cCBMIldHzo5lR+es9x15GID22Bv0cSc4Kpaq2SVPds2FVbD53FoIy/nJxBKWjYcrUD3YF3TwDhHxcgnFf9CPAtDaQMDGmd4pHBoPI2XFsNCD+EckTpfxl5lu7ckCg5VyfT4gNuEnA8Qq57eyI6dPYBDA/gB2nqOOx66C5ZaXg+zCa2nB2z2gMnGMdb/+VCB2Uahir94MvBk4wWBc6jQ50Nx3HH8+XGy7xCVzS7T1wt7Gc2WQcLE95gMrHBK0OsowyUFkDJhPrXDwJb2mgkp2ZDjA==; h=Received:Received:Received:Received:Received:Subject:To:References:Cc:From:Message-ID:Date:User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.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 <czuzu@xxxxxxxxxxxxxxx>
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

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.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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