xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xensource.com, Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] x86: set dom0's default maximum reservation to the initial number of pages
Date: Tue, 20 Mar 2012 19:41:39 -0400	[thread overview]
Message-ID: <20120320234139.GA19464@phenom.dumpdata.com> (raw)
In-Reply-To: <1332267691-13179-1-git-send-email-david.vrabel@citrix.com>

On Tue, Mar 20, 2012 at 06:21:31PM +0000, David Vrabel wrote:
> From: David Vrabel <david.vrabel@citrix.com>
> 
> If a maximum reservation for dom0 is not explictly given (i.e., no
> dom0_mem=max:MMM command line option), then set the maximum
> reservation to the initial number of pages.  This is what most people
> seem to expect when they specify dom0_mem=512M (i.e., exactly 512 MB
> and no more).
> 
> This change means that with Linux 3.0.5 and later kernels,
> dom0_mem=512M has the same result as older, 'classic Xen' kernels. The
> older kernels used the initial number of pages to set the maximum
> number of pages and did not query the hypervisor for the maximum
> reservation.
> 
> It is still possible to have a larger reservation by explicitly
> specifying dom0_mem=max:MMM.
> 
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> ---
> Keir,
> 
> Suggest waiting for an Ack from Konrad (I think it results in the
> behaviour we want but would prefer it if Konrad confirmed).

Acked! Thanks for doing this.

> 
> Also consider for 4.1.
> 
> Thanks.
> 
> David
> 
>  docs/misc/xen-command-line.markdown |    8 +++++++-
>  xen/arch/x86/domain_build.c         |   10 ++++++++++
>  2 files changed, 17 insertions(+), 1 deletions(-)
> 
> diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
> index beb8462..0798700 100644
> --- a/docs/misc/xen-command-line.markdown
> +++ b/docs/misc/xen-command-line.markdown
> @@ -221,12 +221,18 @@ Specify the total size for dom0.
>  ### dom0\_mem (x86)
>  > `= List of ( min:<value> | max: <value> | <value> )`
>  
> -each `<value>` is a size parameter.  If the size is positive, it represents an absolute value.  If the size is negative, the size specified is subtracted from the total available memory.
> +Specify the amount of memory for the initial domain (dom0) and the maximum reservation (the maximum amount of memory that dom0 can be increased or ballooned to).
> +
> +Each `<value>` is a size parameter.  If the size is positive, it represents an absolute value.  If the size is negative, the size specified is subtracted from the total available memory.
>  
>  * `min:<value>` specifies the minimum amount of memory allocated to dom0.
>  * `max:<value>` specifies the maximum amount of memory allocated to dom0.
>  * `<value>` specified the exact amount of memory allocated to dom0.
>  
> +If `max:<value>` is specified then this sets the maximum reservation, otherwise the maximum reservation is set to the amount of memory allocated to dom0.
> +
> +For example, with `dom0_mem=512M`, dom0 starts with 512 MB and cannot balloon up any more. With `dom0_mem=512M,max:2G`, dom0 starts with 512 MB of memory and can balloon up to 2 GB.
> +
>  ### dom0\_shadow
>  ### dom0\_vcpus\_pin
>  > `= <boolean>`
> diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
> index b3c5d4c..0c09abc 100644
> --- a/xen/arch/x86/domain_build.c
> +++ b/xen/arch/x86/domain_build.c
> @@ -253,6 +253,16 @@ static unsigned long __init compute_dom0_nr_pages(
>      }
>  #endif
>  
> +    /*
> +     * Set dom0's maximum reservation.
> +     *
> +     * If no maximum was set with dom0_mem=max:MMM, then the maximum
> +     * is the same as the initial number of pages.  This is so
> +     * dom0_mem=MMM gives the behaviour most people expect (i.e., this
> +     * much RAM and no more).
> +     */
> +    if ( max_pages == LONG_MAX )
> +        max_pages = nr_pages;
>      d->max_pages = min_t(unsigned long, max_pages, UINT_MAX);
>  
>      return nr_pages;
> -- 
> 1.7.2.5

  reply	other threads:[~2012-03-20 23:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 18:21 [PATCH] x86: set dom0's default maximum reservation to the initial number of pages David Vrabel
2012-03-20 23:41 ` Konrad Rzeszutek Wilk [this message]
2012-03-21  8:36 ` Jan Beulich
2012-03-21  9:58   ` David Vrabel
2012-03-21 10:14     ` Jan Beulich
2012-03-21 10:33       ` David Vrabel

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=20120320234139.GA19464@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=keir@xen.org \
    --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).