From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: Re: [PATCH 8/9] kvm: qemu: Drop the mutex while reading from tapfd Date: Fri, 25 Jul 2008 18:25:38 +0100 Message-ID: <1217006738.7098.97.camel@muff> References: <1216899979-32532-1-git-send-email-markmc@redhat.com> <1216899979-32532-2-git-send-email-markmc@redhat.com> <1216899979-32532-3-git-send-email-markmc@redhat.com> <1216899979-32532-4-git-send-email-markmc@redhat.com> <1216899979-32532-5-git-send-email-markmc@redhat.com> <1216899979-32532-6-git-send-email-markmc@redhat.com> <1216899979-32532-7-git-send-email-markmc@redhat.com> <1216899979-32532-8-git-send-email-markmc@redhat.com> <1216899979-32532-9-git-send-email-markmc@redhat.com> <4889112C.3050704@qumranet.com> Reply-To: Mark McLoughlin Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Herbert Xu , Rusty Russell To: Dor Laor Return-path: Received: from mx1.redhat.com ([66.187.233.31]:54644 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751303AbYGYRZx (ORCPT ); Fri, 25 Jul 2008 13:25:53 -0400 In-Reply-To: <4889112C.3050704@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 2008-07-25 at 02:33 +0300, Dor Laor wrote: > Mark McLoughlin wrote: > > The idea here is that with GSO, packets are much larger > > and we can allow the vcpu threads to e.g. process irq > > acks during the window where we're reading these > > packets from the tapfd. > > ... > > diff --git a/qemu/vl.c b/qemu/vl.c > > index efdaafd..de92848 100644 > > --- a/qemu/vl.c > > +++ b/qemu/vl.c > > @@ -4281,7 +4281,9 @@ static void tap_send(void *opaque) > > sbuf.buf = s->buf; > > s->size = getmsg(s->fd, NULL, &sbuf, &f) >=0 ? sbuf.len : -1; > > #else > > > Maybe do it only when GSO is actually used by the guest/tap. > Otherwise it can cause some ctx trashing right? (Strange habit you have of "top commenting" on patches :-) I've been meaning to do some profiling of just how long the vcpu thread spends blocking on the mutex in this case, both before and after the GSO patches. i.e. this change may make sense even with smaller buffers ... > > + kvm_sleep_begin(); > > s->size = read(s->fd, s->buf, sizeof(s->buf)); > > + kvm_sleep_end(); Cheers, Mark.