From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqDx9-00089p-O5 for qemu-devel@nongnu.org; Thu, 07 May 2015 01:02:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqDwu-0004Vf-PZ for qemu-devel@nongnu.org; Thu, 07 May 2015 01:02:31 -0400 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:52503) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqDwu-0004VQ-4p for qemu-devel@nongnu.org; Thu, 07 May 2015 01:02:16 -0400 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 May 2015 10:32:13 +0530 Date: Thu, 7 May 2015 10:31:35 +0530 From: Bharata B Rao Message-ID: <20150507050134.GX18380@in.ibm.com> References: <1429858066-12088-1-git-send-email-bharata@linux.vnet.ibm.com> <1429858066-12088-22-git-send-email-bharata@linux.vnet.ibm.com> <20150505104850.361388c8@nial.brq.redhat.com> <20150506082305.GS18380@in.ibm.com> <20150507011236.GI1407@voom.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150507011236.GI1407@voom.redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH v3 21/24] spapr: Initialize hotplug memory address space Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, Igor Mammedov , afaerber@suse.de On Thu, May 07, 2015 at 11:12:36AM +1000, David Gibson wrote: > On Wed, May 06, 2015 at 01:53:05PM +0530, Bharata B Rao wrote: > > On Tue, May 05, 2015 at 10:48:50AM +0200, Igor Mammedov wrote: > > > On Fri, 24 Apr 2015 12:17:43 +0530 > > > Bharata B Rao wrote: > > > > > > > Initialize a hotplug memory region under which all the hotplugged > > > > memory is accommodated. Also enable memory hotplug by setting > > > > CONFIG_MEM_HOTPLUG. > > > > > > > > } > > > > > > > > static void ppc_cpu_do_nmi_on_cpu(void *arg) > > > > diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h > > > > index ecac6e3..53560e9 100644 > > > > --- a/include/hw/ppc/spapr.h > > > > +++ b/include/hw/ppc/spapr.h > > > > @@ -542,6 +542,18 @@ struct sPAPREventLogEntry { > > > > > > > > #define SPAPR_MEMORY_BLOCK_SIZE (1 << 28) /* 256MB */ > > > > > > > > +/* > > > > + * This defines the maximum number of DIMM slots we can have for sPAPR > > > > + * guest. This is not defined by sPAPR but we are defining it to 4096 slots > > > > + * here. With the worst case addition of SPAPR_MEMORY_BLOCK_SIZE > > > > + * (256MB) memory per slot, we should be able to support 1TB of guest > > > > + * hotpluggable memory. > > > > + */ > > > > +#define SPAPR_MAX_RAM_SLOTS (1ULL << 12) > > > why not write 4096 instead of (1ULL << 12), much easier to read. > > > > Sure. > > > > > > > > BTW: > > > KVM supports upto 509 memory slots including slots consumed by > > > initial memory. > > > > I see that PowerPC defaults to 32 slots. So having 4096 slots is really > > pointless then ? So to ensure more hot-pluggable memory space is available > > should I be increasing the size of the minimum pluggable memory in a > > dimm slot (as defined by SPAPR_MEMORY_BLOCK_SIZE above) ? > > That seems a bit nasty, since then the granularity of adding blocks > will be enormous for small guests as well. > > Is it possible to increase the maximum size of a single DIMM, but not > the minimum? That way you can still do small inserts for small > guests. To get the full RAM for big guests youd have to insert big > chunks though, due to the limited number of slots. The maximum memory that can be plugged into a slot is not limited iiuc, so smaller and bigger guests can use memory sizes appropriate for them. Only the minimum size is restricted to SPAPR_MEMORY_BLOCK_SIZE (256M). So I guess I should just stick to 32 slots here for PowerPC memory hotplug implementation. Regards, Bharata.