qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: Thomas Huth <thuth@redhat.com>,
	imammedo@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH v0 0/2] Increase max memslots to 512 for PowerPC
Date: Fri, 3 Jun 2016 11:14:42 +1000	[thread overview]
Message-ID: <20160603011442.GC1087@voom.fritz.box> (raw)
In-Reply-To: <20160602140737.GB18628@in.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 4489 bytes --]

On Thu, Jun 02, 2016 at 07:37:37PM +0530, Bharata B Rao wrote:
> On Thu, Jun 02, 2016 at 09:03:15AM +0200, Thomas Huth wrote:
> > On 02.06.2016 06:39, Bharata B Rao wrote:
> > ...
> > > Agreed. Here is the updated patch:
> > > 
> > > spapr: Increase hotpluggable memory slots to 256
> > > 
> > > From: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > > 
> > > KVM now supports 512 memslots on PowerPC (earlier it was 32). Allow half
> > > of it (256) to be used as hotpluggable memory slots.
> > > 
> > > Instead of hard coding the max value, use the KVM supplied value if KVM
> > > is enabled. Otherwise resort to the default value of 32.
> > > 
> > > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > > ---
> > >  hw/ppc/spapr.c |   15 +++++++++++++--
> > >  1 file changed, 13 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > > index 44e401a..c82adef 100644
> > > --- a/hw/ppc/spapr.c
> > > +++ b/hw/ppc/spapr.c
> > > @@ -1816,11 +1816,22 @@ static void ppc_spapr_init(MachineState *machine)
> > >      /* initialize hotplug memory address space */
> > >      if (machine->ram_size < machine->maxram_size) {
> > >          ram_addr_t hotplug_mem_size = machine->maxram_size - machine->ram_size;
> > > +        /*
> > > +         * Number of memslots supported by KVM on PowerPC was increased
> > > +         * from 32 to 512. Let us limit the number of hotpluggable slots
> > > +         * to half of that (256). However ensure that number of slots
> > > +         * doesn't drop below 32 on older hosts.
> > > +         */
> > 
> > Using "hard-coded" information like "increased to 512" in comments is
> > true for the current state, but this has a risk of being out of date
> > soon. Once we change the memslots in the kernel, this comment is not
> > true anymore and might cause confusion. Better talk about leaving half
> > of the kernel memslots for PCI and other devices, or so.
> 
> Just want to note that even though we are limiting hotpluggable memory
> slots to half of max, it is always possible for other devices to eat
> into the memory hotplug slots, right ?
> 
> David - here is the patch updated with comments as suggested by Thomas.
> If you need a separate post, let me know.

Applied to ppc-for-2.7, thanks.

> 
> spapr: Increase hotpluggable memory slots to 256
> 
> From: Bharata B Rao <bharata@linux.vnet.ibm.com>
> 
> KVM now supports 512 memslots on PowerPC (earlier it was 32). Allow half
> of it (256) to be used as hotpluggable memory slots.
> 
> Instead of hard coding the max value, use the KVM supplied value if KVM
> is enabled. Otherwise resort to the default value of 32.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> ---
>  hw/ppc/spapr.c |   14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 44e401a..14cc6ae 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1816,11 +1816,21 @@ static void ppc_spapr_init(MachineState *machine)
>      /* initialize hotplug memory address space */
>      if (machine->ram_size < machine->maxram_size) {
>          ram_addr_t hotplug_mem_size = machine->maxram_size - machine->ram_size;
> +        /*
> +         * Limit the number of hotpluggable memory slots to half the number
> +         * slots that KVM supports, leaving the other half for PCI and other
> +         * devices. However ensure that number of slots doesn't drop below 32.
> +         */
> +        int max_memslots = kvm_enabled() ? kvm_get_max_memslots() / 2 :
> +                           SPAPR_MAX_RAM_SLOTS;
>  
> -        if (machine->ram_slots > SPAPR_MAX_RAM_SLOTS) {
> +        if (max_memslots < SPAPR_MAX_RAM_SLOTS) {
> +            max_memslots = SPAPR_MAX_RAM_SLOTS;
> +        }
> +        if (machine->ram_slots > max_memslots) {
>              error_report("Specified number of memory slots %"
>                           PRIu64" exceeds max supported %d",
> -                         machine->ram_slots, SPAPR_MAX_RAM_SLOTS);
> +                         machine->ram_slots, max_memslots);
>              exit(1);
>          }
>  
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-06-03  1:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201606010952.u519n6ri025307@mx0a-001b2d01.pphosted.com>
2016-06-01 10:18 ` [Qemu-devel] [RFC PATCH v0 0/2] Increase max memslots to 512 for PowerPC Thomas Huth
2016-06-02  0:42   ` David Gibson
2016-06-02  4:39     ` Bharata B Rao
2016-06-02  7:03       ` Thomas Huth
2016-06-02 14:07         ` Bharata B Rao
2016-06-02 17:17           ` Thomas Huth
2016-06-03  1:14           ` David Gibson [this message]
2016-06-01  9:51 Bharata B Rao

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=20160603011442.GC1087@voom.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.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).