From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Tim Deegan <tim@xen.org>, Olaf Hering <olaf@aepfle.de>,
"Keir (Xen.org)" <keir@xen.org>,
IanCampbell <Ian.Campbell@citrix.com>,
Konrad Wilk <konrad.wilk@oracle.com>,
GeorgeDunlap <George.Dunlap@eu.citrix.com>,
IanJackson <Ian.Jackson@eu.citrix.com>,
George Shuklin <george.shuklin@gmail.com>,
xen-devel@lists.xen.org, DarioFaggioli <raistlin@linux.it>,
Kurt Hackel <kurt.hackel@oracle.com>,
Zhigang Wang <zhigang.x.wang@oracle.com>
Subject: Re: Proposed new "memory capacity claim" hypercall/feature
Date: Tue, 30 Oct 2012 08:43:14 -0700 (PDT) [thread overview]
Message-ID: <a79693b2-ff7f-4b45-9eee-6ddb1bbcb84a@default> (raw)
In-Reply-To: <508F9DE902000078000A5565@nat28.tlf.novell.com>
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Tuesday, October 30, 2012 2:29 AM
> To: Dan Magenheimer
> Cc: Olaf Hering; IanCampbell; GeorgeDunlap; IanJackson; George Shuklin; DarioFaggioli; xen-
> devel@lists.xen.org; Konrad Wilk; Kurt Hackel; Mukesh Rathor; Zhigang Wang; Keir (Xen.org); Tim Deegan
> Subject: RE: Proposed new "memory capacity claim" hypercall/feature
>
> >>> On 30.10.12 at 00:21, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> >> From: Tim Deegan [mailto:tim@xen.org]
> >> As I said, I'm not opposed to this, though even after reading through
> >> the other thread I'm not convinced that it's necessary (except in cases
> >> where guest-controlled operations are allowed to consume unbounded
> >> memory, which frankly gives me the heebie-jeebies).
> >
> > A really detailed discussion of tmem would probably be good but,
> > yes, with tmem, guest-controlled* operations can and frequently will
> > absorb ALL physical RAM. However, this is "freeable" (ephemeral)
> > memory used by the hypervisor on behalf of domains, not domain-owned
> > memory.
> >
> > * "guest-controlled" I suspect is the heebie-jeebie word... in
> > tmem, a better description might be "guest-controls-which-data-
> > and-hypervisor-controls-how-many-pages"
>
> But isn't tmem use supposed to be transparent in this respect, i.e.
> if a "normal" allocation cannot be satisfied, tmem would jump in
> and free sufficient space? In which case there's no need to do
> any accounting outside of the control tools (leaving aside the
> smaller hypervisor internal allocations, which the tool stack needs
> to provide room for anyway).
Hi Jan --
Tmem can only "free sufficient space" up to the total amount
of ephemeral space of which it has control (ie. all "freeable"
memory).
Let me explain further: Let's oversimplify a bit and say that
there are three types of pages:
a) Truly free memory (each free page is on the hypervisor free list)
b) Freeable memory ("ephmeral" memory managed by tmem)
c) Owned memory (pages allocated by the hypervisor or for a domain)
The sum of these three is always a constant: The total number of
RAM pages in the system. However, when tmem is active, the values
of all _three_ of these change constantly. So if at the start of a
domain launch, the sum of free+freeable exceeds the intended size
of the domain, the domain allocation/launch can start. But then
if "owned" increases enough, there may no longer be enough memory
and the domain launch will fail.
With tmem, memory "owned" by domain (d.tot_pages) increases dynamically
in two ways: selfballooning and persistent puts (aka frontswap),
but is always capped by d.max_pages. Neither of these communicate
to the toolstack.
Similarly, tmem (or selfballooning) may be dynamically freeing up lots
of memory without communicating to the toolstack, which could result in
the toolstack rejecting a domain launch believing there is insufficient
memory.
I am thinking the "claim" hypercall/subop eliminates these problems
and hope you agree!
Thanks,
Dan
next prev parent reply other threads:[~2012-10-30 15: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
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 [this message]
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=a79693b2-ff7f-4b45-9eee-6ddb1bbcb84a@default \
--to=dan.magenheimer@oracle.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=george.shuklin@gmail.com \
--cc=keir@xen.org \
--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).