]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commit
x86: shrink 'struct domain', was already PAGE_SIZE
authorCorneliu ZUZU <czuzu@bitdefender.com>
Mon, 1 Feb 2016 13:00:30 +0000 (14:00 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 1 Feb 2016 13:00:30 +0000 (14:00 +0100)
commit428607a410e8abfb4bb71195d74cd1157e3d06ae
treeba2404605f094a255cf8212bc9ebca0357a2cd29
parent3ac90e9bb2f110d9ef0f4c1239aced83d88834e4
x86: shrink 'struct domain', was already PAGE_SIZE

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@bitdefender.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/hpet.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/pmtimer.c
xen/arch/x86/hvm/rtc.c
xen/arch/x86/hvm/vpt.c
xen/arch/x86/time.c
xen/include/asm-x86/hvm/domain.h
xen/include/asm-x86/hvm/vpt.h