Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753873AbbGPLFq (ORCPT ); Thu, 16 Jul 2015 07:05:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37048 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753064AbbGPLFm (ORCPT ); Thu, 16 Jul 2015 07:05:42 -0400 Date: Thu, 16 Jul 2015 13:05:39 +0200 From: Igor Mammedov To: linux-kernel@vger.kernel.org Cc: mst@redhat.com, kvm@vger.kernel.org Subject: Re: [PATCH v4 2/2] vhost: add max_mem_regions module parameter Message-ID: <20150716130539.38729e67@nial.brq.redhat.com> In-Reply-To: <1435842491-131872-3-git-send-email-imammedo@redhat.com> References: <1435842491-131872-1-git-send-email-imammedo@redhat.com> <1435842491-131872-3-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2164 Lines: 66 On Thu, 2 Jul 2015 15:08:11 +0200 Igor Mammedov wrote: > it became possible to use a bigger amount of memory > slots, which is used by memory hotplug for > registering hotplugged memory. > However QEMU crashes if it's used with more than ~60 > pc-dimm devices and vhost-net enabled since host kernel > in module vhost-net refuses to accept more than 64 > memory regions. > > Allow to tweak limit via max_mem_regions module paramemter > with default value set to 64 slots. Michael, what was the reason not to rise default? As much as I think I can't come up with one. Making it as module option doesn't make much sense since old userspace will crash on new kernels anyway until admins learn that there is a module option to rise limit. Rising default limit on par with kvm's will help to avoid those crashes and would allow to drop not necessary option to reduce user confusion. > > Signed-off-by: Igor Mammedov > --- > drivers/vhost/vhost.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 6488011..9a68e2e 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -29,8 +29,12 @@ > > #include "vhost.h" > > +static ushort max_mem_regions = 64; > +module_param(max_mem_regions, ushort, 0444); > +MODULE_PARM_DESC(max_mem_regions, > + "Maximum number of memory regions in memory map. (default: 64)"); > + > enum { > - VHOST_MEMORY_MAX_NREGIONS = 64, > VHOST_MEMORY_F_LOG = 0x1, > }; > > @@ -696,7 +700,7 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m) > return -EFAULT; > if (mem.padding) > return -EOPNOTSUPP; > - if (mem.nregions > VHOST_MEMORY_MAX_NREGIONS) > + if (mem.nregions > max_mem_regions) > return -E2BIG; > newmem = vhost_kvzalloc(size + mem.nregions * sizeof(*m->regions)); > if (!newmem) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/