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

Re: [Xen-devel] [PATCH v2 1/2] x86/dom0: rename paging function

On Tue, Dec 11, 2018 at 08:08:51AM -0700, Jan Beulich wrote:
> >>> On 05.12.18 at 15:54, <roger.pau@xxxxxxxxxx> wrote:
> > To note it's calculating the approximate amount of memory required by
> > shadow paging.
> I don't understand this logic, and ...
> > @@ -325,7 +325,7 @@ unsigned long __init dom0_compute_nr_pages(
> >              break;
> >  
> >          /* Reserve memory for shadow or HAP. */
> > -        avail -= dom0_paging_pages(d, nr_pages);
> > +        avail -= dom0_shadow_pages(d, nr_pages);
> >      }
> ... the comment here (and lack of conditional restricting the
> code to shadow mode) appear to support me: Have you
> been mislead by the function having a comment referring
> to libxl_get_required_shadow_memory()? I think if anything
> that libxl function would want to be renamed (to replace
> "shadow" by something more generic in its name).

But the logic in dom0_shadow_pages to calculate the size of the paging
memory pool is specifically for shadow AFAICT, I don't think HAP needs
to take the number of vCPUs into account, since there's only a
single p2m for the whole domain. OTOH shadow needs to take the number
of vCPUs into account because each one will have a different shadow.

Note that patch 2 in this series adds a function to calculate the size
of the paging memory pool for HAP, and a conditional is added to the
expression above that takes into account whether shadow or HAP is in
use when subtracting from the amount of available memory.

Thanks, Roger.

Xen-devel mailing list



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