From: Eric Dumazet <eric.dumazet@gmail.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Jonathan Davies <Jonathan.Davies@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
netdev@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: TSQ accounting skb->truesize degrades throughput for large packets
Date: Fri, 06 Sep 2013 05:57:48 -0700 [thread overview]
Message-ID: <1378472268.31445.15.camel@edumazet-glaptop> (raw)
In-Reply-To: <20130906101635.GI14104@zion.uk.xensource.com>
On Fri, 2013-09-06 at 11:16 +0100, Wei Liu wrote:
> Hi Eric
>
> I have some questions regarding TSQ and I hope you can shed some light
> on this.
>
> Our observation is that with the default TSQ limit (128K), throughput
> for Xen network driver for large packets degrades. That's because we now
> only have 1 packet in queue.
>
> I double-checked that skb->len is indeed <64K. Then I discovered that
> TSQ actually accounts for skb->truesize and the packets generated had
> skb->truesize > 64K which effectively prevented us from putting 2
> packets in queue.
>
> There seems to be no way to limit skb->truesize inside driver -- the skb
> is already constructed when it comes to xen-netfront.
>
What is the skb->truesize value then ? It must be huge, and its clearly
a problem, because the tcp _receiver_ will also grow its window slower,
if packet is looped back.
> My questions are:
> 1) I see the comment in tcp_output.c saying: "TSQ : sk_wmem_alloc
> accounts skb truesize, including skb overhead. But thats OK", I
> don't quite understand why it is OK.
> 2) presumably other drivers will suffer from this as well, is it
> possible to account for skb->len instead of skb->truesize?
Well, I have no problem to get line rate on 20Gb with a single flow, so
other drivers have no problem.
> 3) if accounting skb->truesize is on purpose, does that mean we only
> need to tune that value instead of trying to fix our driver (if
> there is a way to)?
The check in TCP allows for two packets at least, unless a single skb
truesize is 128K ?
if (atomic_read(&sk->sk_wmem_alloc) >= sysctl_tcp_limit_output_bytes) {
set_bit(TSQ_THROTTLED, &tp->tsq_flags);
break;
}
So if a skb->truesize is 100K, this condition allows two packets, before
throttling the third packet.
Its actually hard to account for skb->len, because sk_wmem_alloc
accounts for skb->truesize : I do not want to add another
sk->sk_wbytes_alloc new atomic field.
next prev parent reply other threads:[~2013-09-06 12:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 10:16 TSQ accounting skb->truesize degrades throughput for large packets Wei Liu
2013-09-06 12:57 ` Eric Dumazet [this message]
2013-09-06 13:12 ` Wei Liu
2013-09-06 16:36 ` Zoltan Kiss
2013-09-06 16:56 ` Eric Dumazet
2013-09-09 9:27 ` Jason Wang
2013-09-09 13:47 ` Eric Dumazet
2013-09-10 7:45 ` Jason Wang
2013-09-10 12:35 ` Eric Dumazet
2013-09-06 17:00 ` Eric Dumazet
2013-09-07 17:21 ` Eric Dumazet
2013-09-09 21:41 ` Zoltan Kiss
2013-09-09 21:56 ` Eric Dumazet
[not found] ` <loom.20130921T045654-573@post.gmane.org>
[not found] ` <20130921150327.GA9078@zion.uk.xensource.com>
2013-09-22 2:36 ` [Xen-devel] " Cong Wang
2013-09-22 14:58 ` Eric Dumazet
2013-09-27 10:28 ` [PATCH] tcp: TSQ can use a dynamic limit Eric Dumazet
2013-09-27 15:08 ` Neal Cardwell
2013-09-29 15:41 ` Cong Wang
2013-10-01 3:52 ` David Miller
2013-09-09 5:28 ` TSQ accounting skb->truesize degrades throughput for large packets Cong Wang
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=1378472268.31445.15.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=Jonathan.Davies@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=netdev@vger.kernel.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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