[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iL+D-OcDgxWYVP4vufeuOESrz=jy-wknM=Bbb7qVZoJuw@mail.gmail.com>
Date: Wed, 20 Aug 2025 23:46:42 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Kuniyuki Iwashima <kuniyu@...gle.com>
Cc: "David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Neal Cardwell <ncardwell@...gle.com>,
David Ahern <dsahern@...nel.org>, Simon Horman <horms@...nel.org>,
Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org,
Kuniyuki Iwashima <kuniyu@...zon.com>
Subject: Re: [PATCH v1 net-next 2/7] tcp: Save __module_get() for TIME_WAIT sockets.
On Wed, Aug 20, 2025 at 11:16 PM Kuniyuki Iwashima <kuniyu@...gle.com> wrote:
>
> From: Kuniyuki Iwashima <kuniyu@...zon.com>
>
> __module_get() in inet_twsk_alloc() was necessary to prevent
> unloading tw->tw_prot, which is used in inet_twsk_free().
>
> DCCP has gone, and TCP is built-in, so the pair is no longer needed.
>
> ULPs also do not need it because
>
> * kTLS and XFRM_ESPINTCP restore sk_prot before close()
> * MPTCP is built-in
> * SMC uses TCP as is
>
> , but using tw_prot without module_get() would be error prone to
> future ULP addition.
>
> Now we can use kfree() without the slab cache pointer thanks to SLUB.
Right, but kmem_cache_free() has extra debug checks (SLAB_CONSISTENCY_CHECKS):
we check the object was indeed allocated from a precise cache.
I would prefer leaving this in place.
Such a conversion could be done globally if you think about it, no
need for hundreds of patches.
static inline void kmem_cache_free(struct kmem_cache *s, void *x)
{
kfree(x);
}
>
> Let's use kfree() in inet_twsk_free() and remove 2 atomic ops
> for each connection.
>
Where are you seeing the atomic ops exactly ?
TCP is builtin, so .owner is NULL.
Powered by blists - more mailing lists