From patchwork Fri Apr 29 07:38:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 740521 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3T7dS6B007715 for ; Fri, 29 Apr 2011 07:39:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756143Ab1D2HjZ (ORCPT ); Fri, 29 Apr 2011 03:39:25 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:47622 "EHLO mail-px0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755833Ab1D2HjZ (ORCPT ); Fri, 29 Apr 2011 03:39:25 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 29 Apr 2011 07:39:28 +0000 (UTC) X-Greylist: delayed 1805 seconds by postgrey-1.27 at vger.kernel.org; Fri, 29 Apr 2011 03:39:25 EDT Received: by pxi16 with SMTP id 16so644271pxi.4 for ; Fri, 29 Apr 2011 00:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type; bh=w4XUw6CILVm6TLAnNG+/MyS714K1Y7mQG/ExuKMkZjg=; b=MtbETG0ebDUzJc9oI6j/Xcjv2t0kQCSf3rhCnN5yEhS0hZa8aP9pwX8pksq9p29INP C0XDSb/epR7ZGLh27oDybmbixKlNYygO/RZ6eNWAefl3wb/MVTkZVk/xojrrET8czXiY WmEUvby6HSB/ew1+B65aMhOru8Z1SFTVbJXSM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=aVJCeunznMb85ymlWfLIPIec2Bu0DuFDmLVmkLHAab0yrCWvxabFbC14uDJqFWnWd2 hW2NauypFCYW1vgrDmb0s1C7pBPmlj4WJOHvD/nhjqw+BMr8kllhD+OdiKEHQiQoR2/h FA3H2GRKsDc7Ksxin603HgPidrfqKdp23lWt4= Received: by 10.142.56.19 with SMTP id e19mr1662670wfa.153.1304062764584; Fri, 29 Apr 2011 00:39:24 -0700 (PDT) Received: from [172.16.3.163] ([219.224.169.130]) by mx.google.com with ESMTPS id z10sm2881539wfj.15.2011.04.29.00.39.19 (version=SSLv3 cipher=OTHER); Fri, 29 Apr 2011 00:39:23 -0700 (PDT) Message-ID: <4DBA6AE5.8090703@gmail.com> Date: Fri, 29 Apr 2011 15:38:13 +0800 From: Asias He User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Pekka Enberg CC: Cyrill Gorcunov , Ingo Molnar , Sasha Levin , Prasad Joshi , kvm@vger.kernel.org Subject: Re: [PATCH 1/3] kvm tools: Make virtio-net kvm__irq_line thread safe References: <1304058985-13833-1-git-send-email-asias.hejun@gmail.com> <4DBA6519.5070509@gmail.com> In-Reply-To: X-Enigmail-Version: 1.1.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 04/29/2011 03:15 PM, Pekka Enberg wrote: > On Fri, Apr 29, 2011 at 10:13 AM, Asias He wrote: >> No. We only need it in RX path. Sasha's threadpool patch breaks this. >> I'm just moving it back. > > OK, cool! Can you send the fix as a separate patch? > Here you go. From 9c188853435be23ad2a73b5062690eb9f2ff1d25 Mon Sep 17 00:00:00 2001 From: Asias He Date: Fri, 29 Apr 2011 10:43:35 +0800 Subject: [PATCH] kvm tools: Fix virtio-net RX path IRQ latency The TX path does not need this ;-) Signed-off-by: Asias He --- tools/kvm/virtio-net.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/kvm/virtio-net.c b/tools/kvm/virtio-net.c index 58b3de4..310c061 100644 --- a/tools/kvm/virtio-net.c +++ b/tools/kvm/virtio-net.c @@ -77,9 +77,10 @@ static void virtio_net_rx_callback(struct kvm *self, void *param) head = virt_queue__get_iov(vq, iov, &out, &in, self); len = readv(net_device.tap_fd, iov, in); virt_queue__set_used_elem(vq, head, len); - } - kvm__irq_line(self, VIRTIO_NET_IRQ, 1); + /* We should interrupt guest right now, otherwise latency is huge. */ + kvm__irq_line(self, VIRTIO_NET_IRQ, 1); + } } static void virtio_net_tx_callback(struct kvm *self, void *param) -- 1.7.4.4