All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Paul Durrant <pdurrant@gmail.com>
Subject: Re: [Xen-devel] [XEN PATCH for-4.13 v3 05/10] libxl: Move shadow_memkb and iommu_memkb defaulting into libxl
Date: Mon, 14 Oct 2019 13:45:48 +0100	[thread overview]
Message-ID: <20191014124548.GA5743@perard.uk.xensource.com> (raw)
In-Reply-To: <20191011165549.21639-2-ian.jackson@eu.citrix.com>

On Fri, Oct 11, 2019 at 05:55:44PM +0100, Ian Jackson wrote:
> Defaulting is supposed to be done by libxl.  So these calculations
> should be here in libxl.  libxl__domain_config_setdefault has all the
> necessary information including the values of max_memkb and max_vcpus.
> 
> The overall functional effect depends on the caller:
> 
> For xl, no change.  The code moves from xl to libxl.
> 
> For callers who set one or both shadow_memkb and iommu_memkb (whether
> from libxl_get_required_shadow_memory or otherwise) before calling
> libxl_domain_need_memory (any version): the new code will leave their
> setting(s) unchanged.
> 
> For callers who do not call libxl_domain_need_memory at all, and who
> fail to set one of these memory values: now they are both are properly
> set.  The shadow and iommu memory to be properly accounted for as
> intended.
> 
> For callers which call libxl_domain_need_memory and request the
> current API (4.13) or which track libxl, the default values are also
> now right and everything works as intended.
> 
> For callers which call libxl_domain_need_memory, and request an old
> pre-4.13 libxl API, and which leave one of these memkb settings unset,
> we take special measures to preserve the old behaviour.
> 
> This means that they don't get the additional iommu memory and are at
> risk of the domain running out of memory as a result of f89f555827a6
> "remove late (on-demand) construction of IOMMU page tables".  But this
> is no worse than the state just after f89f555827a6, which already
> broke such callers in that way.  This is perhaps justifiable because
> of the API stability warning next to libxl_domain_need_memory.
> 
> An alternative would be to drop the special-casing of these callers.
> That would cause a discrepancy between libxl_domain_need_memory and
> libxl_domain_create: the former would not include the iommu memory and
> the latter would.  That seems worse, but it's debateable.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> ---
> v2: Replace _Bool with bool
>     Fix logic sense in ok_to_default_memkb_in_create

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-10-14 12:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 16:55 [Xen-devel] [XEN PATCH for-4.13 v3 00/10] libxl memkb & pt defaulting Ian Jackson
2019-10-11 16:55 ` [Xen-devel] [XEN PATCH for-4.13 v3 05/10] libxl: Move shadow_memkb and iommu_memkb defaulting into libxl Ian Jackson
2019-10-14 12:45   ` Anthony PERARD [this message]
2019-10-14 16:50   ` Anthony PERARD
2019-10-14 16:53     ` Ian Jackson
2019-10-14 17:00     ` Ian Jackson
2019-10-15 10:37       ` Anthony PERARD
2019-10-11 16:55 ` [Xen-devel] [XEN PATCH for-4.13 v3 06/10] libxl: Remove/deprecate libxl_get_required_*_memory from the API Ian Jackson
2019-10-11 16:55 ` [Xen-devel] [XEN PATCH for-4.13 v3 07/10] libxl: create: setdefault: Make libxl_physinfo info[1] Ian Jackson
2019-10-11 16:55 ` [Xen-devel] [XEN PATCH for-4.13 v3 08/10] libxl: create: setdefault: Move physinfo into config_setdefault Ian Jackson
2019-10-11 16:55 ` [Xen-devel] [XEN PATCH for-4.13 v3 09/10] libxl: Move domain_create_info_setdefault earlier Ian Jackson
2019-10-14 12:53   ` Anthony PERARD
2019-10-11 16:55 ` [Xen-devel] [XEN PATCH for-4.13 v3 10/10] libxl/xl: Overhaul passthrough setting logic Ian Jackson
2019-10-14 16:05   ` Anthony PERARD
2019-10-14 16:10     ` Ian Jackson

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=20191014124548.GA5743@perard.uk.xensource.com \
    --to=anthony.perard@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=pdurrant@gmail.com \
    --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.