Skip to content

Commit

Permalink
net-tcp_bbr: broaden app-limited rate sample detection
Browse files Browse the repository at this point in the history
This commit is a bug fix for the Linux TCP app-limited
(application-limited) logic that is used for collecting rate
(bandwidth) samples.

Previously the app-limited logic only looked for "bubbles" of
silence in between application writes, by checking at the start
of each sendmsg. But "bubbles" of silence can also happen before
retransmits: e.g. bubbles can happen between an application write
and a retransmit, or between two retransmits.

Retransmits are triggered by ACKs or timers. So this commit checks
for bubbles of app-limited silence upon ACKs or timers.

Why does this commit check for app-limited state at the start of
ACKs and timer handling? Because at that point we know whether
inflight was fully using the cwnd.  During processing the ACK or
timer event we often change the cwnd; after changing the cwnd we
can't know whether inflight was fully using the old cwnd.

Origin-9xx-SHA1: 3fe9b53291e018407780fb8c356adb5666722cbc
Change-Id: I37221506f5166877c2b110753d39bb0757985e68
  • Loading branch information
nealcardwell authored and xanmod committed Jan 12, 2022
1 parent ed307cc commit d6c7158
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions net/ipv4/tcp_input.c
Expand Up @@ -3788,6 +3788,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)

prior_fack = tcp_is_sack(tp) ? tcp_highest_sack_seq(tp) : tp->snd_una;
rs.prior_in_flight = tcp_packets_in_flight(tp);
tcp_rate_check_app_limited(sk);

/* ts_recent update must be made after we are sure that the packet
* is in window.
Expand Down
1 change: 1 addition & 0 deletions net/ipv4/tcp_timer.c
Expand Up @@ -607,6 +607,7 @@ void tcp_write_timer_handler(struct sock *sk)
goto out;
}

tcp_rate_check_app_limited(sk);
tcp_mstamp_refresh(tcp_sk(sk));
event = icsk->icsk_pending;

Expand Down

0 comments on commit d6c7158

Please sign in to comment.