Subject: Re: [PATCH net-next] tcp: auto corking

From: Rick Jones <[email-masked]>
Date: Fri, 06 Dec 2013 10:02:54 -0800

On 12/06/2013 09:46 AM, Eric Dumazet wrote:
> On Fri, 2013-12-06 at 08:06 -0800, Rick Jones wrote:
>> On 12/06/2013 02:30 AM, David Laight wrote:
>>>> From: Eric Dumazet <[email-masked]>
>>>>
>>>> With the introduction of TCP Small Queues, TSO auto sizing, and TCP
>>>> pacing, we can implement Automatic Corking in the kernel, to help
>>>> applications doing small write()/sendmsg() to TCP sockets.
>>>
>>> Presumably this has the greatest effect on connections with Nagle
>>> disabled?
>>
>> I was wondering why Nagle didn't catch these things as well.  The
>> netperf command line Eric provided though didn't include the
>> test-specific -D option that would have disabled Nagle.  At least not
>> unless the "super_netperf" wrapper was adding it.
>>
>> So, why doesn't Nagle catch what is presumably a sub-MSS send while
>> there is data outstanding on the connection?
>
> super_netperf do not add any option.
>
> Note the netperf results do no really show the improvements of this
> patch. It's a side effect of the short cut.
>
> You kind of need a TCP_RR workload, but splitting the request into small
> chunks.

You mean write, write, read?

If all you need is multiple, small sends in flight at one time, you can 
light-up the burst mode option of netperf and ask it to put multiple 
"transactions" into flight at one time.  But that won't be the same as 
"write, write, read" (when an application presents logically associated 
data to the transport at the same time).  There will still be a 1-1 
correspondence between writes and reads with netperf's burst mode.

> Well written applications use TCP_CORK or MSG_MORE, but unfortunately
> many applications are not well written.

I still like the likes of writev() and other gathering sends better :)

rick jones