kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Dan Aloni <alonid@stratoscale.com>
Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] drivers/vhost/scsi.c: avoid a 10-order allocation
Date: Wed, 4 Sep 2013 12:02:01 +0300	[thread overview]
Message-ID: <20130904090201.GA31564@redhat.com> (raw)
In-Reply-To: <20130818091838.GB17111@redhat.com>

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 <alonid@stratoscale.com>
> 
> 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?

-- 
MST

  reply	other threads:[~2013-09-04  9:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-18  8:48 [PATCH] drivers/vhost/scsi.c: avoid a 10-order allocation Dan Aloni
2013-08-18  9:18 ` Michael S. Tsirkin
2013-09-04  9:02   ` Michael S. Tsirkin [this message]
2013-09-04  9:27     ` Dan Aloni

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=20130904090201.GA31564@redhat.com \
    --to=mst@redhat.com \
    --cc=alonid@stratoscale.com \
    --cc=kvm@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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).