xs_tcp_write_space(9)
πΈ xs_tcp_write_space(9) β like, the socket write-space callback πΈ
okay bestie, welcome to the xs_tcp_write_space(9) page, live from the Kernel API Manual π this one is short and sweet but she is important, so let's get into it.
β¨ NAME β¨
xs_tcp_write_space β the callback that gets invoked when socket buffer space becomes available π
π¦ SYNOPSIS π¦
void xs_tcp_write_space (struct sock *sk );
that's it. that's the whole signature. no cap. π
πΈ ARGUMENTS πΈ
skβ the socket whose state has changed, bestie. that's the one we're talking about π«Ά
π DESCRIPTION π
So here's the vibe: this gets called when more output buffer space is available for this socket β¨ that's the whole trigger, no secret lore.
But here's the part everyone always asks about β we do not just immediately wake up our writers the second there's a crumb of space. nope! we try not to wake our writers until they can make "significant" progress π
why? because otherwise we'll waste resources thrashing kernel_sendmsg with a bunch of small requests π like, imagine waking someone up for one single grape. embarrassing. so we wait until there's actually enough room for the writers to do something real. main character energy only. π₯
fr fr, the whole point of not waking writers early is so we're not out here burning resources on tiny sends. respect the buffer. π
π SEE ALSO π
Kernel file ./net/sunrpc/xprtsock.c plus literally all of these:
xs_nospace(9)xs_local_send_request(9)xs_udp_send_request(9)xs_tcp_send_request(9)xs_error_report(9)xs_close(9)xs_destroy(9)xs_udp_data_read_skb(9)xs_data_ready(9)xs_local_state_change(9)xs_tcp_state_change(9)xs_udp_write_space(9)xs_udp_set_buffer_size(9)xs_udp_timer(9)xs_set_port(9)xs_local_setup_socket(9)xs_enable_swap(9)xs_disable_swap(9)xs_tcp_shutdown(9)xs_tcp_setup_socket(9)xs_tls_handshake_done(9)xs_tcp_tls_setup_socket(9)xs_connect(9)xs_local_print_stats(9)xs_udp_print_stats(9)xs_tcp_print_stats(9)bc_send_request(9)xs_setup_local(9)xs_setup_udp(9)xs_setup_tcp(9)xs_setup_tcp_tls(9)xs_setup_bc_tcp(9)init_socket_xprt(9)cleanup_socket_xprt(9)
okay that's the page!! go read the rest of the xprtsock girlies when you're done, they all live together π
this came from ./net/sunrpc, dated October 2026 β mwah, sending you off with a kiss π«Άβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms