When TCP_REQUEST_TRK is enabled, the tcb grows by 600 bytes
to accommodate the t_tcpreq_info[MAX_TCP_TRK_REQ] array.
Even when the option is enabled, not every connection is using
this feature. So let's allocate it on-demand, and save 600
bytes in the common case.
Details
Details
- Reviewers
rrs tuexen nickbanks_netflix.com glebius - Group Reviewers
transport - Commits
- rG29336f1c9d25: tcp: Allocate t_tcpreq_info on demand
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Given this is purely a RACK feature, I would suggest to move it from generic struct tcpcb to struct tcp_rack.
Comment Actions
Two options: 1) embed all of this in struct tcp_rack:
#ifdef TCP_REQUEST_TRK
/* Response tracking addons. */
uint8_t t_tcpreq_req; /* Request count */
uint8_t t_tcpreq_open; /* Number of open range requests */
uint8_t t_tcpreq_closed; /* Number of closed range requests */
uint32_t tcp_hybrid_start; /* Num of times we started hybrid pacing */
uint32_t tcp_hybrid_stop; /* Num of times we stopped hybrid pacing */
uint32_t tcp_hybrid_error; /* Num of times we failed to start hybrid pacing */
struct tcp_sendfile_track *t_tcpreq_info;
#endifor 2) create a new structure that holds all of the above, lazily allocate it and have a pointer from struct tcp_rack to it.
Comment Actions
The same could be said of TCP_ACCOUNTING as well.
In any case, I'd prefer to at least start with this. What you suggest would be much more invasive and require more testing. This is a simple change that delivers 90% of the benefit in terms of shrinking the tcb without a lot of churn or testing required.