From: Dor Laor <dor.laor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: kvm-devel
<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
virtualization
<virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>,
Anthony Liguori
<aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>,
Subject: [Virtio-for-kvm] [PATCH 10/13] [Mostly resend] virtio additions
Date: Fri, 21 Dec 2007 17:26:08 +0200 [thread overview]
Message-ID: <476BDB10.7090006@qumranet.com> (raw)
From 7354db58f496b06369e57d9be87e9c84db087690 Mon Sep 17 00:00:00 2001
From: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Date: Wed, 12 Dec 2007 14:52:00 +0200
Subject: [PATCH] Don't arm tx hrtimer with a constant 500us each transmit
The current start_xmit sets 500us hrtimer to kick the host.
The problem is that if another xmit happens before the timer was fired then
the first xmit will have to wait additional 500us.
This patch does not re-arm the timer if there is existing one.
This will shorten the latency for tx.
It improves tx throughput by 20%
Signed-off-by: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
---
drivers/net/virtio_net.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 538cc37..0403d65 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -392,10 +392,10 @@ again:
vi->stats.sendq_kicks++;
vi->svq->vq_ops->kick(vi->svq);
vi->out_num = 0;
- } else {
- vi->stats.hrtimer_starts++;
- hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
- HRTIMER_MODE_REL);
+ } else if (!hrtimer_is_queued(&vi->tx_timer)) {
+ vi->stats.hrtimer_starts++;
+ hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
+ HRTIMER_MODE_REL);
}
return 0;
}
--
1.5.3.3
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
reply other threads:[~2007-12-21 15:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=476BDB10.7090006@qumranet.com \
--to=dor.laor-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
--cc=dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org \
--cc=virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
/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