xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [PATCH] RFC: initial libxl support for xenpaging
Date: Mon, 20 Feb 2012 16:04:00 +0000	[thread overview]
Message-ID: <1329753840.2196.35.camel@elijah> (raw)
In-Reply-To: <20120220153841.GB14062@aepfle.de>

On Mon, 2012-02-20 at 15:38 +0000, Olaf Hering wrote:
> On Mon, Feb 20, George Dunlap wrote:
> 
> > xl mem-set domain M
> >  xenpaging off: Set balloon target to M
> >  xenpaging on: Set paging target to M
> >  xenpaging delay: Set balloon target to M, and wait for actual memory
> > to reach M.  If it hasn't reached it by $paging_delay seconds, set
> > balloon target to M.
> 
> The tristate instead of a boolean is not really needed as well.
> 
> Right now a reduction of the balloon target depends on how fast the
> guests balloon driver can claim memory from the guest OS. This means it
> could take an infinite amount of time to reach the requested target.
> With paging the request to reduce the "footprint" can be reached as fast
> as xenpaging can page-out gfns (and page-in busy gfns).
> 
> So having a delay or not seems to depend on how mem-set is supposed to
> react, either now or at an (kind of) undefined time in the future. 
> 
> If "now" is not the desired mode then xenpaging can slowly work toward a
> new lower target by calling its evict_pages() with low numbers and and
> an adjustable delay between calls.

I don't think this is a good option.  Consider the following cases:
1. The guest is cooperative and the balloon driver is active, but it
will take 30s to reach the target.  
2. The guest is uncooperative, or the balloon driver is inactive /
broken / stuck / unable to get pages. 

In case 1, the paging driver will end up paging a bunch of pages out for
30s, only to page them back in again after the balloon driver reaches
its target.  Also, you're basically guaranteed to hit the double-paging
problem: the pager will find an old page and page it out; then in the
very near future, the guest OS will decide to page *that very page* out,
touch it (causing the pager to page it back in), then write it out to
disk itself -- causing at least 3 page writes per page paged out.  This
will unnecessarily slow the system down (and the balloon driver down)
and waste IO bandwidth.  The degree to which the pager messes things up
will depend on how fast you make it.  Fast => messes up a lot slow =>
doesn't mess much up.  So slow is good in this case.

In case 2, the time it takes to reach the target will depend entirely on
the rate at which you page things out.  Slow => takes a long time, fast
=> happens relatively quicly.  So slow is bad in this case.

So no matter what we choose, something is really bad.

Under the "delay" option, 1 will behave optimally -- no wasted I/O, no
double paging; and 2 will take a fixed amount of time before going
full-bore; so it is, I believe, better in both cases.

You don't have to implement the "delay" option if you don't want to; as
long as we expose the low-level controls, the administrator can do the
"fall-back" himself, and then someone (possibly me) can implement
something like that in the future (either before or after the 4.2
release).  

However, there should be a way that paging can be on but "xl mem-set"
will set the balloon target.  If we have "paging=manual", that could
mean, "I'll start the pager daemon, but you'll have to call the xl
mem-set-paging-target yourself."

 -George

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

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16  7:47 [PATCH] RFC: initial libxl support for xenpaging Olaf Hering
2012-02-17 13:44 ` Ian Campbell
2012-02-17 14:25   ` Olaf Hering
2012-02-17 14:58     ` Ian Campbell
2012-02-17 15:24       ` Olaf Hering
2012-02-17 15:33         ` Ian Campbell
2012-02-17 15:43           ` Olaf Hering
2012-02-17 15:54             ` Ian Campbell
2012-02-17 16:03               ` Olaf Hering
2012-02-17 16:43                 ` Ian Campbell
2012-02-20 10:44                   ` George Dunlap
2012-02-20 11:12                     ` Olaf Hering
2012-02-20 14:48                       ` George Dunlap
2012-02-20 15:19                         ` Olaf Hering
2012-02-20 16:06                           ` George Dunlap
2012-02-20 15:38                         ` Olaf Hering
2012-02-20 16:04                           ` George Dunlap [this message]
2012-02-21  9:59                         ` Ian Campbell
2012-02-21 11:27                           ` Olaf Hering
2012-02-21 11:34                             ` Ian Campbell
2012-02-21 12:21                               ` Olaf Hering
2012-02-21 12:20                           ` George Dunlap
2012-02-23 10:42                             ` Ian Campbell
2012-02-23 12:18                               ` George Dunlap
2012-02-23 16:22                                 ` Andres Lagar-Cavilla
2012-02-23 17:30                                   ` George Dunlap
2012-02-24 10:11                                 ` Ian Campbell
2012-02-24 15:38                                   ` Olaf Hering
2012-02-24 16:39                                     ` Ian Campbell
2012-02-24 22:19                                       ` Olaf Hering
2012-02-24 17:12                                   ` Andres Lagar-Cavilla
2012-02-27  9:44                                     ` Ian Campbell
2012-02-27 14:45                                       ` Andres Lagar-Cavilla
2012-02-28 13:05                                         ` George Dunlap
2012-02-28 15:25                                           ` Andres Lagar-Cavilla
     [not found]                                             ` <CAFLBxZapKUVaiz4e-VwGTwj0a0FOPij5hXrRkevrTC6brtug4Q@mail.gmail.com>
2012-02-28 17:03                                               ` Fwd: " George Dunlap
2012-03-06 23:07                                           ` Andres Lagar-Cavilla
     [not found]                                   ` <CAFLBxZavBR0c_p1E9NpfkNzhrN-LCbtV=kPRwFZ3VFFMKPBNKg@mail.gmail.com>
2012-02-28 17:02                                     ` Fwd: " George Dunlap
2012-02-28 17:12                                       ` Ian Campbell
2012-02-21  9:05                     ` Ian Campbell
     [not found] <mailman.3929.1329497068.1471.xen-devel@lists.xensource.com>
2012-02-17 16:55 ` Andres Lagar-Cavilla
2012-02-17 17:03   ` Ian Campbell

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=1329753840.2196.35.camel@elijah \
    --to=george.dunlap@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=olaf@aepfle.de \
    --cc=xen-devel@lists.xensource.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).