From: Avi Kivity <avi@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Amos Kong <akong@redhat.com>,
aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com,
kvm@vger.kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH 0/2] virtio-pci: fix abort when fail to allocate ioeventfd
Date: Wed, 14 Mar 2012 12:05:56 +0200 [thread overview]
Message-ID: <4F606D84.8000807@redhat.com> (raw)
In-Reply-To: <CAJSP0QXxD8fSU1TrJsMj2owpBr4n8etycEr6gj08suMapu+=LQ@mail.gmail.com>
On 03/14/2012 11:59 AM, Stefan Hajnoczi wrote:
> On Wed, Mar 14, 2012 at 9:22 AM, Avi Kivity <avi@redhat.com> wrote:
> > On 03/13/2012 12:42 PM, Amos Kong wrote:
> >> Boot up guest with 232 virtio-blk disk, qemu will abort for fail to
> >> allocate ioeventfd. This patchset changes kvm_has_many_ioeventfds(),
> >> and check if available ioeventfd exists. If not, virtio-pci will
> >> fallback to userspace, and don't use ioeventfd for io notification.
> >
> > How about an alternative way of solving this, within the memory core:
> > trap those writes in qemu and write to the ioeventfd yourself. This way
> > ioeventfds work even without kvm:
> >
> >
> > core: create eventfd
> > core: install handler for memory address that writes to ioeventfd
> > kvm (optional): install kernel handler for ioeventfd
> >
> > even if the third step fails, the ioeventfd still works, it's just slower.
>
> That approach will penalize guests with large numbers of disks - they
> see an extra switch to vcpu thread instead of kvm.ko -> iothread.
It's only a failure path. The normal path is expected to have a kvm
ioeventfd installed.
> It
> seems okay provided we can solve the limit in the kernel once and for
> all by introducing a more dynamic data structure for in-kernel
> devices. That way future kernels will never hit an arbitrary limit
> below their file descriptor rlimit.
>
> Is there some reason why kvm.ko must use a fixed size array? Would it
> be possible to use a tree (maybe with a cache for recent lookups)?
It does use bsearch today IIRC. We'll expand the limit, but there must
be a limit, and qemu must be prepared to deal with it.
--
error compiling committee.c: too many arguments to function
WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com,
kvm@vger.kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org,
Amos Kong <akong@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 0/2] virtio-pci: fix abort when fail to allocate ioeventfd
Date: Wed, 14 Mar 2012 12:05:56 +0200 [thread overview]
Message-ID: <4F606D84.8000807@redhat.com> (raw)
In-Reply-To: <CAJSP0QXxD8fSU1TrJsMj2owpBr4n8etycEr6gj08suMapu+=LQ@mail.gmail.com>
On 03/14/2012 11:59 AM, Stefan Hajnoczi wrote:
> On Wed, Mar 14, 2012 at 9:22 AM, Avi Kivity <avi@redhat.com> wrote:
> > On 03/13/2012 12:42 PM, Amos Kong wrote:
> >> Boot up guest with 232 virtio-blk disk, qemu will abort for fail to
> >> allocate ioeventfd. This patchset changes kvm_has_many_ioeventfds(),
> >> and check if available ioeventfd exists. If not, virtio-pci will
> >> fallback to userspace, and don't use ioeventfd for io notification.
> >
> > How about an alternative way of solving this, within the memory core:
> > trap those writes in qemu and write to the ioeventfd yourself. This way
> > ioeventfds work even without kvm:
> >
> >
> > core: create eventfd
> > core: install handler for memory address that writes to ioeventfd
> > kvm (optional): install kernel handler for ioeventfd
> >
> > even if the third step fails, the ioeventfd still works, it's just slower.
>
> That approach will penalize guests with large numbers of disks - they
> see an extra switch to vcpu thread instead of kvm.ko -> iothread.
It's only a failure path. The normal path is expected to have a kvm
ioeventfd installed.
> It
> seems okay provided we can solve the limit in the kernel once and for
> all by introducing a more dynamic data structure for in-kernel
> devices. That way future kernels will never hit an arbitrary limit
> below their file descriptor rlimit.
>
> Is there some reason why kvm.ko must use a fixed size array? Would it
> be possible to use a tree (maybe with a cache for recent lookups)?
It does use bsearch today IIRC. We'll expand the limit, but there must
be a limit, and qemu must be prepared to deal with it.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-03-14 10:06 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 10:42 [PATCH 0/2] virtio-pci: fix abort when fail to allocate ioeventfd Amos Kong
2012-03-13 10:42 ` [Qemu-devel] " Amos Kong
2012-03-13 10:42 ` [PATCH 1/2] return available ioeventfds count in kvm_has_many_ioeventfds() Amos Kong
2012-03-13 10:42 ` [Qemu-devel] " Amos Kong
2012-03-13 11:50 ` Jan Kiszka
2012-03-13 11:50 ` [Qemu-devel] " Jan Kiszka
2012-03-13 12:00 ` Amos Kong
2012-03-13 12:24 ` Jan Kiszka
2012-03-13 13:05 ` Amos Kong
2012-03-13 10:42 ` [PATCH 2/2] virtio-pci: fallback to userspace when there is no enough available ioeventfd Amos Kong
2012-03-13 10:42 ` [Qemu-devel] " Amos Kong
2012-03-13 11:23 ` [PATCH 0/2] virtio-pci: fix abort when fail to allocate ioeventfd Stefan Hajnoczi
2012-03-13 11:23 ` [Qemu-devel] " Stefan Hajnoczi
2012-03-13 11:51 ` Amos Kong
2012-03-13 11:51 ` Amos Kong
2012-03-13 14:30 ` Stefan Hajnoczi
2012-03-13 14:30 ` Stefan Hajnoczi
2012-03-13 14:47 ` Amos Kong
2012-03-13 14:47 ` Amos Kong
2012-03-13 16:36 ` Stefan Hajnoczi
2012-03-13 16:36 ` Stefan Hajnoczi
2012-03-14 0:30 ` Amos Kong
2012-03-14 0:30 ` Amos Kong
2012-03-14 8:57 ` Stefan Hajnoczi
2012-03-14 8:57 ` Stefan Hajnoczi
2012-03-14 9:22 ` Avi Kivity
2012-03-14 9:22 ` [Qemu-devel] " Avi Kivity
2012-03-14 9:59 ` Stefan Hajnoczi
2012-03-14 9:59 ` [Qemu-devel] " Stefan Hajnoczi
2012-03-14 10:05 ` Avi Kivity [this message]
2012-03-14 10:05 ` Avi Kivity
2012-03-14 10:39 ` Stefan Hajnoczi
2012-03-14 10:39 ` [Qemu-devel] " Stefan Hajnoczi
2012-03-14 10:46 ` Avi Kivity
2012-03-14 10:46 ` [Qemu-devel] " Avi Kivity
2012-03-14 11:46 ` Stefan Hajnoczi
2012-03-14 11:46 ` [Qemu-devel] " Stefan Hajnoczi
2012-03-16 8:59 ` Amos Kong
2012-03-16 8:59 ` [Qemu-devel] " Amos Kong
2012-03-19 8:21 ` Stefan Hajnoczi
2012-03-19 8:21 ` [Qemu-devel] " Stefan Hajnoczi
2012-03-19 10:11 ` Avi Kivity
2012-03-19 10:11 ` [Qemu-devel] " Avi Kivity
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=4F606D84.8000807@redhat.com \
--to=avi@redhat.com \
--cc=akong@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.