From: Asias He Subject: Re: [PATCH] kvm tools: Process virito blk requests in separate thread Date: Fri, 8 Jun 2012 11:30:59 +0800 Message-ID: References: <1338824453-25260-1-git-send-email-asias.hejun@gmail.com> <1338826065.3292.10.camel@lappy> <4FCF4E90.7050806@redhat.com> <4FD06AA9.1030606@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Sasha Levin , Pekka Enberg , Ingo Molnar , Cyrill Gorcunov , kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mail-pb0-f46.google.com ([209.85.160.46]:41112 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752062Ab2FHDbk convert rfc822-to-8bit (ORCPT ); Thu, 7 Jun 2012 23:31:40 -0400 Received: by pbbrp8 with SMTP id rp8so1954405pbb.19 for ; Thu, 07 Jun 2012 20:31:39 -0700 (PDT) In-Reply-To: <4FD06AA9.1030606@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jun 7, 2012 at 4:47 PM, Paolo Bonzini wro= te: > Il 07/06/2012 03:38, Asias He ha scritto: >>> > I never looked at the kvmtool code, but I think Asias has a point= =2E =C2=A0If >>> > the guest submits I/O to lots of devices, they would contend on t= he >>> > single thread. =C2=A0There was a similar proof of concept patch f= or QEMU that >>> > provided substantial benefit. >>> > >>> > However, it sounds a bit wasteful to have the dedicated thread ru= n with >>> > a second eventfd. =C2=A0Would it be hard to just use the virtio-b= lk ioeventfd >>> > directly? >> Without this patch, we are already using the virtio-blk ioeventfd >> which is being monitored in the shared ioeventfd__thread() thead. > > Yes, I understood that. :) ;-) > I'm wondering why it is still necessary to > monitor that eventfd in the shared thread. =C2=A0Perhaps you could op= tionally > skip the epoll registration/deregistration in ioeventfd__{add,del}_ev= ent. Yes, we can monitor the eventfd only in block thread. But that requires changing our virtio core code and doing ioeventfd setup in block specific code. This still does not save a thread for us. And the overhead of using shared eventfd + notify to block thead should be small. So I'd prefer the current model. --=20 Asias He