From: Alex Williamson <alex.williamson@redhat.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: Amos Kong <akong@redhat.com>,
kvm@vger.kernel.org, jasowang@redhat.com, mtosatti@redhat.com,
avi@redhat.com
Subject: Re: [PATCH v4] KVM: Resize kvm_io_range array dynamically
Date: Thu, 01 Mar 2012 08:33:05 -0700 [thread overview]
Message-ID: <1330615985.23708.5.camel@ul30vt> (raw)
In-Reply-To: <CA+1xoqfYjAf2dxFU=rUohi0+f-YvdTsU+RS+tZbOVwu=aHBkEw@mail.gmail.com>
On Thu, 2012-03-01 at 12:14 +0200, Sasha Levin wrote:
> On Thu, Mar 1, 2012 at 9:01 AM, Amos Kong <akong@redhat.com> wrote:
> > This patch makes the kvm_io_range array can be resized dynamically.
> > Set an upper bounds for kvm_io_range to limit userspace.
> > 1000 is a very large limit and not bloat the typical user.
>
> Whats the reason for making everything dynamic? Memory savings there
> aren't that significant.
We're currently looking at about 14k for these arrays with 300 entries
since we have two of them. If we're going to double it or triple it to
handle the maximum use case, why impose that on the typical VM? It may
not be multiple megabytes, but I wouldn't say it's insignificant either.
>
> If you want to make it more efficient just define:
> static struct kvm_io_bus io_bus[2];
>
> somewhere in kvm_main.c, and just switch between them when you need to
> do insertion and removal of devices. You get the benefit of zero slub
> usage, no allocations in any of the paths, and much simpler logic.
It's updated via rcu. The change Amos is proposing is fairly trivial;
allocate the necessary size and memcpy instead of memdup. Maybe it can
be optimized further, but this seems like a step in the right direction
to handle worst case use and, if anything, benefit the typical user too.
Thanks,
Alex
next prev parent reply other threads:[~2012-03-01 15:33 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 5:24 [PATCH] KVM: Resize kvm_io_bus_range array dynamically Amos Kong
2012-02-29 5:50 ` [PATCH v2] KVM: Resize kvm_io_range " Amos Kong
2012-02-29 13:30 ` [PATCH v3] " Amos Kong
2012-02-29 14:19 ` Jan Kiszka
2012-02-29 15:22 ` Amos Kong
2012-02-29 15:29 ` Jan Kiszka
2012-02-29 16:34 ` Amos Kong
2012-03-01 5:19 ` Amos Kong
2012-03-01 7:01 ` [PATCH v4] " Amos Kong
2012-03-01 10:14 ` Sasha Levin
2012-03-01 15:33 ` Alex Williamson [this message]
2012-03-07 10:57 ` Avi Kivity
2012-03-07 12:51 ` Amos Kong
2012-03-07 14:12 ` Avi Kivity
2012-03-07 13:16 ` [PATCH v5 1/2] KVM: resize " Amos Kong
2012-03-07 13:16 ` [PATCH v5 2/2] KVM: set upper bounds for iobus dev to limit userspace Amos Kong
2012-03-07 13:20 ` [RESEND PATCH v5 0/2] fix ENOSPC issue of iobus dev Amos Kong
2012-03-07 13:20 ` [RESEND PATCH v5 1/2] KVM: resize kvm_io_range array dynamically Amos Kong
2012-03-07 13:20 ` [RESEND PATCH v5 2/2] KVM: set upper bounds for iobus dev to limit userspace Amos Kong
2012-03-08 2:03 ` [PATCH v6 0/2] fix ENOSPC issue of iobus dev Amos Kong
2012-03-08 2:03 ` [PATCH v6 1/2] KVM: resize kvm_io_range array dynamically Amos Kong
2012-03-08 23:20 ` Marcelo Tosatti
2012-03-09 4:05 ` Amos Kong
2012-03-08 2:04 ` [PATCH v6 2/2] KVM: set upper bounds for iobus dev to limit userspace Amos Kong
2012-03-09 4:17 ` [PATCH v7 0/2] fix ENOSPC issue of iobus dev Amos Kong
2012-03-09 4:17 ` [PATCH v7 1/2] KVM: resize kvm_io_range array dynamically Amos Kong
2012-03-09 4:17 ` [PATCH v7 2/2] KVM: set upper bounds for iobus dev to limit userspace Amos Kong
2012-03-09 21:07 ` [PATCH v7 0/2] fix ENOSPC issue of iobus dev Marcelo Tosatti
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=1330615985.23708.5.camel@ul30vt \
--to=alex.williamson@redhat.com \
--cc=akong@redhat.com \
--cc=avi@redhat.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=mtosatti@redhat.com \
/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).