From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
Anthony Perard <anthony.perard@citrix.com>,
Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH RFC] x86+libxl: correct p2m (shadow) memory pool size calculation
Date: Fri, 22 Apr 2022 17:48:27 +0200 [thread overview]
Message-ID: <YmLOS+fKRxQ9BXc2@Air-de-Roger> (raw)
In-Reply-To: <65e4428d-f89b-88c6-885c-7c0347e52861@suse.com>
On Fri, Apr 22, 2022 at 01:56:17PM +0200, Jan Beulich wrote:
> On 22.04.2022 13:14, Roger Pau Monné wrote:
> > On Fri, Apr 22, 2022 at 12:57:03PM +0200, Jan Beulich wrote:
> >> The reference "to shadow the resident processes" is applicable to
> >> domains (potentially) running in shadow mode only. Adjust the
> >> calculations accordingly.
> >>
> >> In dom0_paging_pages() also take the opportunity and stop open-coding
> >> DIV_ROUND_UP().
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> ---
> >> RFC: I'm pretty sure I can't change a public libxl function (deprecated
> >> or not) like this, but I also don't know how I should go about
> >> doing so (short of introducing a brand new function and leaving the
> >> existing one broken).
> >
> > You have to play with LIBXL_API_VERSION, see for example:
> >
> > 1e3304005e libxl: Make libxl_retrieve_domain_configuration async
> >
> >>
> >> --- a/tools/include/libxl_utils.h
> >> +++ b/tools/include/libxl_utils.h
> >> @@ -23,7 +23,10 @@ const
> >> #endif
> >> char *libxl_basename(const char *name); /* returns string from strdup */
> >>
> >> -unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb, unsigned int smp_cpus);
> >> +unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb,
> >> + unsigned int smp_cpus,
> >> + libxl_domain_type type,
> >> + bool hap);
> >
> > Iff we are to change this anyway, we might as well rename the
> > function and introduce a proper
> > libxl_get_required_{paging,p2m}_memory?
> >
> > It seems wrong to have a function explicitly named 'shadow' that takes
> > a 'hap' parameter.
> >
> > If you introduce a new function there's no need to play with the
> > LIBXL_API_VERSION and you can just add a new LIBXL_HAVE_FOO define.
>
> With the original function deprecated, I don't see why I'd need to
> make a new public function - my fallback plan was (as also suggested
> by Jürgen) to make a new internal function.
Yes, that would be fine if there's no need to expose the new function
for external callers.
Thanks, Roger.
prev parent reply other threads:[~2022-04-22 15:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-22 10:57 [PATCH RFC] x86+libxl: correct p2m (shadow) memory pool size calculation Jan Beulich
2022-04-22 11:10 ` Juergen Gross
2022-04-22 11:14 ` Roger Pau Monné
2022-04-22 11:56 ` Jan Beulich
2022-04-22 15:48 ` Roger Pau Monné [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YmLOS+fKRxQ9BXc2@Air-de-Roger \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.