netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Neal Cardwell <ncardwell@google.com>
Cc: "Toke Høiland-Jørgensen" <toke@redhat.com>,
	linux-wireless@vger.kernel.org, Netdev <netdev@vger.kernel.org>
Subject: Re: debugging TCP stalls on high-speed wifi
Date: Thu, 12 Dec 2019 13:50:16 -0800	[thread overview]
Message-ID: <ccab4fec-ea10-000c-53ef-0ffdadbabbd5@gmail.com> (raw)
In-Reply-To: <ff6b35ad589d7cf0710cb9fca4c799538da2e653.camel@sipsolutions.net>



On 12/12/19 1:11 PM, Johannes Berg wrote:
> Hi Eric,
> 
> Thanks for looking :)
> 
>>> I'm not sure how to do headers-only, but I guess -s100 will work.
>>>
>>> https://johannes.sipsolutions.net/files/he-tcp.pcap.xz
>>>
>>
>> Lack of GRO on receiver is probably what is killing performance,
>> both for receiver (generating gazillions of acks) and sender
>> (to process all these acks)
> Yes, I'm aware of this, to some extent. And I'm not saying we should see
> even close to 1800 Mbps like we have with UDP...
> 
> Mind you, the biggest thing that kills performance with many ACKs isn't
> the load on the system - the sender system is only moderately loaded at
> ~20-25% of a single core with TSO, and around double that without TSO.
> The thing that kills performance is eating up all the medium time with
> small non-aggregated packets, due to the the half-duplex nature of WiFi.
> I know you know, but in case somebody else is reading along :-)
> 
> But unless somehow you think processing the (many) ACKs on the sender
> will cause it to stop transmitting, or something like that, I don't
> think I should be seeing what I described earlier: we sometimes (have
> to?) reclaim the entire transmit queue before TCP starts pushing data
> again. That's less than 2MB split across at least two TCP streams, I
> don't see why we should have to get to 0 (which takes about 7ms) until
> more packets come in from TCP?
> 
> Or put another way - if I free say 400kB worth of SKBs, what could be
> the reason we don't see more packets be sent out of the TCP stack within
> the few ms or so? I guess I have to correlate this somehow with the ACKs
> so I know how much data is outstanding for ACKs. (*)
> 
> The sk_pacing_shift is set to 7, btw, which should give us 8ms of
> outstanding data. For now in this setup that's enough(**), and indeed
> bumping the limit up (setting sk_pacing_shift to say 5) doesn't change
> anything. So I think this part we actually solved - I get basically the
> same performance and behaviour with two streams (needed due to GBit LAN
> on the other side) as with 20 streams.
> 
> 
>> I had a plan about enabling compressing ACK as I did for SACK
>> in commit 
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5d9f4262b7ea41ca9981cc790e37cca6e37c789e
>>
>> But I have not done it yet.
>> It is a pity because this would tremendously help wifi I am sure.
> 
> Nice :-)
> 
> But that is something the *receiver* would have to do.

Yes, this is the plan. Eventually the receiver gets smarter.

> 
> The dirty secret here is that we're getting close to 1700 Mbps TCP with
> Windows in place of Linux in the setup, with the same receiver on the
> other end (which is actually a single Linux machine with two GBit
> network connections to the AP). So if we had this I'm sure it'd increase
> performance, but it still wouldn't explain why we're so much slower than
> Windows :-)
>

I presume you could hack TCP to no longer care about bufferbloat and you'll
probably match Windows 'performance' on a single flow and a lossless network.

Ie always send ~64KB TSO packets and fill the queues, inflating RTT.

Then, in presence of losses, you get a problem because the retransmit packets
can only be sent _after_ the huge queue that has been put on the sender.

If only TCP could predict the future ;)


  parent reply	other threads:[~2019-12-12 21:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 14:50 debugging TCP stalls on high-speed wifi Johannes Berg
2019-12-12 15:11 ` Neal Cardwell
2019-12-12 15:47   ` Johannes Berg
2019-12-12 18:11     ` Eric Dumazet
2019-12-12 21:11       ` Johannes Berg
2019-12-12 21:29         ` Ben Greear
2019-12-12 21:46           ` Johannes Berg
2019-12-12 21:58             ` Ben Greear
2019-12-12 21:50         ` Eric Dumazet [this message]
2019-12-12 21:53           ` Johannes Berg
2019-12-12 23:42         ` Dave Taht
2019-12-13  0:59           ` [Make-wifi-fast] " Simon Barber
2019-12-13  1:46             ` Eric Dumazet
2019-12-13  1:57               ` Simon Barber
2019-12-13  4:42               ` Dave Taht
2019-12-13  8:08           ` Johannes Berg
2019-12-13  9:10         ` Krishna Chaitanya
2020-01-24 10:34           ` Johannes Berg
2020-01-24 23:49             ` Eric Dumazet
2019-12-13  4:15 ` Justin Capella
2019-12-13  7:43   ` Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2019-12-16 18:14 Simon Barber
2019-12-16 19:20 ` 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=ccab4fec-ea10-000c-53ef-0ffdadbabbd5@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.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).