···33003300 tp->snd_cwnd_stamp = tcp_time_stamp;33013301}3302330233033303+static inline int tcp_should_expand_sndbuf(struct sock *sk, struct tcp_sock *tp)33043304+{33053305+ /* If the user specified a specific send buffer setting, do33063306+ * not modify it.33073307+ */33083308+ if (sk->sk_userlocks & SOCK_SNDBUF_LOCK)33093309+ return 0;33103310+33113311+ /* If we are under global TCP memory pressure, do not expand. */33123312+ if (tcp_memory_pressure)33133313+ return 0;33143314+33153315+ /* If we are under soft global TCP memory pressure, do not expand. */33163316+ if (atomic_read(&tcp_memory_allocated) >= sysctl_tcp_mem[0])33173317+ return 0;33183318+33193319+ /* If we filled the congestion window, do not expand. */33203320+ if (tp->packets_out >= tp->snd_cwnd)33213321+ return 0;33223322+33233323+ return 1;33243324+}3303332533043326/* When incoming ACK allowed to free some skb from write_queue,33053327 * we remember this event in flag SOCK_QUEUE_SHRUNK and wake up socket···33333311{33343312 struct tcp_sock *tp = tcp_sk(sk);3335331333363336- if (tp->packets_out < tp->snd_cwnd &&33373337- !(sk->sk_userlocks & SOCK_SNDBUF_LOCK) &&33383338- !tcp_memory_pressure &&33393339- atomic_read(&tcp_memory_allocated) < sysctl_tcp_mem[0]) {33143314+ if (tcp_should_expand_sndbuf(sk, tp)) {33403315 int sndmem = max_t(u32, tp->rx_opt.mss_clamp, tp->mss_cache_std) +33413316 MAX_TCP_HEADER + 16 + sizeof(struct sk_buff),33423317 demanded = max_t(unsigned int, tp->snd_cwnd,