xprt_adjust_cwnd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xprt_adjust_cwnd(9) β€” like, the whole vibe πŸ’…

okay so bestie, we're in the Kernel API Manual today and this function is genuinely iconic. her whole job? adjusting the transport congestion window. that's it. that's the gig. let's get into it πŸŽ€


✨ NAME ✨

xprt_adjust_cwnd β€” adjust transport congestion window


🌸 SYNOPSIS 🌸

void xprt_adjust_cwnd (struct rpc_xprt *xprt , struct rpc_task *task ,
int result );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • xprt β€” pointer to xprt. literally just a pointer, she's pointing at the transport, slay.
  • task β€” the recently completed RPC request that gets used to adjust the window πŸ‘‘
  • result β€” the result code of that completed RPC request

πŸ’– DESCRIPTION πŸ’–

so the transport code keeps an estimate of the max number of outstanding RPC requests, and it does that using a smoothed version of the congestion avoidance implemented in 44BSD. yes, the whole thing is basically the Van Jacobson congestion algorithm β€” no cap, that's the blueprint πŸ”₯

here's the tea on how it behaves:

  • if a retransmit occurs, the congestion window is halved πŸ’€
  • otherwise, it's incremented by 1/cwnd when all of the following are true:
    • a reply is received
    • a full number of requests are outstanding
    • the congestion window hasn't been updated recently

like, all three. every time. she's picky and honestly? respect. periodt 🫢


🌈 SEE ALSO 🌈

kernel file ./net/sunrpc/xprt.c, plus the whole friend group:

xprt_register_transport(9), xprt_unregister_transport(9), xprt_find_transport_ident(9), xprt_reserve_xprt(9), xprt_release_xprt(9), xprt_release_xprt_cong(9), xprt_request_get_cong(9), xprt_release_rqst_cong(9), xprt_wake_pending_tasks(9), xprt_wait_for_buffer_space(9), xprt_write_space(9), xprt_adjust_timeout(9), xprt_disconnect_done(9), xprt_schedule_autoclose_locked(9), xprt_force_disconnect(9), xprt_conditional_disconnect(9), xprt_connect(9), xprt_reconnect_delay(9), xprt_reconnect_backoff(9), xprt_lookup_rqst(9), xprt_pin_rqst(9), xprt_unpin_rqst(9), xprt_request_enqueue_receive(9), xprt_request_dequeue_receive_locked(9), xprt_update_rtt(9), xprt_complete_rqst(9), xprt_wait_for_reply_request_def(9), xprt_wait_for_reply_request_rtt(9), xprt_request_wait_receive(9), xprt_request_enqueue_transmit(9), xprt_request_dequeue_transmit_locked(9), xprt_request_dequeue_transmit(9), xprt_request_dequeue_xprt(9), xprt_request_prepare(9), xprt_request_need_retransmit(9), xprt_prepare_transmit(9), xprt_request_transmit(9), xprt_transmit(9), xprt_add_backlog_noncongested(9), xprt_reserve(9), xprt_retry_reserve(9), xprt_release(9), xprt_create_transport(9), xprt_destroy(9), xprt_get(9), xprt_put(9)


and that's the page!! 🧚 she lives in ./net/sunrpc, dated October 2026, and yes the manual section is still xprt_adjust_cwnd(9) because we keep it consistent, bestie πŸ’œ mwah, go adjust some cwnd πŸ’…βœ¨

πŸ“¦ where this page comes from