All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neal Cardwell <ncardwell@google.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "Eric Dumazet" <edumazet@google.com>,
	"David Miller" <davem@davemloft.net>,
	Netdev <netdev@vger.kernel.org>,
	"Toke Høiland-Jørgensen" <toke@toke.dk>,
	"Yuchung Cheng" <ycheng@google.com>,
	"Soheil Hassas Yeganeh" <soheil@google.com>
Subject: Re: [PATCH net-next 3/4] tcp: add SACK compression
Date: Thu, 17 May 2018 12:41:53 -0400	[thread overview]
Message-ID: <CADVnQymTZ-dfU65kJYAVrb4eEWkou_+bd8ZOCxE9sPUn=ZCtxg@mail.gmail.com> (raw)
In-Reply-To: <58bcf9c0-e4f0-691d-8d6a-40ff3629f500@gmail.com>

On Thu, May 17, 2018 at 11:40 AM Eric Dumazet <eric.dumazet@gmail.com>
wrote:
> On 05/17/2018 08:14 AM, Neal Cardwell wrote:
> > Is there a particular motivation for the cap of 127? IMHO 127 ACKs is
quite
> > a few to compress. Experience seems to show that it works well to have
one
> > GRO ACK for ~64KBytes that triggers a single TSO skb of ~64KBytes. It
might
> > be nice to try to match those dynamics in this SACK compression case,
so it
> > might be nice to cap the number of compressed ACKs at something like 44?
> > (0xffff / 1448 - 1).  That way for high-speed paths we could try to keep
> > the ACK clock going with ACKs for ~64KBytes that trigger a single TSO
skb
> > of ~64KBytes, no matter whether we are sending SACKs or cumulative ACKs.

> 127 was chosen because the field is u8, and since skb allocation for the
ACK
> can fail, we could have cases were the field goes above 127.

> Ultimately, I believe a followup patch would add a sysctl, so that we can
fine-tune
> this, and eventually disable ACK compression if this sysctl is set to 0

OK, a sysctl sounds good. I would still vote for a default of 44.  :-)


> >> +       if (hrtimer_is_queued(&tp->compressed_ack_timer))
> >> +               return;
> >> +
> >> +       /* compress ack timer : 5 % of srtt, but no more than 2.5 ms */
> >> +
> >> +       delay = min_t(unsigned long, 2500 * NSEC_PER_USEC,
> >> +                     tp->rcv_rtt_est.rtt_us * (NSEC_PER_USEC >>
3)/20);
> >
> > Any particular motivation for the 2.5ms here? It might be nice to match
the
> > existing TSO autosizing dynamics and use 1ms here instead of having a
> > separate new constant of 2.5ms. Smaller time scales here should lead to
> > less burstiness and queue pressure from data packets in the network,
and we
> > know from experience that the CPU overhead of 1ms chunks is acceptable.

> This came from my tests on wifi really :)

> I also had the idea to make this threshold adjustable for wifi, like we
did for sk_pacing_shift.

> (On wifi, we might want to increase the max delay between ACK)

> So maybe use 1ms delay, when sk_pacing_shift == 10, but increase it if
sk_pacing_shift has been lowered.

Sounds good to me.

Thanks for implementing this! Overall this patch seems nice to me.

Acked-by: Neal Cardwell <ncardwell@google.com>

BTW, I guess we should spread the word to maintainers of other major TCP
stacks that they need to be prepared for what may be a much higher degree
of compression/aggregation in the SACK stream. Linux stacks going back many
years should be fine with this, but I'm not sure about the other major OSes
(they may only allow sending one MSS per ACK-with-SACKs received).

neal

  parent reply	other threads:[~2018-05-17 16:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 12:12 [PATCH net-next 0/4] tcp: implement SACK compression Eric Dumazet
2018-05-17 12:12 ` [PATCH net-next 1/4] tcp: use __sock_put() instead of sock_put() in tcp_clear_xmit_timers() Eric Dumazet
2018-05-17 14:53   ` Neal Cardwell
2018-05-17 12:12 ` [PATCH net-next 2/4] tcp: do not force quickack when receiving out-of-order packets Eric Dumazet
2018-05-17 14:55   ` Neal Cardwell
2018-05-17 17:14   ` Soheil Hassas Yeganeh
2018-05-17 12:12 ` [PATCH net-next 3/4] tcp: add SACK compression Eric Dumazet
2018-05-17 15:14   ` Neal Cardwell
2018-05-17 15:40     ` Eric Dumazet
2018-05-17 15:46       ` Eric Dumazet
2018-05-17 16:41       ` Neal Cardwell [this message]
2018-05-17 16:59         ` Yuchung Cheng
2018-05-17 17:15           ` Yuchung Cheng
2018-05-17 17:15           ` Eric Dumazet
2018-05-17 12:12 ` [PATCH net-next 4/4] tcp: add TCPAckCompressed SNMP counter Eric Dumazet
2018-05-17 14:55   ` Neal Cardwell

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='CADVnQymTZ-dfU65kJYAVrb4eEWkou_+bd8ZOCxE9sPUn=ZCtxg@mail.gmail.com' \
    --to=ncardwell@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=soheil@google.com \
    --cc=toke@toke.dk \
    --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.