kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Asias He <asias.hejun@gmail.com>
To: Pekka Enberg <penberg@kernel.org>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>, Ingo Molnar <mingo@elte.hu>,
	Sasha Levin <levinsasha928@gmail.com>,
	Prasad Joshi <prasadjoshi124@gmail.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH 1/3] kvm tools: Make virtio-net kvm__irq_line thread safe
Date: Fri, 29 Apr 2011 15:38:13 +0800	[thread overview]
Message-ID: <4DBA6AE5.8090703@gmail.com> (raw)
In-Reply-To: <BANLkTikJLdX4LeCq0pk0u4x3xhXL-DaWPw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

On 04/29/2011 03:15 PM, Pekka Enberg wrote:
> On Fri, Apr 29, 2011 at 10:13 AM, Asias He <asias.hejun@gmail.com> 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.

-- 
Best Regards,
Asias He

[-- Attachment #2: 0001-kvm-tools-Fix-virtio-net-RX-path-IRQ-latency.patch --]
[-- Type: text/x-patch, Size: 1022 bytes --]

>From 9c188853435be23ad2a73b5062690eb9f2ff1d25 Mon Sep 17 00:00:00 2001
From: Asias He <asias.hejun@gmail.com>
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 <asias.hejun@gmail.com>
---
 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


  reply	other threads:[~2011-04-29  7:39 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29  6:36 [PATCH 1/3] kvm tools: Make virtio-net kvm__irq_line thread safe Asias He
2011-04-29  6:36 ` [PATCH 2/3] kvm tools: Make virtio-console " Asias He
2011-04-29  6:44   ` Ingo Molnar
2011-04-29  6:36 ` [PATCH 3/3] kvm tools: Make virtio-blk " Asias He
2011-04-29  6:44   ` Ingo Molnar
2011-04-29  6:55     ` Pekka Enberg
2011-04-29  7:26       ` Asias He
2011-04-29  7:55         ` Pekka Enberg
2011-04-29  8:29           ` Sasha Levin
2011-04-29  6:46 ` [PATCH 1/3] kvm tools: Make virtio-net " Ingo Molnar
2011-04-29  6:52 ` Pekka Enberg
2011-04-29  7:13   ` Asias He
2011-04-29  7:15     ` Pekka Enberg
2011-04-29  7:38       ` Asias He [this message]
2011-04-29  7:45         ` Ingo Molnar
2011-04-29  7:53     ` Sasha Levin
2011-04-29 10:02       ` Cyrill Gorcunov
2011-04-29 10:37         ` Pekka Enberg
2011-04-29 10:47           ` Cyrill Gorcunov
2011-04-29 10:22       ` Ingo Molnar
2011-04-29 16:52         ` Sasha Levin
2011-04-29 20:39           ` Ingo Molnar
2011-04-29  7:30 ` Ingo Molnar
2011-04-29  7:47   ` Asias He
2011-04-29 10:32     ` Ingo Molnar
2011-04-29 10:42       ` Pekka Enberg
2011-04-29 17:43         ` Pekka Enberg
2011-04-29 19:59           ` Ingo Molnar
2011-04-30  7:44             ` Pekka Enberg

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=4DBA6AE5.8090703@gmail.com \
    --to=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    --cc=prasadjoshi124@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).