public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <erdnetdev@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>,
	Rick Jones <rick.jones2@hp.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	annie li <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] xen/netfront: improve truesize tracking
Date: Mon, 07 Jan 2013 08:17:23 -0800	[thread overview]
Message-ID: <1357575443.6919.3105.camel@edumazet-glaptop> (raw)
In-Reply-To: <1357566063.7989.68.camel@zakaz.uk.xensource.com>

On Mon, 2013-01-07 at 13:41 +0000, Ian Campbell wrote:

> > UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.1.1 (192.168.1.1) port 0 AF_INET : +/-2.500% @ 95% conf.  : demo
> >         Socket  Message  Elapsed      Messages
> >         Size    Size     Time         Okay Errors   Throughput
> >         bytes   bytes    secs            #      #   KBytes/sec
> > 
> > current 212992   65507   60.00      252586      0    269305.73
> > current   2280           60.00      229371           244553.96
> > patched 212992   65507   60.00      256209      0    273168.32
> > patched   2280           60.00      201670           215019.54
> 
> The recv numbers here aren't too pleasing either.

The number of packets that can be queued into UDP socket depends on
sk->sk_rcvbuf (SO_RCVBUF) and skb truesize.

So what we notice here are packet drops (netstat -s would give us the
total counters)

To absorb a burst of incoming messages, an application would have to set
an appropriate receive buffer.

In this case, RCVBUF value was set to a very minimum, basically not
allowing more than one queued packet.

TCP stack has a 'collapse' mode, which basically converts skbs in
receive queue (or ofo queue) to better filled ones (skb->len very close
to skb->truesize) when memory limits are about to be hit.

Its very expensive, as it adds one more copy stage, but it happens only
in rare circumstances. Of course, when a driver uses one page of 4096
bytes to store one 1514 bytes ethernet frame, it can happen more often.

netstat -s | grep collap
    25292 packets collapsed in receive queue due to low socket buffer

      parent reply	other threads:[~2013-01-07 16:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 13:51 [PATCH] xen/netfront: improve truesize tracking Ian Campbell
2012-12-18 14:10 ` Konrad Rzeszutek Wilk
2012-12-18 14:15   ` Ian Campbell
2012-12-18 15:12 ` Eric Dumazet
2012-12-18 15:26   ` Ian Campbell
2012-12-18 16:13     ` Eric Dumazet
2012-12-18 16:22       ` Ian Campbell
2012-12-18 16:35         ` Eric Dumazet
2012-12-19 11:34     ` Sander Eikelenboom
2012-12-19 16:17       ` Eric Dumazet
2012-12-20 12:51         ` Sander Eikelenboom
2012-12-20 14:23           ` [Xen-devel] " Sander Eikelenboom
2012-12-20 14:58             ` Sander Eikelenboom
2012-12-20 15:39           ` Eric Dumazet
2012-12-21 11:21             ` Sander Eikelenboom
2012-12-21 18:33               ` Rick Jones
2013-01-03 20:40                 ` Sander Eikelenboom
2013-01-07 13:41                   ` Ian Campbell
2013-01-07 14:11                     ` Sander Eikelenboom
2013-01-07 14:22                       ` Ian Campbell
2013-01-07 15:26                         ` Eric Dumazet
2013-01-07 16:17                     ` Eric Dumazet [this message]

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=1357575443.6919.3105.camel@edumazet-glaptop \
    --to=erdnetdev@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=annie.li@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux@eikelenboom.it \
    --cc=netdev@vger.kernel.org \
    --cc=rick.jones2@hp.com \
    --cc=xen-devel@lists.xensource.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