netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Shirley Ma <mashirle@us.ibm.com>
Cc: David Miller <davem@davemloft.net>,
	steved@us.ibm.com, netdev@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: Network performance with small packets
Date: Tue, 1 Feb 2011 23:21:12 +0200	[thread overview]
Message-ID: <20110201212110.GC30770@redhat.com> (raw)
In-Reply-To: <1296591908.26937.809.camel@localhost.localdomain>

On Tue, Feb 01, 2011 at 12:25:08PM -0800, Shirley Ma wrote:
> On Tue, 2011-02-01 at 22:17 +0200, Michael S. Tsirkin wrote:
> > On Tue, Feb 01, 2011 at 12:09:03PM -0800, Shirley Ma wrote:
> > > On Tue, 2011-02-01 at 19:23 +0200, Michael S. Tsirkin wrote:
> > > > On Thu, Jan 27, 2011 at 01:30:38PM -0800, Shirley Ma wrote:
> > > > > On Thu, 2011-01-27 at 13:02 -0800, David Miller wrote:
> > > > > > > Interesting. Could this is be a variant of the now famuous
> > > > > > bufferbloat then?
> > > > > > 
> > > > > > Sigh, bufferbloat is the new global warming... :-/ 
> > > > > 
> > > > > Yep, some places become colder, some other places become warmer;
> > > > Same as
> > > > > BW results, sometimes faster, sometimes slower. :)
> > > > > 
> > > > > Shirley
> > > > 
> > > > Sent a tuning patch (v2) that might help.
> > > > Could you try it and play with the module parameters please? 
> > > 
> > > Hello Michael,
> > > 
> > > Sure I will play with this patch to see how it could help. 
> > > 
> > > I am looking at guest side as well, I found a couple issues on guest
> > > side:
> > > 
> > > 1. free_old_xmit_skbs() should return the number of skbs instead of
> > the
> > > total of sgs since we are using ring size to stop/start netif queue.
> > > static unsigned int free_old_xmit_skbs(struct virtnet_info *vi)
> > > {
> > >         struct sk_buff *skb;
> > >         unsigned int len, tot_sgs = 0;
> > > 
> > >         while ((skb = virtqueue_get_buf(vi->svq, &len)) != NULL) {
> > >                 pr_debug("Sent skb %p\n", skb);
> > >                 vi->dev->stats.tx_bytes += skb->len;
> > >                 vi->dev->stats.tx_packets++;
> > >                 tot_sgs += skb_vnet_hdr(skb)->num_sg;
> > >                 dev_kfree_skb_any(skb);
> > >         }
> > >         return tot_sgs; <---- should return numbers of skbs to track
> > > ring usage here, I think;
> > > }
> > > 
> > > Did the old guest use number of buffers to track ring usage before?
> > > 
> > > 2. In start_xmit, I think we should move capacity +=
> > free_old_xmit_skbs
> > > before netif_stop_queue(); so we avoid unnecessary netif queue
> > > stop/start. This condition is heavily hit for small message size.
> > > 
> > > Also we capacity checking condition should change to something like
> > half
> > > of the vring.num size, instead of comparing 2+MAX_SKB_FRAGS?
> > > 
> > >        if (capacity < 2+MAX_SKB_FRAGS) {
> > >                 netif_stop_queue(dev);
> > >                 if (unlikely(!virtqueue_enable_cb(vi->svq))) {
> > >                         /* More just got used, free them then
> > recheck.
> > > */
> > >                         capacity += free_old_xmit_skbs(vi);
> > >                         if (capacity >= 2+MAX_SKB_FRAGS) {
> > >                                 netif_start_queue(dev);
> > >                                 virtqueue_disable_cb(vi->svq);
> > >                         }
> > >                 }
> > >         }
> > > 
> > > 3. Looks like the xmit callback is only used to wake the queue when
> > the
> > > queue has stopped, right? Should we put a condition check here?
> > > static void skb_xmit_done(struct virtqueue *svq)
> > > {
> > >         struct virtnet_info *vi = svq->vdev->priv;
> > > 
> > >         /* Suppress further interrupts. */
> > >         virtqueue_disable_cb(svq);
> > > 
> > >         /* We were probably waiting for more output buffers. */
> > > --->   if (netif_queue_stopped(vi->dev))
> > >         netif_wake_queue(vi->dev);
> > > }
> > > 
> > > 
> > > Shirley
> > 
> > Well the return value is used to calculate capacity and that counts
> > the # of s/g. No?
> 
> Nope, the current guest kernel uses descriptors not number of sgs.

Confused. We compare capacity to skb frags, no?
That's sg I think ...

> not sure the old guest.
> 
> > From cache utilization POV it might be better to read from the skb and
> > not peek at virtio header though...
> > Pls Cc the lists on any discussions in the future.
> > 
> > -- 
> > MST
> 
> Sorry I missed reply all. :(
> 
> Shirley

  reply	other threads:[~2011-02-01 21:21 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OFD293DCD2.7F0260F0-ON86257823.0061DC39-86257823.00743BB3@us.ibm.com>
     [not found] ` <20110126151700.GA14113@redhat.com>
     [not found]   ` <1296153874.1640.27.camel@localhost.localdomain>
     [not found]     ` <20110127190031.GC5228@redhat.com>
     [not found]       ` <1296155340.1640.34.camel@localhost.localdomain>
     [not found]         ` <20110127193131.GD5228@redhat.com>
     [not found]           ` <1296157547.1640.45.camel@localhost.localdomain>
2011-01-27 20:05             ` Network performance with small packets Michael S. Tsirkin
2011-01-27 20:15               ` Shirley Ma
2011-01-28 18:29                 ` Steve Dobbelstein
2011-01-28 22:51                   ` Steve Dobbelstein
2011-02-01 15:52                   ` [PATCHv2 dontapply] vhost-net tx tuning Michael S. Tsirkin
2011-02-01 23:07                     ` Sridhar Samudrala
2011-02-01 23:27                       ` Shirley Ma
2011-02-02  4:36                       ` Michael S. Tsirkin
2011-01-27 21:02               ` Network performance with small packets David Miller
2011-01-27 21:30                 ` Shirley Ma
2011-01-28 12:16                   ` Michael S. Tsirkin
2011-02-01  0:24                     ` Steve Dobbelstein
2011-02-01  1:30                       ` Sridhar Samudrala
2011-02-01  5:56                         ` Michael S. Tsirkin
2011-02-01 21:09                         ` Shirley Ma
2011-02-01 21:24                           ` Michael S. Tsirkin
2011-02-01 21:32                             ` Shirley Ma
2011-02-01 21:42                               ` Michael S. Tsirkin
2011-02-01 21:53                                 ` Shirley Ma
2011-02-01 21:56                                   ` Michael S. Tsirkin
2011-02-01 22:59                                     ` Shirley Ma
2011-02-02  4:40                                       ` Michael S. Tsirkin
2011-02-02  6:05                                         ` Shirley Ma
2011-02-02  6:19                                           ` Shirley Ma
2011-02-02  6:29                                             ` Michael S. Tsirkin
2011-02-02  7:14                                               ` Shirley Ma
2011-02-02  7:33                                                 ` Shirley Ma
2011-02-02 10:49                                                   ` Michael S. Tsirkin
2011-02-02 15:42                                                     ` Shirley Ma
2011-02-02 15:48                                                       ` Michael S. Tsirkin
2011-02-02 17:12                                                         ` Shirley Ma
2011-02-02 18:20                                                       ` Michael S. Tsirkin
2011-02-02 18:26                                                         ` Shirley Ma
2011-02-02 10:48                                                 ` Michael S. Tsirkin
2011-02-02  6:34                                             ` Krishna Kumar2
2011-02-02  7:03                                               ` Shirley Ma
2011-02-02  7:37                                                 ` Krishna Kumar2
2011-02-02 10:48                                               ` Michael S. Tsirkin
2011-02-02 15:39                                                 ` Shirley Ma
2011-02-02 15:47                                                   ` Michael S. Tsirkin
2011-02-02 17:10                                                     ` Shirley Ma
2011-02-02 17:32                                                       ` Michael S. Tsirkin
2011-02-02 18:11                                                         ` Shirley Ma
2011-02-02 18:27                                                           ` Michael S. Tsirkin
2011-02-02 19:29                                                             ` Shirley Ma
2011-02-02 20:17                                                               ` Michael S. Tsirkin
2011-02-02 21:03                                                                 ` Shirley Ma
2011-02-02 21:20                                                                   ` Michael S. Tsirkin
2011-02-02 21:41                                                                     ` Shirley Ma
2011-02-03  5:59                                                                       ` Michael S. Tsirkin
2011-02-03  6:09                                                                         ` Shirley Ma
2011-02-03  6:16                                                                           ` Michael S. Tsirkin
2011-02-03  5:05                                                                     ` Shirley Ma
2011-02-03  6:13                                                                       ` Michael S. Tsirkin
2011-02-03 15:58                                                                         ` Shirley Ma
2011-02-03 16:20                                                                           ` Michael S. Tsirkin
2011-02-03 17:18                                                                             ` Shirley Ma
2011-02-01  5:54                       ` Michael S. Tsirkin
2011-02-01 17:23                   ` Michael S. Tsirkin
     [not found]                     ` <1296590943.26937.797.camel@localhost.localdomain>
     [not found]                       ` <20110201201715.GA30050@redhat.com>
2011-02-01 20:25                         ` Shirley Ma
2011-02-01 21:21                           ` Michael S. Tsirkin [this message]
2011-02-01 21:28                             ` Shirley Ma
2011-02-01 21:41                               ` Michael S. Tsirkin
2011-02-02  4:39                                 ` Krishna Kumar2
2011-02-02  4:42                                   ` Michael S. Tsirkin
2011-02-09  0:37                                     ` Rusty Russell
2011-02-09  0:53                                       ` Michael S. Tsirkin
2011-02-09  1:39                                         ` Rusty Russell
2011-02-09  1:55                                           ` Michael S. Tsirkin
2011-02-09  7:43                                             ` Stefan Hajnoczi
2011-03-08 21:57                                       ` Shirley Ma
2011-03-09  2:21                                         ` Andrew Theurer
2011-03-09 15:42                                           ` Shirley Ma
2011-03-10  1:49                                           ` Rusty Russell
2011-04-12 20:01                                             ` Michael S. Tsirkin
2011-04-14 11:28                                               ` Rusty Russell
2011-04-14 12:40                                                 ` Michael S. Tsirkin
2011-04-14 16:03                                                 ` Michael S. Tsirkin
2011-04-19  0:33                                                   ` Rusty Russell

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=20110201212110.GC30770@redhat.com \
    --to=mst@redhat.com \
    --cc=davem@davemloft.net \
    --cc=kvm@vger.kernel.org \
    --cc=mashirle@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=steved@us.ibm.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).