From: Jason Wang <jasowang@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Neal Cardwell <ncardwell@google.com>,
Yuchung Cheng <ycheng@google.com>, Van Jacobson <vanj@google.com>,
Tom Herbert <therbert@google.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v3 net-next] tcp: TSO packets automatic sizing
Date: Fri, 30 Aug 2013 11:02:08 +0800 [thread overview]
Message-ID: <52200B30.40305@redhat.com> (raw)
In-Reply-To: <1377686084.8828.175.camel@edumazet-glaptop>
On 08/28/2013 06:34 PM, Eric Dumazet wrote:
> On Wed, 2013-08-28 at 15:37 +0800, Jason Wang wrote:
>
>>> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
>>> index 884efff..e63ae4c 100644
>>> --- a/net/ipv4/tcp_output.c
>>> +++ b/net/ipv4/tcp_output.c
>>> @@ -1631,7 +1631,7 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb)
>>>
>>> /* If a full-sized TSO skb can be sent, do it. */
>>> if (limit >= min_t(unsigned int, sk->sk_gso_max_size,
>>> - sk->sk_gso_max_segs * tp->mss_cache))
>>> + tp->xmit_size_goal_segs * tp->mss_cache))
>>> goto send_now;
>> A question is: Does this really guarantee the minimal TSO segments
>> excluding the case of small available window? The skb->len may be much
>> smaller and can still be sent here. Maybe we should check skb->len also?
> tcp_tso_should_defer() is all about hoping the application will
> 'complete' the last skb in write queue with more payload in the near
> future.
>
> skb->len might therefore change because sendmsg()/sendpage() will add
> new stuff in the skb.
Ture, but sometimes the application may be slow to fill the bytes into
skb. Especially the application run in virt guest with multiqueue. In
the case, the application in guest tends to be slower than the
nic(virtio-net) which does the transmission through a host thread
(vhost). Looks like current defer algorithm could not do this very well
and if we want to force the batching of 64K packet, tcp_min_tso_segs
could not works well also.
> We try hard to not remove tcp_tso_should_defer() and take the best of
> it. We have not yet decided to add a real timer instead of relying on
> upcoming ACKS.
>
> Neal has an idea/patch to avoid a defer depending on
> the expected time of following ACKS.
>
> By making the TSO sizes smaller for low rates, we avoid these stalls
> from tcp_tso_should_defer(), because an incoming ACK has normally freed
> enough window to send the next packet in write queue without the need to
> split it into two parts.
>
> These changes are fundamental to use delay based congestion modules like
> Vegas/Westwood and experimental new ones, without having to disable TSO.
>
>
>
next prev parent reply other threads:[~2013-08-30 3:02 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-24 0:29 [PATCH net-next] tcp: TSO packets automatic sizing Eric Dumazet
2013-08-24 3:17 ` Neal Cardwell
2013-08-24 18:56 ` Eric Dumazet
2013-08-24 20:28 ` Eric Dumazet
2013-08-25 22:01 ` Yuchung Cheng
2013-08-26 0:37 ` Eric Dumazet
2013-08-26 2:22 ` Eric Dumazet
2013-08-26 3:58 ` Eric Dumazet
2013-08-25 2:46 ` David Miller
2013-08-25 2:52 ` Eric Dumazet
2013-08-26 4:26 ` [PATCH v2 " Eric Dumazet
2013-08-26 19:09 ` Yuchung Cheng
2013-08-26 20:28 ` Eric Dumazet
2013-08-26 22:31 ` Yuchung Cheng
2013-08-27 0:47 ` Eric Dumazet
2013-08-27 12:46 ` [PATCH v3 " Eric Dumazet
2013-08-28 0:17 ` Yuchung Cheng
2013-08-28 0:21 ` Neal Cardwell
2013-08-28 7:37 ` Jason Wang
2013-08-28 10:34 ` Eric Dumazet
2013-08-30 3:02 ` Jason Wang [this message]
2013-08-29 19:51 ` David Miller
2013-08-29 20:26 ` Eric Dumazet
2013-08-29 20:35 ` David Miller
2013-08-29 21:26 ` Eric Dumazet
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=52200B30.40305@redhat.com \
--to=jasowang@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=mst@redhat.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.com \
--cc=vanj@google.com \
--cc=ycheng@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.