#
77bc5cb1 |
|
08-Apr-2021 |
Shuo Chen <chenshuo@chenshuo.com> |
tpc/footprint.cc binds to source IP and port before connecting. This reduces runtime of 500,000 connections from 110s to 16s on z420. Before: Samples: 529K of event 'cycles', Event count (approx.): 490797782170 Children Self Command Shared Object Symbol - 88.24% 0.04% connect_many.py [kernel.vmlinux] [k] entry_SYSCALL_64_after_hwframe - 88.20% entry_SYSCALL_64_after_hwframe - 82.53% do_syscall_64 - 73.49% __x64_sys_bind - __sys_bind - 73.32% __inet_bind - 73.16% inet_csk_get_port - 62.04% inet_csk_bind_conflict 46.77% inet_rcv_saddr_equal - 12.33% sock_i_uid 6.18% _raw_read_lock_bh 4.68% _raw_read_unlock_bh 0.63% __local_bh_enable_ip 4.64% _raw_spin_lock_bh 0.89% __local_bh_enable_ip 0.82% _cond_resched + 5.88% __x64_sys_connect + 1.19% __x64_sys_socket + 0.96% __x64_sys_accept4 + 0.57% __x64_sys_epoll_ctl - 5.67% syscall_exit_to_user_mode + 5.59% exit_to_user_mode_prepare After: Samples: 143K of event 'cycles', Event count (approx.): 132260215644 Children Self Command Shared Object Symbol - 57.20% 0.15% connect_many.py [kernel.vmlinux] [k] entry_SYSCALL_64_after_hwframe - 57.05% entry_SYSCALL_64_after_hwframe - 36.48% do_syscall_64 - 21.05% __x64_sys_connect - 21.01% __sys_connect - 20.66% inet_stream_connect - 20.56% __inet_stream_connect - 11.71% tcp_v4_connect - 9.94% tcp_connect + 8.11% __tcp_transmit_skb 0.70% sk_stream_alloc_skb + 0.54% ip_route_output_flow + 8.49% release_sock + 4.79% __x64_sys_socket + 3.60% __x64_sys_bind + 3.31% __x64_sys_accept4 + 2.08% __x64_sys_epoll_ctl + 0.79% __x64_sys_close + 20.56% syscall_exit_to_user_mode |