public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org
Cc: kvm-devel
	<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	"virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: [PATCH] virtio_net tx performance fix
Date: Mon, 28 Jan 2008 10:11:39 -0600	[thread overview]
Message-ID: <479DFEBB.8010500@us.ibm.com> (raw)
In-Reply-To: <1201535954.2457.11.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>

Dor Laor wrote:
> On Mon, 2008-01-28 at 09:32 -0600, Anthony Liguori wrote:
>   
>> Hi Dor,
>>
>> How are you measuring performance?  The numbers I've gotten with netperf 
>> before and after your patch are:
>>
>> tx - 647.27mbit
>> rx - 89.22
>>
>> tx - 27.82
>> rx - 79.93
>>
>>     
>
> I've been testing with iperf (patched with Ingo's fix).
> I also tested tcp/udp (udp tx is only 550Mbps with the patch, w/o it's
> only 220Mbps)
>   

I can try iperf, but I think we should also try a pretty simple dd test 
to see if there's a real impact.

>> So this patch is pretty much killing performance for netperf.
>>
>>     
>
> Did you have hrtimer configured on the host?
>   

Yup.

> Here is start_xmit function:
>
> again:
> 	/* Free up any pending old buffers before queueing new ones. */
> 	free_old_xmit_skbs(vi);
> 	err = vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
>
> <<< here add_buf might fail since the ring is full.
> <<< once it fails, the original code called notify which triggered the
> <<< host to send all the pending tx so all descriptors are used.
>   

Notify, with KVM at least, will drain the TX ring.  So now, the TX ring 
should be empty.  The notification is disabled but notification should 
always happen when the queue is drained so an interrupt should occur 
which should cause the guest to immediately try again..

> 	if (err) {
> 		vi->stats.sendq_full++;
>
> 		pr_debug("%s: virtio not prepared to send\n",dev->name);
> 		netif_stop_queue(dev);
>
> 		/* Activate callback for using skbs: if this fails it
> 		 * means some were used in the meantime. */
> 		vi->stats.sendq_enabled++;
> 		if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) {
>   

Even when this returns false and we don't immediately reschedule.  At 
least, that's what I'm expecting to happen.

Regards,

Anthony Liguori

> <<< Since before the patch enable_cb returned true, thus the goto below
> <<< was not called.
> <<< The patch moves the notify to enable_cb above.
>
> 			printk("Unlikely: restart svq failed\n");
> 			vi->stats.sendq_enable_failed++;
> 			netif_start_queue(dev);
> 			goto again;
> 		}
> 		__skb_unlink(skb, &vi->send);
>
> 		return NETDEV_TX_BUSY;
> 	}
>
>
>   
>> Regards,
>>
>> Anthony Liguori
>>
>>
>>     
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  parent reply	other threads:[~2008-01-28 16:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-28  0:13 [PATCH] virtio_net tx performance fix Dor Laor
     [not found] ` <1201479224.3047.37.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-01-28 15:32   ` Anthony Liguori
     [not found]     ` <479DF5A8.8050103-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-01-28 15:59       ` Dor Laor
     [not found]         ` <1201535954.2457.11.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-01-28 16:11           ` Anthony Liguori [this message]
2008-01-29  4:09         ` Anthony Liguori

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=479DFEBB.8010500@us.ibm.com \
    --to=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=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