All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	xen-devel@lists.xen.org, David Vrabel <david.vrabel@citrix.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: Analysis of using balloon page compaction in Xen balloon driver
Date: Fri, 17 Oct 2014 13:44:30 +0100	[thread overview]
Message-ID: <1413549870.2012.47.camel@citrix.com> (raw)
In-Reply-To: <54410BDD.5090404@citrix.com>

On Fri, 2014-10-17 at 13:30 +0100, Andrew Cooper wrote:
> Step 3 is an expensive (especially for Xen, which has far more important
> things to be doing with its time) and which is self-perpetuating because
> of the balloon driver reshattering pages.
> 
> Several factors contribute to shattering host pages.  The ones which
> come to mind are:
> * Differing cacheability from MTRRs
> * Mapping a foreign grant into ones own physical address space
> * Releasing pages back to Xen via the decrease_reservation hypercall
> 
> In addition, other factors complicate Xens ability to move pages.
> * Mappings from other domains (Qemu, PV backends, etc) will pin mfns in
> place
> * Any IOMMU mappings will pin all (mapped) mfns in place.
> 
> As a result, by far the most efficient way of prevent superpage
> fragmentation is to not shattering them in the first place.  This can be
> done by changing the balloon driver in the guest to co-locate all pages
> it decides to balloon, rather than taking individual pages at random
> from the main memory pools.

Right, a necessary part of this work is to try and balloon (both up and
down) in correctly aligned 2M increments, by allocating 2M pages to free
back to Xen.

All the coalescing stuff is a bit secondary (but still necessary) and is
there to mitigate the case when a guest can't find a 2M page to allocate
(so has done some 4K ops instead, in order to meet the targets) and/or
to increase the probability it will be able to allocate one.

Ian.

  reply	other threads:[~2014-10-17 12:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16 17:12 Analysis of using balloon page compaction in Xen balloon driver Wei Liu
2014-10-16 17:46 ` David Vrabel
2014-10-17  8:20   ` Ian Campbell
2014-10-17 10:07     ` David Vrabel
2014-10-17 12:30 ` Andrew Cooper
2014-10-17 12:44   ` Ian Campbell [this message]
2014-10-17 13:27   ` Wei Liu

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=1413549870.2012.47.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --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 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.