From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: X86 arch_domain ginormous, sizeof(struct domain) already == PAGE_SIZE Date: Fri, 29 Jan 2016 17:12:37 +0000 Message-ID: <56AB9D85.1000407@citrix.com> References: <56AB9232.3050300@bitdefender.com> <56ABAAF302000078000CC864@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56ABAAF302000078000CC864@prv-mh.provo.novell.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: Jan Beulich , Corneliu ZUZU Cc: Keir Fraser , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 29/01/16 17:09, Jan Beulich wrote: >>>> On 29.01.16 at 17:24, wrote: >> To investigate I compiled the unaltered domain.c & used the pahole tool >> (part of dwarves package) to obtain the complete layout of the domain >> structure (& its members). >> What I obtained: >> * sizeof(struct domain) is already = 4096 bytes (= PAGE_SIZE) >> * sizeof(struct arch_domain) [x86] = sizeof(domain.arch) = 3328 >> bytes (arch_domain is marked __cacheline_aligned, i.e. aligned to 128 bytes) >> * sizeof(domain.arch.hvm_domain) = 2224 bytes >> * sizeof(domain.arch.hvm_domain.pl_time) = 1088 bytes >> >> => overall, X86 timers-related information occupies the most. >> >> One could shrink the domain structure by transforming some of its fields >> to pointers, e.g. I could transform the pl_time field into a pointer and >> dynamically allocate its data when domain_create is called. > Sounds like a reasonable measure. I wasn't aware we're exactly on > the boundary right now. It has been teatering on the edge for a while now. I keep on meaning to see about sliming it down somewhat (probably by pulling an optional structure out into an explicit allocation), but haven't had the time. ~Andrew