All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: 'George Dunlap' <dunlapg@umich.edu>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: RE: [RFC][PATCH] 0/9 Populate-on-demand memory
Date: Wed, 24 Dec 2008 09:46:29 +0800	[thread overview]
Message-ID: <0A882F4D99BBF6449D58E61AAFD7EDD603BB49E5@pdsmsx502.ccr.corp.intel.com> (raw)
In-Reply-To: <de76405a0812230455m51a8bd62ncf1b38dbccb3d442@mail.gmail.com>

>From: George Dunlap
>Sent: Tuesday, December 23, 2008 8:55 PM
>BACKGROUND
>
>When non-PV domains boots, they typically read the e820 maps to
>determine how much memory they have, and then assume that much memory
>thereafter.  Memory requirements can be reduced using a balloon
>driver, but it cannot be increased past this initial value.

Isn't it also true for pv guest? Unless guest supports memory hotadd,
balloon driver always can't increase past the initial max memory. But
your patch is nice since more VMs can be created w/o below hard 
limitation at boot time.

>Currently, this means that a non-PV domain must be booted with the
>maximum amount of memory you want that VM every to be able to use.
>
>Populate-on-demand allows us to "boot ballooned", in the 
>following manner:
>* Mark the entire range of memory (memory_static_max aka maxmem) with
>a new p2m type, populate_on_demand, reporting memory_static_max in th
>e820 map.  No memory is allocated at this stage.
>* Allocate the "memory_dynamic_max" (aka "target") amount of memory
>for a "PoD cache".  This memory is kept on a separate list in the
>domain struct.
>* Boot the guest.
>* Populate the p2m table on-demand as it's accessed with pages from
>the PoD cache.
>* When the balloon driver loads, it inflates the balloon size to
>(maxmem - target), giving the memory back to Xen.  When this is
>accomplished, the "populate-on-demand" portion of boot is effectively
>finished.
>

Another tricky point could be with VT-d. If one guest page is used as 
DMA target before balloon driver is installed, and no early access on
that page (like start-of-day scrubber), then PoD action will not be triggered...
Not sure the possibility of such condition, but you may need to have 
some thought or guard on that. em... after more thinking, actually PoD 
pages may be alive even after balloon driver is installed. I guess before
coming up a solution you may add a check on whether target domain
has passthrough device to decide whether this feature is on on-the-fly.

PoD is anyhow a bit different from balloon driver, since the latter claims
ownership on ballooned pages which then will not be used as the DMA
target within guest.

>
>NB that this code is designed to work only in conjunction with a
>balloon driver.  If the balloon driver is not loaded, eventually all
>pages will be dirtied (non-zero), the emergency sweep will fail, and
>there will be no memory to back outstanding PoD pages.  When this
>happens, the domain will crash.

In that case, is it better to increase PoD target to configured max mem?
It looks uncomfortable to crash a domain just because some optimization
doesn't apply. :-)

Last, do you have any performance data on how this patch may impact
the boot process, or even some workload after login?

Thanks,
Kevin

  parent reply	other threads:[~2008-12-24  1:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-23 12:55 [RFC][PATCH] 0/9 Populate-on-demand memory George Dunlap
2008-12-23 19:06 ` Dan Magenheimer
2008-12-24 13:55   ` George Dunlap
2008-12-24 14:32     ` Dan Magenheimer
2008-12-24 15:13       ` George Dunlap
2008-12-24 15:54         ` Dan Magenheimer
2008-12-24  1:46 ` Tian, Kevin [this message]
2008-12-24 14:42   ` George Dunlap
2008-12-24 15:35     ` Dan Magenheimer
2008-12-24 15:46       ` George Dunlap
2008-12-30  9:26         ` Tim Deegan
2008-12-31  1:40           ` Tian, Kevin
2009-01-02 10:03             ` Tim Deegan
2009-01-05  6:08               ` Tian, Kevin
2008-12-25  2:47       ` Tian, Kevin
2008-12-25  2:36     ` Tian, Kevin
2008-12-25  5:43       ` Han, Weidong
2008-12-25 11:45         ` Tian, Kevin
2008-12-26  0:42           ` Han, Weidong

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=0A882F4D99BBF6449D58E61AAFD7EDD603BB49E5@pdsmsx502.ccr.corp.intel.com \
    --to=kevin.tian@intel.com \
    --cc=dunlapg@umich.edu \
    --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.