While reading sysctl_tcp_pacing_(ss|ca)_ratio, they can be changed concurrently. Thus, we need to add READ_ONCE() to their readers.
Unified · Split
| @@ -910,9 +910,9 @@ static void tcp_update_pacing_rate(struct sock *sk) · 909 unmodified lines | |||
| 910 | * end of slow start and should slow down. | 910 | * end of slow start and should slow down. |
| 911 | */ | 911 | */ |
| 912 | if (tcp_snd_cwnd(tp) < tp->snd_ssthresh / 2) | 912 | if (tcp_snd_cwnd(tp) < tp->snd_ssthresh / 2) |
| 913 | rate *= sock_net(sk)->ipv4.sysctl_tcp_pacing_ss_ratio; | 913 | rate *= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_pacing_ss_ratio); |
| 914 | else | 914 | else |
| 915 | rate *= sock_net(sk)->ipv4.sysctl_tcp_pacing_ca_ratio; | 915 | rate *= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_pacing_ca_ratio); |
| 916 | 916 | ||
| 917 | rate *= max(tcp_snd_cwnd(tp), tp->packets_out); | 917 | rate *= max(tcp_snd_cwnd(tp), tp->packets_out); |
| 918 | 918 | ||