From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Aloni Subject: Re: [PATCH] drivers/vhost/scsi.c: avoid a 10-order allocation Date: Wed, 4 Sep 2013 12:27:04 +0300 Message-ID: <20130904092703.GB12841@gmail.com> References: <1376815736-21003-1-git-send-email-alonid@stratoscale.com> <20130818091838.GB17111@redhat.com> <20130904090201.GA31564@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org To: "Michael S. Tsirkin" Return-path: Received: from mail-we0-f174.google.com ([74.125.82.174]:54356 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762210Ab3IDJ1J (ORCPT ); Wed, 4 Sep 2013 05:27:09 -0400 Received: by mail-we0-f174.google.com with SMTP id q54so47105wes.5 for ; Wed, 04 Sep 2013 02:27:08 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130904090201.GA31564@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Sep 04, 2013 at 12:02:01PM +0300, Michael S. Tsirkin wrote: > On Sun, Aug 18, 2013 at 12:18:38PM +0300, Michael S. Tsirkin wrote: > > On Sun, Aug 18, 2013 at 11:48:56AM +0300, Dan Aloni wrote: > > > On 3.10.7 and x86_64, as a result of sizeof(struct vhost_scsi) being > > > 2152960 bytes the allocation failed once on my development machine. > > > > > > Saw it would be prudent to split the bulk of it, which is the vqs array > > > into separately allocated parts. sizeof(struct vhost_virtqueue) is > > > currently 16816 bytes. > > > > > > Signed-off-by: Dan Aloni > > > > This extra indirection is likely to have measureable cost though. > > > > net core saw a similar problem, it was fixed in patch > > net: allow large number of tx queues > > > > So let's do it in a similar way: try to allocate with > > GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT > > and if that fails, do vmalloc. > > > > To free, we can do > > if (is_vmalloc_addr()) > > vfree(); > > else > > kfree(); > > > > > > Hi Dan, > were you going to make this change? Or prefer me to do it? Hey Michael, I prefer you go ahead and do as your suggestion. I got distracted with other matters in the meanwhile. -- Dan Aloni