All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
	"Keir (Xen.org)" <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Jan Beulich <JBeulich@suse.com>
Subject: Re: Proposed XENMEM_claim_pages hypercall: Analysis of problem and alternate solutions
Date: Thu, 20 Dec 2012 16:04:15 +0000	[thread overview]
Message-ID: <20121220160415.GO80837@ocelot.phlegethon.org> (raw)
In-Reply-To: <20121218221749.GA6332@phenom.dumpdata.com>

Hi,

At 17:17 -0500 on 18 Dec (1355851071), Konrad Rzeszutek Wilk wrote:
> In essence, the max_pages does work - _if_ one does these operations
> in serial. We are trying to make this work in parallel and without
> any failures - for that we - one way that is quite simplistic
> is the claim hypercall. It sets up a 'stake' of the amount of
> memory that the hypervisor should reserve. This way other
> guests creations/ ballonning do not infringe on the 'claimed' amount.
> 
> I believe with this hypercall the Xapi can be made to do its operations
> in parallel as well.

The question of starting VMs in parallel seems like a red herring to me:
- TTBOMK Xapi already can start VMs in parallel.  Since it knows what
  constraints it's placed on existing VMs and what VMs it's currently
  building, there is nothing stopping it.  Indeed, AFAICS any toolstack
  that can guarantee enough RAM to build one VM at a time could do the
  same for multiple parallel builds with a bit of bookkeeping.
- Dan's stated problem (failure during VM build in the presence of
  unconstrained guest-controlled allocations) happens even if there is
  only one VM being created.

> > > Andres Lagar-Cavilla says "... this is because of shortcomings in the
> > > [Xen] mm layer and its interaction with wait queues, documented
> > > elsewhere."  In other words, this batching proposal requires
> > > significant changes to the hypervisor, which I think we
> > > all agreed we were trying to avoid.
> >
> > Let me nip this at the bud. I use page sharing and other techniques in an environment that doesn't use Citrix's DMC, nor is focused only on proprietary kernels...
> 
> I believe Dan is saying is that it is not enabled by default.
> Meaning it does not get executed in by /etc/init.d/xencommons and
> as such it never gets run (or does it now?) - unless one knows
> about it - or it is enabled by default in a product. But perhaps
> we are both mistaken? Is it enabled by default now on xen-unstable?

I think the point Dan was trying to make is that if you use page-sharing
to do overcommit, you can end up with the same problem that self-balloon
has: guest activity might consume all your RAM while you're trying to
build a new VM.

That could be fixed by a 'further hypervisor change' (constraining the
total amount of free memory that CoW unsharing can consume).  I suspect
that it can also be resolved by using d->max_pages on each shared-memory
VM to put a limit on how much memory they can (severally) consume.

> Just as a summary as this is getting to be a long thread - my
> understanding has been that the hypervisor is suppose to toolstack
> independent.

Let's keep calm.  If people were arguing "xl (or xapi) doesn't need this
so we shouldn't do it" that would certainly be wrong, but I don't think
that's the case.  At least I certainly hope not!

The discussion ought to be around the actual problem, which is (as far
as I can see) that in a system where guests are ballooning without
limits, VM creation failure can happen after a long delay.  In
particular it is the delay that is the problem, rather than the failure.
Some solutions that have been proposed so far:
 - don't do that, it's silly (possibly true but not helpful);
 - this reservation hypercall, to pull the failure forward;
 - make allocation faster to avoid the delay (a good idea anyway,
   but can it be made fast enough?);
 - use max_pages or similar to stop other VMs using all of RAM.

My own position remains that I can live with the reservation hypercall,
as long as it's properly done - including handling PV 32-bit and PV
superpage guests.

Cheers,

Tim.

  parent reply	other threads:[~2012-12-20 16:04 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.18000.1354568068.1399.xen-devel@lists.xen.org>
2012-12-04  3:24 ` Proposed XENMEM_claim_pages hypercall: Analysis of problem and alternate solutions Andres Lagar-Cavilla
2012-12-18 22:17   ` Konrad Rzeszutek Wilk
2012-12-19 12:53     ` George Dunlap
2012-12-19 13:48       ` George Dunlap
2013-01-03 20:38         ` Dan Magenheimer
2013-01-02 21:59       ` Konrad Rzeszutek Wilk
2013-01-14 18:28         ` George Dunlap
2013-01-22 21:57           ` Konrad Rzeszutek Wilk
2013-01-23 18:36             ` Dave Scott
2013-02-12 15:38               ` Konrad Rzeszutek Wilk
2012-12-20 16:04     ` Tim Deegan [this message]
2013-01-02 15:31       ` Andres Lagar-Cavilla
2013-01-02 21:43         ` Dan Magenheimer
2013-01-03 16:25           ` Andres Lagar-Cavilla
2013-01-03 18:49             ` Dan Magenheimer
2013-01-07 14:43               ` Ian Campbell
2013-01-07 18:41                 ` Dan Magenheimer
2013-01-08  9:03                   ` Ian Campbell
2013-01-08 19:41                     ` Dan Magenheimer
2013-01-09 10:41                       ` Ian Campbell
2013-01-09 14:44                         ` Dan Magenheimer
2013-01-09 14:58                           ` Ian Campbell
2013-01-14 15:45                           ` George Dunlap
2013-01-14 18:18                             ` Dan Magenheimer
2013-01-14 19:42                               ` George Dunlap
2013-01-14 23:14                                 ` Dan Magenheimer
2013-01-23 12:18                                   ` Ian Campbell
2013-01-23 17:34                                     ` Dan Magenheimer
2013-02-12 16:18                                     ` Konrad Rzeszutek Wilk
2013-01-10 10:31                       ` Ian Campbell
2013-01-10 18:42                         ` Dan Magenheimer
2013-01-02 21:38       ` Dan Magenheimer
2013-01-03 16:24         ` Andres Lagar-Cavilla
2013-01-03 18:33           ` Dan Magenheimer
2013-01-10 17:13         ` Tim Deegan
2013-01-10 21:43           ` Dan Magenheimer
2013-01-17 15:12             ` Tim Deegan
2013-01-17 15:26               ` Andres Lagar-Cavilla
2013-01-22 19:22               ` Dan Magenheimer
2013-01-23 12:18                 ` Ian Campbell
2013-01-23 16:05                   ` Dan Magenheimer
2013-01-02 15:29     ` Andres Lagar-Cavilla
2013-01-11 16:03       ` Konrad Rzeszutek Wilk
2013-01-11 16:13         ` Andres Lagar-Cavilla
2013-01-11 19:08           ` Konrad Rzeszutek Wilk
2013-01-14 16:00             ` George Dunlap
2013-01-14 16:11               ` Andres Lagar-Cavilla
2013-01-17 15:16             ` Tim Deegan
2013-01-18 21:45               ` Konrad Rzeszutek Wilk
2013-01-21 10:29                 ` Tim Deegan
2013-02-12 15:54                   ` Konrad Rzeszutek Wilk
2013-02-14 13:32                     ` Konrad Rzeszutek Wilk
2012-12-03 20:54 Dan Magenheimer

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=20121220160415.GO80837@ocelot.phlegethon.org \
    --to=tim@xen.org \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andreslc@gridcentric.ca \
    --cc=dan.magenheimer@oracle.com \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=konrad@kernel.org \
    --cc=xen-devel@lists.xen.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.