Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[inetstack] Handle RST packet from peer endpoint #1465

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

anandbonde
Copy link
Contributor

Handle RST packet sent by the peer and close the connection. This is crucial because the profiler information is only emited when the process exits cleanly. If this is not done, we cannot print the profiler information.

Handle RST packet sent by the peer and close the connection. This is
crucial because the profiler information is only emited when the process
exits cleanly. If this is not done, we cannot print the profiler
information.
@anandbonde anandbonde requested a review from iyzhang November 23, 2024 03:47
@anandbonde anandbonde self-assigned this Nov 23, 2024
The timer name was incorrect, this created misleading flamegraphs.
Copy link

libos = catnap
commit id = 5cd112f

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::catnap::transport::epoll 13430192.36 1826.66 773.06 32.85
demikernel::sgafree 11535.80 70.57 30.21 0.05
demikernel::sgaalloc 11283.15 117.00 48.33 0.10
ioc::network::libos::push;catnap::linux::transport::push 9066.10 607.37 262.63 3.88
ioc::network::libos::push 8800.48 16330.75 7053.70 6.82
demikernel::push 8800.48 523.98 225.37 0.16
ioc::network::libos::pop;catnap::linux::transport::pop 8023.43 392.95 170.72 4.14
ioc::network::libos::pop 7814.97 18219805.83 7450256.05 24.58
demikernel::pop 7814.97 524.52 226.69 0.12
ioc::network::libos::pushto 597.00 7379.72 3029.41 23.15
demikernel::pushto 597.00 447.50 183.69 1.44
ioc::network::libos::pushto;catnap::linux::transport::push 597.00 427.99 175.66 5.83
demikernel::async_close 32.50 898.46 369.86 0.02
ioc::network::libos::connect 24.95 4845369.19 2059117.34 27.71
ioc::network::libos::connect;catnap::linux::transport::connect 24.95 73165.96 30909.93 2.64
demikernel::connect 24.95 1995.89 842.13 0.01
ioc::network::libos::close 18.35 23577.76 10117.53 0.08
ioc::network::libos::close;catnap::linux::transport::close 18.35 22178.33 9509.72 94.29
demikernel::accept 15.42 1445.53 629.52 0.00
ioc::network::libos::accept 15.41 885519264.30 385497882.20 44.74
ioc::network::libos::accept;catnap::linux::transport::accept 15.39 7390.90 3218.05 0.00
demikernel::socket 9.50 151595.12 64616.71 0.34
demikernel::socket;catnap::linux::transport::socket 9.50 149252.72 63605.54 96.42
demikernel::new 1.00 261726.92 112042.44 0.14
demikernel::bind 1.00 30748.08 13322.66 0.01
demikernel::bind;catnap::linux::transport::bind 1.00 25943.52 11239.79 84.35
demikernel::listen 1.00 16073.63 6992.30 0.00
demikernel::listen;catnap::linux::transport::listen 1.00 14933.84 6496.60 92.90
demikernel::close 0.00 nan nan 0.00

Copy link

libos = catnip
commit id = 5cd112f

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::inetstack::poll;inetstack::layer4_endpoint::poll_once 30107647.27 334.72 146.95 75.86
bgc::inetstack::poll;inetstack::layer4_endpoint::poll_once;catnip::runtime::receive 30107647.27 196.32 86.20 58.75
bgc::inetstack::poll 15053823.63 888.76 390.38 34.80
bgc::inetstack::tcp::established::background 11371.27 1055.50 459.95 0.11
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 11371.27 308.69 135.58 25.94
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 11360.89 330.80 145.75 32.12
bgc::inetstack::tcp::established::background;tcp::established::background::sender 11318.73 289.16 117.51 15.10
ioc::network::libos::pop 9215.55 375.57 166.16 0.02
demikernel::sgafree 8778.72 78.75 34.87 0.01
ioc::network::libos::push;inetstack::push 8762.80 2010.92 924.31 0.69
ioc::network::libos::push;inetstack::push;catnip::runtime::transmit 8762.80 317.44 145.44 15.22
ioc::network::libos::push 8073.74 33404745.41 14614183.82 25.74
demikernel::push 8073.74 679.43 305.03 0.04
demikernel::sgaalloc 6533.83 135.03 58.87 0.01
demikernel::pop 6051.82 535.39 235.88 0.02
bgc::inetstack::poll;inetstack::poll_bg_work::for::for 4766.51 2460.74 1016.84 2.14
ioc::network::libos::pushto 1212.00 1330.72 605.97 0.05
ioc::network::libos::pushto;inetstack::push 1212.00 716.77 326.25 53.94
demikernel::pushto 1212.00 486.09 220.80 0.02
ioc::network::libos::pushto;inetstack::push;catnip::runtime::transmit 1212.00 250.48 114.09 34.90
bgc::inetstack::poll;inetstack::poll_bg_work::for::for;udp::receive 538.00 235.96 104.94 70.18
bgc::inetstack::poll;inetstack::poll_bg_work::for::for;catnip::runtime::transmit 334.29 600.72 270.65 3.41
ioc::network::libos::close 49.50 6016.02 2632.85 0.01
ioc::network::libos::connect 41.86 34260.22 15035.63 0.04
bgc::inetstack::tcp::passiveopen::background 41.86 34062.40 16298.66 0.00
ioc::network::libos::connect;catnip::runtime::transmit 41.86 6882.64 3050.30 20.86
ioc::network::libos::accept 38.04 2113.35 969.06 0.00
demikernel::async_close 32.50 583.44 232.16 0.00
demikernel::accept 21.86 1116.00 511.24 0.00
bgc::inetstack::tcp::passiveopen::background;catnip::runtime::transmit 20.93 17774.34 8657.38 17.81
demikernel::connect 20.93 2806.27 1241.52 0.00
bgc::inetstack::tcp::established::background;tcp::established::background::sender;catnip::runtime::transmit 20.93 585.00 258.55 11.47
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter;catnip::runtime::transmit 15.75 241.99 108.92 0.01
demikernel::socket 10.30 1563.84 693.90 0.00
bgc::inetstack::arp::background 6.43 2254.88 997.35 0.00
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger;catnip::runtime::transmit 5.00 1831.33 812.68 16.53
bgc::inetstack::icmp::background 1.05 2991.97 1311.98 0.00
demikernel::new 1.00 1743042728.48 765073580.16 48.69
demikernel::bind 1.00 9732.19 4304.33 0.00
demikernel::listen 1.00 2932.00 1281.01 0.00
demikernel::close 0.00 nan nan 0.00

Copy link

libos = catpowder
commit id = 5cd112f

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::inetstack::poll;inetstack::layer4_endpoint::poll_once 18993127.60 700.18 308.88 85.36
bgc::inetstack::poll 9496563.80 1657.86 731.17 54.13
bgc::inetstack::tcp::established::background 11527.36 1654.77 728.16 0.20
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 11527.36 474.88 210.93 22.74
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 11518.00 377.00 166.63 28.84
bgc::inetstack::tcp::established::background;tcp::established::background::sender 11476.07 975.55 421.90 24.90
ioc::network::libos::pop 9230.24 461.59 203.43 0.04
ioc::network::libos::push;inetstack::push 8762.80 5954.36 2646.05 2.21
demikernel::sgafree 8746.89 92.77 41.02 0.01
ioc::network::libos::push 8073.74 33462111.71 14759946.85 40.41
demikernel::push 8073.74 585.36 259.28 0.06
demikernel::sgaalloc 6500.50 140.55 61.99 0.02
demikernel::pop 6035.29 584.87 258.64 0.04
bgc::inetstack::poll;inetstack::poll_bg_work::for::for 5732.42 2310.36 1006.62 1.64
ioc::network::libos::pushto 649.67 4363.45 1809.69 2.27
ioc::network::libos::pushto;inetstack::push 649.67 3953.14 1639.49 90.61
demikernel::pushto 649.67 498.83 206.81 0.24
bgc::inetstack::poll;inetstack::poll_bg_work::for::for;udp::receive 202.00 192.39 80.32 61.32
ioc::network::libos::close 48.42 7357.79 3202.92 0.10
ioc::network::libos::connect 41.86 34555.57 15436.21 0.40
bgc::inetstack::tcp::passiveopen::background 41.86 33148.38 14675.93 0.01
ioc::network::libos::accept 38.00 2310.16 1022.09 0.00
demikernel::async_close 32.50 777.46 328.08 0.01
demikernel::accept 21.86 1704.83 744.56 0.00
demikernel::connect 20.93 3814.40 1663.07 0.02
demikernel::socket 10.30 1559.71 683.25 0.00
bgc::inetstack::arp::background 6.38 1919.28 842.47 0.00
bgc::inetstack::icmp::background 1.03 3163.38 1391.75 0.00
demikernel::new 1.00 90632505.72 39689869.03 19.53
demikernel::bind 1.00 27594.06 11860.48 0.00
demikernel::listen 1.00 3825.93 1674.54 0.00
demikernel::close 0.00 nan nan 0.00

Copy link

libos = catnap
commit id = 5cd112f

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::catnap::transport::epoll 13361494.98 1969.20 837.38 33.22
demikernel::sgafree 11534.05 70.64 29.99 0.05
demikernel::sgaalloc 11280.28 116.32 49.08 0.10
ioc::network::libos::push;catnap::linux::transport::push 9066.10 618.82 267.53 3.89
ioc::network::libos::push 8800.48 16569.83 7142.24 6.83
demikernel::push 8800.48 536.47 230.55 0.16
ioc::network::libos::pop;catnap::linux::transport::pop 8022.22 381.68 163.75 4.00
ioc::network::libos::pop 7813.79 23581885.13 10547668.99 24.39
demikernel::pop 7813.79 543.41 231.53 0.12
ioc::network::libos::pushto 528.67 8990.23 3704.29 23.97
ioc::network::libos::pushto;catnap::linux::transport::push 528.67 537.95 220.99 5.96
demikernel::pushto 528.67 529.12 217.69 1.44
demikernel::async_close 32.50 840.15 339.13 0.01
ioc::network::libos::connect 24.95 5282837.95 2240930.96 27.52
ioc::network::libos::connect;catnap::linux::transport::connect 24.95 75547.06 32065.17 2.59
demikernel::connect 24.95 1880.54 807.50 0.01
ioc::network::libos::close 18.35 23964.13 10223.54 0.06
ioc::network::libos::close;catnap::linux::transport::close 18.35 22701.63 9683.12 94.90
demikernel::accept 15.42 1436.05 617.06 0.00
ioc::network::libos::accept 15.41 915880834.84 394332213.47 44.58
ioc::network::libos::accept;catnap::linux::transport::accept 15.39 6225.16 2667.46 0.00
demikernel::socket 9.50 151524.28 64593.14 0.31
demikernel::socket;catnap::linux::transport::socket 9.50 149273.16 63628.79 96.56
demikernel::new 1.00 258851.06 109957.85 0.13
demikernel::bind 1.00 28401.42 12118.67 0.01
demikernel::bind;catnap::linux::transport::bind 1.00 23800.92 10151.25 83.72
demikernel::listen 1.00 14861.37 6366.36 0.00
demikernel::listen;catnap::linux::transport::listen 1.00 13793.45 5909.81 92.75
demikernel::close 0.00 nan nan 0.00

Copy link

libos = catnip
commit id = 5cd112f

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::inetstack::poll;inetstack::layer4_endpoint::poll_once 29857936.57 335.58 144.42 75.86
bgc::inetstack::poll;inetstack::layer4_endpoint::poll_once;catnip::runtime::receive 29857936.57 197.35 84.93 58.91
bgc::inetstack::poll 14928968.28 890.93 383.54 34.64
bgc::inetstack::tcp::established::background 11055.43 1068.00 454.07 0.11
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 11055.43 308.89 130.79 25.88
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 11045.09 336.62 144.98 32.14
bgc::inetstack::tcp::established::background;tcp::established::background::sender 11003.00 297.86 121.42 15.30
ioc::network::libos::pop 9047.10 371.44 159.18 0.02
demikernel::sgafree 8780.68 81.73 35.12 0.01
ioc::network::libos::push;inetstack::push 8762.80 1973.45 883.01 0.68
ioc::network::libos::push;inetstack::push;catnip::runtime::transmit 8762.80 313.90 140.34 15.34
ioc::network::libos::push 8073.74 33377798.39 14705722.33 26.17
demikernel::push 8073.74 659.71 291.31 0.04
demikernel::sgaalloc 6536.54 120.56 53.36 0.01
demikernel::pop 6052.86 541.83 229.65 0.02
bgc::inetstack::poll;inetstack::poll_bg_work::for::for 4571.31 2391.63 1018.55 2.13
ioc::network::libos::pushto 1246.67 1310.34 586.69 0.05
ioc::network::libos::pushto;inetstack::push 1246.67 704.93 315.86 54.09
demikernel::pushto 1246.67 483.44 216.65 0.02
ioc::network::libos::pushto;inetstack::push;catnip::runtime::transmit 1246.67 253.21 113.42 35.90
bgc::inetstack::poll;inetstack::poll_bg_work::for::for;udp::receive 543.33 237.27 101.72 70.04
ioc::network::libos::close 49.43 5781.43 2508.70 0.01
bgc::inetstack::tcp::passiveopen::background 41.86 34174.08 14969.38 0.00
ioc::network::libos::connect 41.86 32762.62 14551.90 0.04
ioc::network::libos::connect;catnip::runtime::transmit 41.86 6566.40 3003.39 21.71
ioc::network::libos::accept 38.18 2066.16 895.77 0.00
demikernel::async_close 32.50 613.39 244.94 0.00
demikernel::accept 21.86 1930.45 853.47 0.00
bgc::inetstack::poll;inetstack::poll_bg_work::for::for;catnip::runtime::transmit 21.14 630.63 274.80 3.42
bgc::inetstack::tcp::passiveopen::background;catnip::runtime::transmit 20.96 16705.08 7332.61 16.87
demikernel::connect 20.93 2718.88 1228.31 0.00
bgc::inetstack::tcp::established::background;tcp::established::background::sender;catnip::runtime::transmit 20.93 550.94 239.84 11.14
demikernel::socket 10.30 1907.45 828.88 0.00
bgc::inetstack::arp::background 6.43 2209.15 946.40 0.00
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger;catnip::runtime::transmit 5.00 1998.33 806.09 19.65
bgc::inetstack::icmp::background 1.05 3040.43 1309.31 0.00
demikernel::new 1.00 1751962896.43 753756390.31 48.57
demikernel::bind 1.00 11303.75 4793.30 0.00
demikernel::listen 1.00 3853.79 1639.83 0.00
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter;catnip::runtime::transmit 1.00 466.00 201.16 0.00
demikernel::close 0.00 nan nan 0.00

Copy link

libos = catpowder
commit id = 5cd112f

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::inetstack::poll;inetstack::layer4_endpoint::poll_once 18981305.97 707.41 314.12 85.53
bgc::inetstack::poll 9490652.98 1663.43 738.98 53.94
bgc::inetstack::tcp::established::background 11059.95 1662.04 728.18 0.20
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 11059.95 485.42 213.59 22.75
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 11051.30 391.60 173.74 29.22
bgc::inetstack::tcp::established::background;tcp::established::background::sender 11009.39 920.92 394.87 24.42
ioc::network::libos::pop 9032.96 450.88 198.59 0.04
ioc::network::libos::push;inetstack::push 8762.80 6592.94 2956.55 2.44
demikernel::sgafree 8748.87 83.39 36.81 0.01
ioc::network::libos::push 8073.74 33444557.52 15871309.27 40.66
demikernel::push 8073.74 624.83 279.12 0.06
demikernel::sgaalloc 6503.21 148.62 66.95 0.02
demikernel::pop 6036.43 683.76 299.62 0.04
bgc::inetstack::poll;inetstack::poll_bg_work::for::for 5284.63 2430.92 1058.32 1.45
ioc::network::libos::pushto 684.67 4474.12 1935.68 2.32
ioc::network::libos::pushto;inetstack::push 684.67 4044.08 1749.20 90.39
demikernel::pushto 684.67 491.86 212.93 0.24
bgc::inetstack::poll;inetstack::poll_bg_work::for::for;udp::receive 214.00 214.83 93.98 61.97
ioc::network::libos::close 47.73 7640.19 3360.31 0.10
bgc::inetstack::tcp::passiveopen::background 41.86 38590.25 16730.71 0.01
ioc::network::libos::connect 41.86 38383.00 17032.94 0.47
ioc::network::libos::accept 38.39 3040.88 1300.56 0.00
demikernel::async_close 32.50 626.36 269.50 0.01
demikernel::accept 21.86 1210.89 525.24 0.00
demikernel::connect 20.93 4064.36 1827.57 0.02
demikernel::socket 10.30 1967.06 860.50 0.00
bgc::inetstack::arp::background 6.33 2059.17 905.33 0.00
bgc::inetstack::icmp::background 1.03 3116.18 1374.33 0.00
demikernel::new 1.00 94494508.75 41787306.90 19.53
demikernel::bind 1.00 25823.12 11199.00 0.00
demikernel::listen 1.00 3839.36 1742.30 0.00
demikernel::close 0.00 nan nan 0.00

Copy link
Contributor

@iyzhang iyzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@anandbonde anandbonde merged commit d866a2a into dev Nov 25, 2024
14 checks passed
@anandbonde anandbonde deleted the ab-tcp-handle-rst-packet branch November 25, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants