Page MenuHomeFreeBSD

tcp: restore some memory savings associated with TIME_WAIT state
AcceptedPublic

Authored by glebius on Oct 5 2022, 5:03 PM.
Tags
None
Referenced Files
F115627927: D36887.diff
Sat, Apr 26, 5:40 AM
F115588806: D36887.id111475.diff
Fri, Apr 25, 6:05 PM
Unknown Object (File)
Thu, Apr 17, 12:33 PM
Unknown Object (File)
Wed, Apr 16, 12:03 PM
Unknown Object (File)
Mar 26 2025, 8:33 PM
Unknown Object (File)
Mar 9 2025, 8:26 AM
Unknown Object (File)
Feb 25 2025, 7:39 PM
Unknown Object (File)
Feb 24 2025, 11:01 PM
Subscribers

Details

Reviewers
rrs
Group Reviewers
transport
Summary

Although with XXXXXX we no longer reallocate tcpcb to tcptw, we are still
interested in not wasting extra memory while a connection waits for 2MSL
timeout.

  • In tcp_twstart() when transitioning to TIME_WAIT, if the file descriptor had been closed, let's free the socket and contexts that hang off the socket (e.g. kTLS context).
  • In tcp_usr_detach() differentiate this case by absence of INP_DROPPED flag and don't free the pcb.
  • After the 2MSL timeout in tcp_close() differentiate a pcb that has been left by tcp_usr_detach() by checking that inp_socket pointer is NULL.
  • Go around the code touched by XXXXXX and restore safety checks for a connection in TIME_WAIT state. Previously we were guarding against dereferencing inp_ppcb as tcptw, now we are guarding against dereferencing inp_socket.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 47724
Build 44611: arc lint + arc unit