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] Enhancement: replace immediate send #1455

Merged
merged 1 commit into from
Nov 13, 2024
Merged

[inetstack] Enhancement: replace immediate send #1455

merged 1 commit into from
Nov 13, 2024

Conversation

iyzhang
Copy link
Contributor

@iyzhang iyzhang commented Nov 6, 2024

This PR places back the immediate send path that use to exist for inlining a send if the send window is open.

@iyzhang iyzhang requested a review from anandbonde November 6, 2024 01:36
Copy link

github-actions bot commented Nov 6, 2024

libos = catnap
commit id = 73f25a6

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::catnap::transport::epoll 13336741.50 1860.28 827.49 32.77
demikernel::sgafree 11536.37 74.86 32.35 0.05
demikernel::sgaalloc 11285.32 112.26 49.52 0.10
ioc::network::libos::push;catnap::linux::transport::push 9066.06 779.65 342.17 4.80
ioc::network::libos::push 8800.46 16949.35 7470.62 6.58
demikernel::push 8800.46 538.41 236.31 0.15
ioc::network::libos::pop;catnap::linux::transport::pop 8024.01 529.08 230.08 3.07
ioc::network::libos::pop 7815.53 19250273.35 8004965.09 25.01
demikernel::pop 7815.53 500.66 216.74 0.11
ioc::network::libos::pushto 619.00 8254.81 3961.67 25.40
ioc::network::libos::pushto;catnap::linux::transport::push 619.00 583.51 277.48 7.07
demikernel::pushto 619.00 505.75 244.04 1.59
demikernel::async_close 32.50 927.24 380.59 0.01
ioc::network::libos::connect 24.95 5613166.50 2412483.58 27.77
ioc::network::libos::connect;catnap::linux::transport::connect 24.95 55895.06 24202.71 1.80
demikernel::connect 24.95 2133.30 926.57 0.01
ioc::network::libos::close 18.35 23040.68 10027.38 0.06
ioc::network::libos::close;catnap::linux::transport::close 18.35 22062.43 9599.18 95.98
demikernel::accept 15.42 1364.49 596.16 0.00
ioc::network::libos::accept 15.41 890844837.59 389996719.84 44.77
ioc::network::libos::accept;catnap::linux::transport::accept 15.39 2577.71 1121.43 0.00
demikernel::socket 9.50 121321.96 52633.56 0.18
demikernel::socket;catnap::linux::transport::socket 9.50 120031.28 52067.68 97.82
demikernel::new 1.00 257529.35 112233.95 0.13
demikernel::bind 1.00 28877.50 12573.40 0.01
demikernel::bind;catnap::linux::transport::bind 1.00 24328.40 10591.41 84.28
demikernel::listen 1.00 15439.32 6692.68 0.00
demikernel::listen;catnap::linux::transport::listen 1.00 14518.18 6296.23 94.00
demikernel::close 0.00 nan nan 0.00

Copy link

github-actions bot commented Nov 6, 2024

libos = catpowder
commit id = 73f25a6

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::inetstack::poll_recv;inetstack::layer4_endpoint::poll_once 18986873.83 677.38 288.40 86.27
bgc::inetstack::poll_recv 9493436.92 1570.23 668.47 52.15
bgc::inetstack::tcp::established::background 16570.84 3479.28 1477.62 0.55
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 16570.84 529.65 227.68 12.77
bgc::inetstack::tcp::established::background;tcp::established::background::receiver 16561.75 1015.00 432.49 28.85
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 16532.14 1282.27 539.59 32.91
bgc::inetstack::tcp::established::background;tcp::established::background::sender 16490.11 900.34 385.46 11.87
ioc::network::libos::pop 9044.73 1007.15 424.74 0.08
demikernel::sgafree 8797.26 111.57 48.30 0.01
ioc::network::libos::push;inetstack::push 8762.80 6208.20 2659.73 1.90
ioc::network::libos::push 8073.74 33670011.79 15657037.98 42.67
demikernel::push 8073.74 670.43 291.37 0.04
demikernel::sgaalloc 6578.62 166.72 72.18 0.03
demikernel::pop 6049.20 621.86 263.50 0.03
bgc::inetstack::poll_recv;inetstack::poll_bg_work::for::for 5294.12 636.10 272.29 0.62
ioc::network::libos::pushto 1539.67 4494.06 1983.19 6.44
ioc::network::libos::pushto;inetstack::push 1539.67 3947.99 1741.84 87.83
demikernel::pushto 1539.67 475.39 210.01 0.65
bgc::inetstack::poll_recv;inetstack::poll_bg_work::for::for;udp::receive 511.33 214.20 96.71 63.11
ioc::network::libos::close 48.25 7141.26 3076.59 0.13
bgc::passive_listening::poll 44.39 5562.98 2374.34 0.00
ioc::network::libos::connect 41.86 22199.31 9521.39 0.18
bgc::inetstack::tcp::passiveopen::background 41.86 14156.57 6050.87 0.00
ioc::network::libos::accept 38.32 2625.92 1121.18 0.00
demikernel::async_close 32.50 733.37 321.00 0.01
demikernel::accept 21.86 1187.17 510.35 0.00
demikernel::connect 20.93 3932.10 1700.08 0.02
demikernel::socket 10.30 1329.90 566.00 0.00
bgc::inetstack::arp::background 6.38 1734.32 735.58 0.00
bgc::inetstack::poll_recv;inetstack::poll;inetstack::layer4_endpoint::poll_once 2.00 5755.35 2454.91 82.48
bgc::inetstack::icmp::background 1.03 3434.10 1463.98 0.00
demikernel::new 1.00 91019115.28 38751208.86 19.58
demikernel::bind 1.00 24420.50 10372.56 0.00
bgc::inetstack::poll_recv;inetstack::poll 1.00 13858.63 5911.71 0.04
demikernel::listen 1.00 5815.43 2470.70 0.00
demikernel::close 0.00 nan nan 0.00

Copy link

github-actions bot commented Nov 6, 2024

libos = catnip
commit id = 73f25a6

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::inetstack::poll_recv;inetstack::layer4_endpoint::poll_once 29362962.43 332.21 137.61 76.75
bgc::inetstack::poll_recv;inetstack::layer4_endpoint::poll_once;catnip::runtime::receive 29362962.43 195.27 80.88 58.80
bgc::inetstack::poll_recv 14681481.22 865.98 358.77 33.30
bgc::inetstack::tcp::established::background 16574.34 2635.70 1093.57 0.34
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 16574.34 391.86 162.85 13.72
bgc::inetstack::tcp::established::background;tcp::established::background::receiver 16563.98 673.85 276.76 26.48
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 16532.48 1169.87 488.92 36.37
bgc::inetstack::tcp::established::background;tcp::established::background::sender 16490.46 337.47 134.62 8.12
ioc::network::libos::pop 9044.67 853.46 355.32 0.05
demikernel::sgafree 8788.36 92.27 38.54 0.00
ioc::network::libos::push;inetstack::push 8762.80 2220.94 937.98 0.58
ioc::network::libos::push;inetstack::push;catnip::runtime::transmit 8762.80 339.91 143.11 14.54
ioc::network::libos::push 8073.74 33593365.20 13846625.77 32.28
demikernel::push 8073.74 719.57 300.90 0.02
demikernel::sgaalloc 6554.79 117.76 48.98 0.00
demikernel::pop 6051.88 602.56 247.51 0.01
bgc::inetstack::poll_recv;inetstack::poll_bg_work::for::for 3070.22 802.61 333.76 0.63
ioc::network::libos::pushto 1382.33 1403.40 609.75 0.07
ioc::network::libos::pushto;inetstack::push 1382.33 698.28 303.67 49.87
demikernel::pushto 1382.33 478.73 208.58 0.02
ioc::network::libos::pushto;inetstack::push;catnip::runtime::transmit 1382.33 256.99 111.67 36.76
bgc::inetstack::poll_recv;inetstack::poll_bg_work::for::for;udp::receive 540.33 254.54 110.53 71.80
ioc::network::libos::close 49.45 6007.06 2476.81 0.01
ioc::network::libos::connect 41.86 14806.83 6112.69 0.01
bgc::inetstack::tcp::passiveopen::background 41.86 13955.20 5906.69 0.00
ioc::network::libos::connect;catnip::runtime::transmit 41.86 5754.01 2378.37 27.01
bgc::passive_listening::poll 39.68 6493.72 2728.31 0.00
ioc::network::libos::accept 38.75 2554.29 1068.64 0.00
demikernel::async_close 32.50 625.23 245.92 0.00
demikernel::accept 21.86 1492.20 637.23 0.00
bgc::inetstack::tcp::established::background;tcp::established::background::receiver;catnip::runtime::transmit 21.09 549.11 227.39 3.28
bgc::inetstack::tcp::passiveopen::background;catnip::runtime::transmit 20.93 16356.33 6975.21 37.02
demikernel::connect 20.93 2496.67 1028.84 0.00
bgc::inetstack::tcp::established::background;tcp::established::background::sender;catnip::runtime::transmit 20.93 627.35 259.53 8.29
demikernel::socket 10.30 1799.89 743.74 0.00
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger;catnip::runtime::transmit 9.00 3210.00 1285.73 34.56
bgc::inetstack::arp::background 6.57 2244.85 934.55 0.00
bgc::inetstack::poll_recv;inetstack::poll;inetstack::layer4_endpoint::poll_once 2.00 20579.73 8528.56 95.37
bgc::inetstack::poll_recv;inetstack::poll;inetstack::layer4_endpoint::poll_once;catnip::runtime::receive 2.00 18276.35 7573.54 88.79
bgc::inetstack::icmp::background 1.05 3468.53 1433.20 0.00
demikernel::new 1.00 1763479687.08 730337115.06 45.85
bgc::inetstack::poll_recv;inetstack::poll 1.00 43149.83 17879.75 0.15
demikernel::bind 1.00 11518.50 4803.00 0.00
demikernel::listen 1.00 4895.29 2036.61 0.00
demikernel::close 0.00 nan nan 0.00

@iyzhang
Copy link
Contributor Author

iyzhang commented Nov 8, 2024

This PR improves single client echo latency by 4us on prometheus8/9. packet size: 1024 bytes. Run for 10 seconds. Each run 3 times.

Average before PR: 20.7us
Average after PR: 16.3us

Copy link

github-actions bot commented Nov 8, 2024

libos = catpowder
commit id = 01f96d5

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::inetstack::poll_recv;inetstack::layer4_endpoint::poll_once 19074481.60 673.73 287.41 86.01
bgc::inetstack::poll_recv 9537240.80 1567.49 668.67 52.43
bgc::inetstack::tcp::established::background 16569.09 3360.34 1432.63 0.56
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 16569.09 496.15 214.01 12.95
bgc::inetstack::tcp::established::background;tcp::established::background::receiver 16560.79 965.85 408.73 28.57
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 16531.80 1258.65 538.50 33.20
bgc::inetstack::tcp::established::background;tcp::established::background::sender 16489.91 854.44 354.35 12.06
ioc::network::libos::pop 9032.43 976.48 419.28 0.09
demikernel::sgafree 8784.40 102.49 44.85 0.01
ioc::network::libos::push;inetstack::push 8762.74 6299.19 2737.89 2.06
ioc::network::libos::push 8073.71 33692238.22 15685541.39 42.74
demikernel::push 8073.71 604.70 260.07 0.04
demikernel::sgaalloc 6574.46 158.78 68.33 0.02
demikernel::pop 6037.61 636.52 271.07 0.04
bgc::inetstack::poll_recv;inetstack::poll_bg_work::for::for 5282.15 642.61 275.55 0.67
ioc::network::libos::pushto 1312.67 4644.39 1957.13 3.51
ioc::network::libos::pushto;inetstack::push 1312.67 4067.75 1714.34 87.61
demikernel::pushto 1312.67 525.87 221.55 0.40
bgc::inetstack::poll_recv;inetstack::poll_bg_work::for::for;udp::receive 277.67 225.72 98.87 65.83
ioc::network::libos::close 47.43 6502.34 2769.48 0.09
bgc::passive_listening::poll 44.61 5568.91 2402.36 0.00
ioc::network::libos::connect 41.86 22382.66 9594.73 0.16
bgc::inetstack::tcp::passiveopen::background 41.86 14503.34 6235.81 0.00
ioc::network::libos::accept 38.57 2872.71 1244.09 0.00
demikernel::async_close 32.50 621.04 254.94 0.01
demikernel::accept 21.86 1184.31 512.03 0.00
demikernel::connect 20.93 4156.60 1795.36 0.02
demikernel::socket 10.30 1628.37 693.63 0.00
bgc::inetstack::arp::background 6.38 1823.59 779.19 0.00
bgc::inetstack::poll_recv;inetstack::poll;inetstack::layer4_endpoint::poll_once 2.00 6458.93 2751.66 83.75
bgc::inetstack::icmp::background 1.03 3478.98 1479.12 0.00
demikernel::new 1.00 96506442.00 41118660.52 19.44
demikernel::bind 1.00 27485.69 11692.04 0.00
bgc::inetstack::poll_recv;inetstack::poll 1.00 15324.47 6528.31 0.03
demikernel::listen 1.00 5568.93 2390.95 0.00
demikernel::close 0.00 nan nan 0.00

Copy link

github-actions bot commented Nov 8, 2024

libos = catnip
commit id = 01f96d5

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::inetstack::poll_recv;inetstack::layer4_endpoint::poll_once 28998221.10 331.86 139.07 77.17
bgc::inetstack::poll_recv;inetstack::layer4_endpoint::poll_once;catnip::runtime::receive 28998221.10 194.31 81.40 58.57
bgc::inetstack::poll_recv 14499110.55 860.28 360.56 32.97
bgc::inetstack::tcp::established::background 16574.45 2643.17 1105.01 0.34
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger 16574.45 390.76 163.53 13.74
bgc::inetstack::tcp::established::background;tcp::established::background::receiver 16564.07 665.94 275.25 26.46
bgc::inetstack::tcp::established::background;tcp::established::background::retransmitter 16532.66 1191.65 501.49 36.55
bgc::inetstack::tcp::established::background;tcp::established::background::sender 16490.77 336.34 134.57 8.20
ioc::network::libos::pop 9046.33 858.64 358.86 0.06
demikernel::sgafree 8780.57 83.49 35.12 0.00
ioc::network::libos::push;inetstack::push 8762.80 2191.11 943.84 0.57
ioc::network::libos::push;inetstack::push;catnip::runtime::transmit 8762.80 339.40 145.89 14.81
ioc::network::libos::push 8073.74 33624191.30 14039081.78 32.57
demikernel::push 8073.74 728.84 309.14 0.02
demikernel::sgaalloc 6535.88 126.96 54.18 0.00
demikernel::pop 6053.55 580.46 241.45 0.01
bgc::inetstack::poll_recv;inetstack::poll_bg_work::for::for 3024.36 791.43 331.62 0.60
ioc::network::libos::pushto 1244.67 1411.50 613.92 0.06
ioc::network::libos::pushto;inetstack::push 1244.67 701.91 305.78 49.95
demikernel::pushto 1244.67 502.44 219.30 0.02
ioc::network::libos::pushto;inetstack::push;catnip::runtime::transmit 1244.67 256.80 111.79 36.50
bgc::inetstack::poll_recv;inetstack::poll_bg_work::for::for;udp::receive 545.00 258.04 113.85 71.67
ioc::network::libos::close 49.38 6030.56 2559.98 0.01
ioc::network::libos::connect 41.86 15584.25 6790.38 0.01
bgc::inetstack::tcp::passiveopen::background 41.86 13640.86 5724.39 0.00
ioc::network::libos::connect;catnip::runtime::transmit 41.86 6238.68 2743.66 28.19
bgc::passive_listening::poll 40.64 6506.24 2711.59 0.00
ioc::network::libos::accept 38.68 2543.65 1053.80 0.00
demikernel::async_close 32.50 572.69 223.46 0.00
demikernel::accept 21.86 1214.77 507.43 0.00
bgc::inetstack::tcp::established::background;tcp::established::background::receiver;catnip::runtime::transmit 21.00 543.41 226.90 3.56
bgc::inetstack::tcp::passiveopen::background;catnip::runtime::transmit 20.93 15179.94 6419.55 36.09
demikernel::connect 20.93 2652.87 1157.79 0.00
bgc::inetstack::tcp::established::background;tcp::established::background::sender;catnip::runtime::transmit 20.93 689.51 294.59 8.70
demikernel::socket 10.30 1708.79 738.98 0.00
bgc::inetstack::tcp::established::background;tcp::established::background::acknowledger;catnip::runtime::transmit 9.00 3086.22 1224.12 36.26
bgc::inetstack::arp::background 6.57 2125.84 887.87 0.00
bgc::inetstack::poll_recv;inetstack::poll;inetstack::layer4_endpoint::poll_once 2.00 20349.08 8529.14 95.33
bgc::inetstack::poll_recv;inetstack::poll;inetstack::layer4_endpoint::poll_once;catnip::runtime::receive 2.00 18176.00 7617.82 89.30
bgc::inetstack::icmp::background 1.05 3325.25 1396.77 0.00
demikernel::new 1.00 1765589784.15 739676502.43 45.98
bgc::inetstack::poll_recv;inetstack::poll 1.00 42683.63 17887.29 0.18
demikernel::bind 1.00 11023.06 4545.72 0.00
demikernel::listen 1.00 5188.79 2139.24 0.00
demikernel::close 0.00 nan nan 0.00

Copy link

github-actions bot commented Nov 8, 2024

libos = catnap
commit id = 01f96d5

collapsed_stack num_calls cycles_per_call nanoseconds_per_call percent_time
bgc::catnap::transport::epoll 13442272.64 2005.20 870.08 32.40
demikernel::sgafree 11535.56 75.18 32.50 0.05
demikernel::sgaalloc 11284.50 112.84 48.89 0.10
ioc::network::libos::push;catnap::linux::transport::push 9066.12 840.28 370.59 4.95
ioc::network::libos::push 8800.49 17456.35 7677.88 6.51
demikernel::push 8800.49 593.21 259.75 0.16
ioc::network::libos::pop;catnap::linux::transport::pop 8023.23 544.49 237.19 3.57
ioc::network::libos::pop 7814.77 23145612.52 10280484.81 25.34
demikernel::pop 7814.77 562.83 243.63 0.12
ioc::network::libos::pushto 587.00 7684.95 3443.52 25.48
ioc::network::libos::pushto;catnap::linux::transport::push 587.00 540.07 242.03 7.04
demikernel::pushto 587.00 450.27 201.77 1.53
demikernel::async_close 32.50 929.30 378.74 0.01
ioc::network::libos::connect 24.95 6055473.16 2535768.38 27.83
ioc::network::libos::connect;catnap::linux::transport::connect 24.95 57990.86 24921.78 2.00
demikernel::connect 24.95 2276.29 974.86 0.01
ioc::network::libos::close 18.35 23920.11 10407.24 0.07
ioc::network::libos::close;catnap::linux::transport::close 18.35 22908.18 9965.17 96.00
demikernel::accept 15.42 1366.03 599.31 0.00
ioc::network::libos::accept 15.41 894162462.93 393706672.60 44.91
ioc::network::libos::accept;catnap::linux::transport::accept 15.39 2772.92 1217.58 0.00
demikernel::socket 9.50 122938.41 52992.52 0.19
demikernel::socket;catnap::linux::transport::socket 9.50 121471.62 52351.06 97.53
demikernel::new 1.00 255300.76 111008.04 0.10
demikernel::bind 1.00 30383.32 13312.97 0.01
demikernel::bind;catnap::linux::transport::bind 1.00 24809.22 10862.90 83.07
demikernel::listen 1.00 17941.66 7852.76 0.00
demikernel::listen;catnap::linux::transport::listen 1.00 16863.11 7381.29 93.42
demikernel::close 0.00 nan nan 0.00

Copy link
Contributor

@anandbonde anandbonde 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.

@iyzhang iyzhang merged commit a7f0053 into dev Nov 13, 2024
14 checks passed
@iyzhang iyzhang deleted the wip-irene2 branch November 13, 2024 20:30
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