]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
tcp: speedup tcp_fixup_rcvbuf()
authorEric Dumazet <edumazet@google.com>
Wed, 15 May 2013 19:25:55 +0000 (19:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 May 2013 22:19:45 +0000 (15:19 -0700)
commitd2cf43674e17ca1c16c68d46d987d2f17bf7c371
treef308a56b13f27297349f44f785f3c5d0d651ac07
parentdbbffe6898fd0d7bac66ded5d3c58835b13ddefc
tcp: speedup tcp_fixup_rcvbuf()

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 b49960a05e32
      ("tcp: change tcp_adv_win_scale and tcp_rmem[2]")

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c