xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>, Tim Deegan <tim@xen.org>
Cc: "Keir (Xen.org)" <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: Proposed XENMEM_claim_pages hypercall: Analysis of problem and alternate solutions
Date: Wed, 2 Jan 2013 13:43:11 -0800 (PST)	[thread overview]
Message-ID: <e3f31eee-aa60-4ede-8f39-d8f1d2e8a884@default> (raw)
In-Reply-To: <ED5CF401-CEAC-44EB-9660-849B9657F402@gridcentric.ca>

> From: Andres Lagar-Cavilla [mailto:andreslc@gridcentric.ca]
> Subject: Re: [Xen-devel] Proposed XENMEM_claim_pages hypercall: Analysis of problem and alternate
> solutions
> 
> Hello,

Happy New Year, Andres!  (yay, I spelled it right this time! ;)

> On Dec 20, 2012, at 11:04 AM, Tim Deegan <tim@xen.org> wrote:
> 
> > 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.
> 
> To be completely clear. I don't think we need a separate allocation/list
> of pages/foo to absorb CoW hits. I think the solution is using d->max_pages.
> Sharing will hit that limit and then send a notification via the "sharing"
> (which is actually an enomem) men event ring.

And here is the very crux of our disagreement.

You say "I think the solution is using d->max_pages".  Unless
I misunderstand completely, this means your model is what I've
called the "Citrix model" (because Citrix DMC uses it), in which
d->max_pages is dynamically adjusted regularly for each running
guest based on external inferences by (what I have sarcastically
called) a "omniscient toolstack".

In the Oracle model, d->max_pages is a fixed hard limit set when
the guest is launched; only d->curr_pages dynamically varies across
time (e.g. via in-guest selfballooning).

I reject the omnisicient toolstack model as unimplementable [1]
and, without it, I think you either do need a separate allocation/list,
with all the issues that entails, or you need the proposed
XENMEM_claim_pages hypercall to resolve memory allocation races
(i.e. vs domain creation).

So, please Andres, assume for a moment you have neither "the
solution using d->max_pages" nor "a separate allocation/list".
IIUC if one uses your implementation of page-sharing when d->max_pages
is permanently fixed, it is impossible for a "CoW hit" to result in
exceeding d->max_pages; and so the _only_ time a CoW hit would
result in a toolstack notification and/or host swapping is if
physical memory in the machine is fully allocated.  True?

Now does it make more sense what I and Konrad (and now Tim)
are trying to point out?

Thanks,
Dan

[1] excerpted from my own email at:
http://lists.xen.org/archives/html/xen-devel/2012-12/msg00107.html 

> The last 4+ years of my life have been built on the fundamental
> assumption that nobody, not even one guest kernel itself,
> can adequately predict when memory usage is going to spike.
> Accurate inference from an external entity across potentially dozens
> of VMs is IMHO.... well... um... unlikely.  I could be wrong
> but I believe, even in academia, there is no realistic research
> solution proposed for this.  (If I'm wrong, please send a pointer.)

  reply	other threads:[~2013-01-02 21:43 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
2013-01-02 15:31       ` Andres Lagar-Cavilla
2013-01-02 21:43         ` Dan Magenheimer [this message]
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=e3f31eee-aa60-4ede-8f39-d8f1d2e8a884@default \
    --to=dan.magenheimer@oracle.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andreslc@gridcentric.ca \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=konrad@kernel.org \
    --cc=tim@xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).