From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: [PATCH 12/12] kvm: qemu: Drop the mutex while reading from tapfd Date: Mon, 11 Aug 2008 21:12:15 +0100 Message-ID: <1218485535-877-13-git-send-email-markmc@redhat.com> References: <1218485535-877-1-git-send-email-markmc@redhat.com> <1218485535-877-2-git-send-email-markmc@redhat.com> <1218485535-877-3-git-send-email-markmc@redhat.com> <1218485535-877-4-git-send-email-markmc@redhat.com> <1218485535-877-5-git-send-email-markmc@redhat.com> <1218485535-877-6-git-send-email-markmc@redhat.com> <1218485535-877-7-git-send-email-markmc@redhat.com> <1218485535-877-8-git-send-email-markmc@redhat.com> <1218485535-877-9-git-send-email-markmc@redhat.com> <1218485535-877-10-git-send-email-markmc@redhat.com> <1218485535-877-11-git-send-email-markmc@redhat.com> <1218485535-877-12-git-send-email-markmc@redhat.com> Cc: kvm@vger.kernel.org, Mark McLoughlin To: Avi Kivity Return-path: Received: from mail14.svc.cra.dublin.eircom.net ([159.134.118.30]:45885 "HELO mail14.svc.cra.dublin.eircom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1757533AbYHKUMf (ORCPT ); Mon, 11 Aug 2008 16:12:35 -0400 In-Reply-To: <1218485535-877-12-git-send-email-markmc@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. One known issue with this is that it triggers a subtle SMP race in the kernel's posix-timers and signalfd code. See here for more details and a test case: http://lkml.org/lkml/2008/7/17/151 The symptoms of this are that: a) occassionally throughput drops almost to zero b) manually doing "killall -ALRM qemu-kvm" kicks qemu out if its funk. Signed-off-by: Mark McLoughlin --- qemu/vl.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qemu/vl.c b/qemu/vl.c index 499d6f9..d3ca0f1 100644 --- a/qemu/vl.c +++ b/qemu/vl.c @@ -4489,7 +4489,9 @@ static void tap_send(void *opaque) sbuf.buf = s->buf; s->size = getmsg(s->fd, NULL, &sbuf, &f) >=0 ? sbuf.len : -1; #else + kvm_sleep_begin(); s->size = read(s->fd, s->buf, sizeof(s->buf)); + kvm_sleep_end(); #endif if (s->size == -1 && errno == EINTR) -- 1.5.4.1