Hi Julien,

> -----Original Message-----
> From: Julien Grall <[email protected]>
> Subject: Re: [PATCH for-4.17 1/2] docs: Document the minimal requirement
> of static heap
> 
> Hi Henry,
> 
> > +Users should be mindful that the static heap should at least satisfy the
> > +allocation of the P2M maps for all guests. Currently, the minimal
> requirement
> > +of per-domain P2M pages pool is in-sync with function
> > +libxl__get_required_paging_memory() (for xl-created domUs) and
> > +domain_p2m_pages() (for dom0less domUs), that is, 1MB per vCPU, plus
> 4KiB per
> > +MiB of RAM for the P2M map, and plus 512KiB to cover extended regions.
> 
> I think this wording is OK if the feature is a tech preview. However, if
> this is security supported, we need to provide some more details about
> the size.
> 
> In particular, this doesn't tell a user how they can find the size that
> would fit them. Can this be decided with a formula?

My feeling of the formula would be:

My feeling of the formula would be:

Total heap size needed per guest =  1MB * num_guest_vcpu +
    4KB * guest_ram_size_in_mb + 512KB +
    the memory allocated from heap by xzalloc/xzalloc_array for various uses
    for example alloc_domain_struct(), d->shared_info, evtchn_bucket, etc.

Is this formula somehow make sense to you? I think we need to have a
rough estimation of the last part (boot time allocation) though.

Kind regards,
Henry

> 
> If not, could a user configure his system without the reserved heap and
> find out the memory usage from dom0 (or a debug keys)?
> 
> Cheers,
> 
> 
> --
> Julien Grall

Reply via email to