From: Keir Fraser <keir.xen@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>,
Jan Beulich <JBeulich@novell.com>
Cc: Olaf Hering <olaf@aepfle.de>,
Ian Campbell <Ian.Campbell@citrix.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
George Shuklin <george.shuklin@gmail.com>,
"Tim (Xen.org)" <tim@xen.org>,
xen-devel@lists.xen.org, Dario Faggioli <raistlin@linux.it>,
Kurt Hackel <kurt.hackel@oracle.com>,
Zhigang Wang <zhigang.x.wang@oracle.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: Proposed new "memory capacity claim" hypercall/feature
Date: Tue, 30 Oct 2012 15:43:01 +0100 [thread overview]
Message-ID: <CCB5A605.42C7F%keir.xen@gmail.com> (raw)
In-Reply-To: <234774e0-45d5-4a4e-99f1-4e4c3eaee615@default>
On 30/10/2012 16:13, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:
>> Okay, so why is tmem incompatible with implementing claims in the toolstack?
>
> (Hmmm... maybe I could schedule the equivalent of a PhD qual exam
> for tmem with all the core Xen developers as examiners?)
>
> The short answer is tmem moves memory capacity around far too
> frequently to be managed by a userland toolstack, especially if
> the "controller" lives on a central "manager machine" in a
> data center (Oracle's model). The ebb and flow of memory supply
> and demand for each guest is instead managed entirely dynamically.
I don't know. I agree that fine-grained memory management is the duty of the
hypervisor, but it seems to me that the toolstack should be able to handle
admission control. It knows how much memory each existing guest is allowed
to consume at max, how much memory the new guest requires, how much memory
the system has total... Isn't the decision then simple? Tmem should be
fairly invisible to the toolstack, right?
-- Keir
> The somewhat longer answer (and remember all of this is
> implemented and upstream in Xen and Linux today):
>
> First, in the tmem model, each guest is responsible for driving
> its memory utilization (what Xen tools calls "current" and Xen
> hypervisor calls "tot_pages") as low as it can. This is done
> in Linux with selfballooning. At 50Hz (default), the guest
> kernel will attempt to expand or contract the balloon to match
> the guest kernel's current demand for memory. Agreed, one guest
> requesting changes at 50Hz could probably be handled by
> a userland toolstack, but what about 100 guests? Maybe...
> but there's more.
>
> Second, in the tmem model, each guest is making tmem hypercalls
> at a rate of perhaps thousands per second, driven by the kernel
> memory management internals. Each call deals with a single
> page of memory and each possibly may remove a page from (or
> return a page to) Xen's free list. Interacting with a userland
> toolstack for each page is simply not feasible for this high
> of a frequency, even in a single guest.
>
> Third, tmem in Xen implements both compression and deduplication
> so each attempt to put a page of data from the guest into
> the hypervisor may or may not require a new physical page.
> Only the hypervisor knows.
>
> So, even on a single machine, tmem is tossing memory capacity
> about at a very very high frequency. A userland toolstack can't
> possibly keep track, let alone hope to control it; that would
> entirely defeat the value of tmem. It would be like requiring
> the toolstack to participate in every vcpu->pcpu transition
> in the Xen cpu scheduler.
>
> Does that make sense and answer your question?
>
> Anyway, I think the proposed "claim" hypercall/subop neatly
> solves the problem of races between large-chunk memory demands
> (i.e. large domain launches) and small-chunk memory demands
> (i.e. small domain launches and single-page tmem allocations).
next prev parent reply other threads:[~2012-10-30 14:43 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-29 17:06 Proposed new "memory capacity claim" hypercall/feature Dan Magenheimer
2012-10-29 18:24 ` Keir Fraser
2012-10-29 21:08 ` Dan Magenheimer
2012-10-29 22:22 ` Keir Fraser
2012-10-29 23:03 ` Dan Magenheimer
2012-10-29 23:17 ` Keir Fraser
2012-10-30 15:13 ` Dan Magenheimer
2012-10-30 14:43 ` Keir Fraser [this message]
2012-10-30 16:33 ` Dan Magenheimer
2012-10-30 9:11 ` George Dunlap
2012-10-30 16:13 ` Dan Magenheimer
2012-10-29 22:35 ` Tim Deegan
2012-10-29 23:21 ` Dan Magenheimer
2012-10-30 8:13 ` Tim Deegan
2012-10-30 15:26 ` Dan Magenheimer
2012-10-30 8:29 ` Jan Beulich
2012-10-30 15:43 ` Dan Magenheimer
2012-10-30 16:04 ` Jan Beulich
2012-10-30 17:13 ` Dan Magenheimer
2012-10-31 8:14 ` Jan Beulich
2012-10-31 16:04 ` Dan Magenheimer
2012-10-31 16:19 ` Jan Beulich
2012-10-31 16:51 ` Dan Magenheimer
2012-11-02 9:01 ` Jan Beulich
2012-11-02 9:30 ` Keir Fraser
2012-11-04 19:43 ` Dan Magenheimer
2012-11-04 20:35 ` Tim Deegan
2012-11-05 0:23 ` Dan Magenheimer
2012-11-05 10:29 ` Ian Campbell
2012-11-05 14:54 ` Dan Magenheimer
2012-11-05 22:24 ` Ian Campbell
2012-11-05 22:58 ` Zhigang Wang
2012-11-05 22:58 ` Dan Magenheimer
2012-11-06 13:23 ` Ian Campbell
2012-11-05 22:33 ` Dan Magenheimer
2012-11-06 10:49 ` Jan Beulich
2012-11-05 9:16 ` Jan Beulich
2012-11-07 22:17 ` Dan Magenheimer
2012-11-08 7:36 ` Keir Fraser
2012-11-08 10:11 ` Ian Jackson
2012-11-08 10:57 ` Keir Fraser
2012-11-08 21:45 ` Dan Magenheimer
2012-11-12 11:03 ` Ian Jackson
2012-11-08 8:00 ` Jan Beulich
2012-11-08 8:18 ` Keir Fraser
2012-11-08 8:54 ` Jan Beulich
2012-11-08 9:12 ` Keir Fraser
2012-11-08 9:47 ` Jan Beulich
2012-11-08 10:50 ` Keir Fraser
2012-11-08 13:48 ` Jan Beulich
2012-11-08 19:16 ` Dan Magenheimer
2012-11-08 22:32 ` Keir Fraser
2012-11-09 8:47 ` Jan Beulich
2012-11-08 18:38 ` Dan Magenheimer
2012-11-05 17:14 ` George Dunlap
2012-11-05 18:21 ` Dan Magenheimer
2012-11-01 2:13 ` Dario Faggioli
2012-11-01 15:51 ` 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=CCB5A605.42C7F%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@novell.com \
--cc=dan.magenheimer@oracle.com \
--cc=george.shuklin@gmail.com \
--cc=konrad.wilk@oracle.com \
--cc=kurt.hackel@oracle.com \
--cc=olaf@aepfle.de \
--cc=raistlin@linux.it \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
--cc=zhigang.x.wang@oracle.com \
/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).