All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
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 4 of 4] xenpaging: initial libxl support
Date: Tue, 22 Nov 2011 12:22:48 +0100	[thread overview]
Message-ID: <20111122112248.GA28172@aepfle.de> (raw)
In-Reply-To: <alpine.DEB.2.00.1111221029570.31179@kaball-desktop>

On Tue, Nov 22, Stefano Stabellini wrote:

> On Mon, 21 Nov 2011, Olaf Hering wrote:
> > On Mon, Nov 21, Stefano Stabellini wrote:
> > 
> > > what if tot_memkb is bigger than target_memkb? Or even bigger than
> > > max_memkb?
> > 
> > tot_memkb is unrelated to target_memkb, also somewhat unrelated to
> > max_memkb.
> 
> At build time ballooning is not active yet and target_memkb represents
> the amount of memory available to the VM plus the videoram (see
> libxl__build_hvm).
> As a consequence I think that tot_memkb cannot be higher than
> target_memkb - videoram_memkb (that is build_start in the diagram). 

It can because with xenpaging the target_memkb turns from real memory
into virtual memory, and tot_memkb is the new amount of real memory.

The actual checking wether the tot_memkb/target_memkb/max_memkb are sane
can be either done when they are changed with xl mem-XY like its done
now. Or we add new code to do such checking already during config
parsing.

> So, what is going to happen if tot_memkb is higher than target_memkb -
> videoram_memkb?

Nothing happens, since xenpaging is the only consumer of that variable
(via xenstore). See below.

> Also, what is going to happen if it is lower?

If its lower, xenpaging will page-out some pages, adds them back if the
guest happens to access them and page-out some other pages. The guest
still has access to all memory it thinks it has (target_memkb).

> > xenpaging will look at tot_memkb value (at "memory/target-tot_pages" to
> > be precise) and try to reach that number of domain->tot_pages. If the
> > tot_memkb number is larger than max_memkb nothing will happen.
> 
> How is it going to reach the tot_pages target? Where is it going to take
> the memory from? Is it going to automatically page out memory from other
> VMs?

xenpaging does not add new memory. If it has no pages to page-in and
tot_pages is still higher, it will do nothing.

> > Right now there is not much checking anyway, memory=1024 maxmem=1 in the
> > config is accepted in my testing.
>  
> That is a correct configuration: it means that the domain has 1024MB of
> RAM but it cannot allocate any more (maximum allocation limit being 1MB).
> maxmem doesn't influence the current memory of the VM, only future
> allocations.

It causes stall in the host, perhaps due to an interger overflow (I have
not analyzed it yet).

Olaf

  reply	other threads:[~2011-11-22 11:22 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02 14:45 [PATCH 0 of 4] libxl: initial support for xenpaging Olaf Hering
2011-11-02 14:45 ` [PATCH 1 of 4] xenpaging: use guests tot_pages as working target Olaf Hering
2011-11-02 14:45 ` [PATCH 2 of 4] xenpaging: watch the guests memory/target-tot_pages xenstore value Olaf Hering
2011-11-02 14:45 ` [PATCH 3 of 4] xenpaging: add cmdline interface for pager Olaf Hering
2011-11-02 14:45 ` [PATCH 4 of 4] xenpaging: initial libxl support Olaf Hering
2011-11-07 11:02   ` Stefano Stabellini
2011-11-07 12:55     ` Olaf Hering
2011-11-07 13:28       ` Stefano Stabellini
2011-11-20 18:29         ` Olaf Hering
2011-11-21 10:53           ` Stefano Stabellini
2011-11-21 15:13             ` Olaf Hering
2011-11-21 16:40               ` George Dunlap
2011-11-22  9:05                 ` Ian Campbell
2011-11-22 10:58               ` Stefano Stabellini
2011-11-22 11:22                 ` Olaf Hering [this message]
2011-11-22 15:48               ` George Dunlap
2012-01-09 19:21                 ` Olaf Hering
2012-01-10 12:02                   ` George Dunlap
2012-01-11 14:58                     ` Olaf Hering
2012-01-11 16:10                       ` Tim Deegan
2012-01-11 16:38                         ` Olaf Hering
2012-01-11 16:58                           ` Tim Deegan
2012-01-12 14:12                             ` Olaf Hering
2012-01-13 11:00                               ` 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=20111122112248.GA28172@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --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 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.