[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87ed2naz5z.fsf@cloudflare.com>
Date: Wed, 04 Dec 2024 22:58:16 +0100
From: Jakub Sitnicki <jakub@...udflare.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: netdev@...r.kernel.org, Jason Xing <kerneljasonxing@...il.com>, Adrien
Vasseur <avasseur@...udflare.com>, Lee Valentine
<lvalentine@...udflare.com>, kernel-team@...udflare.com
Subject: Re: [PATCH net-next 1/2] tcp: Measure TIME-WAIT reuse delay with
millisecond precision
On Wed, Dec 04, 2024 at 08:22 PM +01, Eric Dumazet wrote:
> On Wed, Dec 4, 2024 at 7:53 PM Jakub Sitnicki <jakub@...udflare.com> wrote:
>
>> A low effort alternative would be to introduce a new field to hold a
>> millisecond timestamp for measuring the TW reuse delay. However, this would
>> cause the struct tcp_timewait_socket size to go over 256 bytes and overflow
>> into another cache line.
>
> s/tcp_timewait_socket/tcp_timewait_sock/
>
> Can you elaborate on this ?
>
> Due to SLUB management, note that timewait_sockets are not cache
> aligned, and use 264 bytes already:
>
> # grep tw_sock_TCP /proc/slabinfo
> tw_sock_TCPv6 3596 3596 264 62 4 : tunables 0 0
> 0 : slabdata 58 58 0
> tw_sock_TCP 0 0 264 62 4 : tunables 0 0
> 0 : slabdata 0 0 0
>
> In any case, there is one 4 byte hole in struct inet_timewait_sock
> after tw_priority
You're right. <facepalm> Thanks for keeping me honest here.
I must have checked pahole on the host (Ubuntu LTS kernel) instead of
inside the dev VM, which shows:
# grep tw_sock_TCP /proc/slabinfo
tw_sock_TCPv6 0 0 288 28 2 : tunables 0 0 0 : slabdata 0 0 0
tw_sock_TCP 0 0 288 28 2 : tunables 0 0 0 : slabdata 0 0 0
# pahole -C tcp_timewait_sock
struct tcp_timewait_sock {
struct inet_timewait_sock tw_sk; /* 0 256 */
/* --- cacheline 4 boundary (256 bytes) --- */
u32 tw_rcv_wnd; /* 256 4 */
u32 tw_ts_offset; /* 260 4 */
u32 tw_ts_recent; /* 264 4 */
u32 tw_last_oow_ack_time; /* 268 4 */
u32 tw_ts_recent_stamp; /* 272 4 */
u32 tw_tx_delay; /* 276 4 */
/* size: 280, cachelines: 5, members: 7 */
/* last cacheline: 24 bytes */
};
#
Let me pivot to the simplest approach then and make use of that 4-byte
hole in inet_timewait_sock. (Which I didn't consider either, so thank
you for the idea.) This would save me from having to touch the PAWS
code.
Powered by blists - more mailing lists