• E
    tcp: speedup tcp_fixup_rcvbuf() · d2cf4367
    Eric Dumazet 提交于
    tcp_fixup_rcvbuf() contains a loop to estimate initial socket
    rcv space needed for a given mss. With large MTU (like 64K on lo),
    we can loop ~500 times and consume a lot of cpu cycles.
    
    perf top of 200 concurrent netperf -t TCP_CRR
    
    5.62%  netperf  [kernel.kallsyms]  [k] tcp_init_buffer_space
    1.71%  netperf  [kernel.kallsyms]  [k] _raw_spin_lock
    1.55%  netperf  [kernel.kallsyms]  [k] kmem_cache_free
    1.51%  netperf  [kernel.kallsyms]  [k] tcp_transmit_skb
    1.50%  netperf  [kernel.kallsyms]  [k] tcp_ack
    
    Lets use a 100% factor, and remove the loop.
    
    100% is needed anyway for tcp_adv_win_scale=1
    default value, and is also the maximum factor.
    
    Refs: commit b49960a0
          ("tcp: change tcp_adv_win_scale and tcp_rmem[2]")
    Signed-off-by: NEric Dumazet <edumazet@google.com>
    Cc: Neal Cardwell <ncardwell@google.com>
    Cc: Yuchung Cheng <ycheng@google.com>
    Acked-by: NNeal Cardwell <ncardwell@google.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    d2cf4367
tcp_input.c 164.7 KB