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

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



>>> On 01.02.16 at 08:42, <czuzu@xxxxxxxxxxxxxxx> 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: Jan Beulich <jbeulich@xxxxxxxx>
albeit ...

> --- a/xen/include/asm-x86/hvm/vpt.h
> +++ b/xen/include/asm-x86/hvm/vpt.h
> @@ -139,6 +139,9 @@ struct pl_time {    /* platform time */
>      /* Ensures monotonicity in appropriate timer modes. */
>      uint64_t last_guest_time;
>      spinlock_t pl_time_lock;
> +    /* pl_time allocated dynamically, need to keep link to
> +     * containing domain */
> +    struct domain *domain;
>  };

... I wonder about the usefulness of this (malformed) comment. I'll
likely ditch it while committing.

Jan


_______________________________________________
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®.