From patchwork Thu Jun 2 04:39:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharata B Rao X-Patchwork-Id: 9149011 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9BF6600BC for ; Thu, 2 Jun 2016 04:40:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1E07269DA for ; Thu, 2 Jun 2016 04:40:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A478E2823D; Thu, 2 Jun 2016 04:40:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D79D1269DA for ; Thu, 2 Jun 2016 04:40:30 +0000 (UTC) Received: from localhost ([::1]:45211 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8KQm-00058r-Se for patchwork-qemu-devel@patchwork.kernel.org; Thu, 02 Jun 2016 00:40:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8KQS-00055T-Uy for qemu-devel@nongnu.org; Thu, 02 Jun 2016 00:40:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8KQO-0004Ed-Nn for qemu-devel@nongnu.org; Thu, 02 Jun 2016 00:40:07 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57111 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8KQO-0004EW-Hq for qemu-devel@nongnu.org; Thu, 02 Jun 2016 00:40:04 -0400 Received: from pps.filterd (m0048817.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u524ZiVe027809 for ; Thu, 2 Jun 2016 00:40:03 -0400 Message-Id: <201606020440.u524ZiVe027809@mx0a-001b2d01.pphosted.com> Received: from e28smtp07.in.ibm.com (e28smtp07.in.ibm.com [125.16.236.7]) by mx0a-001b2d01.pphosted.com with ESMTP id 23a4fwvu0n-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 02 Jun 2016 00:40:03 -0400 Received: from localhost by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 2 Jun 2016 10:10:00 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp07.in.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 2 Jun 2016 10:09:58 +0530 X-IBM-Helo: d28dlp01.in.ibm.com X-IBM-MailFrom: bharata@linux.vnet.ibm.com X-IBM-RcptTo: qemu-devel@nongnu.org;qemu-ppc@nongnu.org Received: from d28relay07.in.ibm.com (d28relay07.in.ibm.com [9.184.220.158]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 025B1E0045; Thu, 2 Jun 2016 10:13:22 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay07.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u524duI131588546; Thu, 2 Jun 2016 10:09:56 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u524dtqi019360; Thu, 2 Jun 2016 10:09:55 +0530 Received: from in.ibm.com ([9.124.35.211]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u524drt9019268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA256 bits=256 verify=NO); Thu, 2 Jun 2016 10:09:54 +0530 Date: Thu, 2 Jun 2016 10:09:53 +0530 From: Bharata B Rao To: David Gibson References: <201606010952.u519n6ri025307@mx0a-001b2d01.pphosted.com> <574EB66E.1040805@redhat.com> <20160602004222.GE15455@voom.fritz.box> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160602004222.GE15455@voom.fritz.box> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16060204-0052-0000-0000-0000026B10EB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16060204-0053-0000-0000-00000CA1906B X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-06-02_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=7 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606020048 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: Re: [Qemu-devel] [RFC PATCH v0 0/2] Increase max memslots to 512 for PowerPC X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: bharata@linux.vnet.ibm.com Cc: imammedo@redhat.com, Thomas Huth , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Jun 02, 2016 at 10:42:23AM +1000, David Gibson wrote: > On Wed, Jun 01, 2016 at 12:18:22PM +0200, Thomas Huth wrote: > > On 01.06.2016 11:51, Bharata B Rao wrote: > > > Recently the number of memory slots supported by KVM for PowerPC was changed > > > from 32 to 512. QEMU was restricting the user specifiable hot-pluggable memory > > > slots to 32. This patchset changes that to 512. > > > > > > This allows more number of slots to be available for memory hotplugging. > > > > It's certainly a good idea to increase the number of slots for > > hot-pluggable memory. But should we really increase it to the full > > maximum of 512 slots? The in-kernel slots are shared with other memory > > regions, too, e.g. the memory slots for PCI cards. So if you allow the > > users to plug all slots with DIMMs, they certainly will run into > > problems there again later. > > > > I think x86 is also using 256 DIMM slots only on purpose (see > > https://lkml.org/lkml/2014/11/14/328 for example), so we should maybe > > also limit the max. number of DIMM slots on spapr to > > kvm_get_max_memslots() divided by two ? > > I tend to agree. I've held off on merging 2/2 pending outcome of this > discussion. Agreed. Here is the updated patch: spapr: Increase hotpluggable memory slots to 256 From: Bharata B Rao 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 --- 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. + */ + 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); }