* [PATCH net-next] tcp: move __reqsk_free() out of line
@ 2026-01-31 17:16 Eric Dumazet
2026-02-01 0:07 ` kernel test robot
2026-02-01 0:18 ` kernel test robot
0 siblings, 2 replies; 4+ messages in thread
From: Eric Dumazet @ 2026-01-31 17:16 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, Neal Cardwell, Kuniyuki Iwashima, netdev,
eric.dumazet, Eric Dumazet
Inlining __reqsk_free() is overkill, let's reclaim 2 Kbytes of text.
scripts/bloat-o-meter -t vmlinux.old vmlinux.new
add/remove: 2/2 grow/shrink: 1/14 up/down: 194/-2276 (-2082)
Function old new delta
__reqsk_free - 114 +114
sock_edemux 18 82 +64
__pfx___reqsk_free - 16 +16
__pfx_reqsk_free 16 - -16
tcp_req_err 272 177 -95
reqsk_fastopen_remove 348 253 -95
cookie_bpf_check 157 62 -95
cookie_tcp_reqsk_alloc 387 290 -97
cookie_v4_check 1568 1465 -103
reqsk_free 105 - -105
cookie_v6_check 1519 1412 -107
sock_gen_put 187 78 -109
sock_pfree 212 82 -130
tcp_try_fastopen 1818 1683 -135
tcp_v4_rcv 3478 3294 -184
reqsk_put 306 90 -216
tcp_get_cookie_sock 551 318 -233
tcp_v6_rcv 3404 3141 -263
tcp_conn_request 2677 2384 -293
Total: Before=22582599, After=22580517, chg -0.01%
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/net/request_sock.h | 9 +--------
net/ipv4/inet_connection_sock.c | 10 ++++++++++
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index 9b9e04f6bb8931088d9bb2fa7d4420fecf235895..0cd5a400e5265d8aa1b2452967b4007521c2eee8 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -123,14 +123,7 @@ static inline struct sock *skb_steal_sock(struct sk_buff *skb,
return sk;
}
-static inline void __reqsk_free(struct request_sock *req)
-{
- req->rsk_ops->destructor(req);
- if (req->rsk_listener)
- sock_put(req->rsk_listener);
- kfree(req->saved_syn);
- kmem_cache_free(req->rsk_ops->slab, req);
-}
+void __reqsk_free(struct request_sock *req);
static inline void reqsk_free(struct request_sock *req)
{
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 13372d2cbed53e83510e24a34bc57c7de0a17004..c048a36f26b130dd167e0594d190bcc3bb49e635 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -918,6 +918,16 @@ struct request_sock *inet_reqsk_alloc(const struct request_sock_ops *ops,
}
EXPORT_SYMBOL(inet_reqsk_alloc);
+void __reqsk_free(struct request_sock *req)
+{
+ req->rsk_ops->destructor(req);
+ if (req->rsk_listener)
+ sock_put(req->rsk_listener);
+ kfree(req->saved_syn);
+ kmem_cache_free(req->rsk_ops->slab, req);
+}
+EXPORT_IPV6_MOD_GPL(__reqsk_free);
+
static struct request_sock *inet_reqsk_clone(struct request_sock *req,
struct sock *sk)
{
--
2.53.0.rc1.225.gd81095ad13-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp: move __reqsk_free() out of line
2026-01-31 17:16 [PATCH net-next] tcp: move __reqsk_free() out of line Eric Dumazet
@ 2026-02-01 0:07 ` kernel test robot
2026-02-01 0:18 ` kernel test robot
1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-02-01 0:07 UTC (permalink / raw)
To: Eric Dumazet, David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: llvm, oe-kbuild-all, Simon Horman, Neal Cardwell,
Kuniyuki Iwashima, netdev, eric.dumazet, Eric Dumazet
Hi Eric,
kernel test robot noticed the following build errors:
[auto build test ERROR on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/tcp-move-__reqsk_free-out-of-line/20260201-011758
base: net-next/main
patch link: https://lore.kernel.org/r/20260131171627.1852894-1-edumazet%40google.com
patch subject: [PATCH net-next] tcp: move __reqsk_free() out of line
config: x86_64-buildonly-randconfig-003-20260201 (https://download.01.org/0day-ci/archive/20260201/202602010833.CfxLneEX-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260201/202602010833.CfxLneEX-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602010833.CfxLneEX-lkp@intel.com/
All errors (new ones prefixed by >>):
>> ld.lld: error: undefined symbol: __reqsk_free
>>> referenced by request_sock.h:137 (include/net/request_sock.h:137)
>>> net/core/request_sock.o:(reqsk_fastopen_remove) in archive vmlinux.a
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp: move __reqsk_free() out of line
2026-01-31 17:16 [PATCH net-next] tcp: move __reqsk_free() out of line Eric Dumazet
2026-02-01 0:07 ` kernel test robot
@ 2026-02-01 0:18 ` kernel test robot
2026-02-01 8:17 ` Eric Dumazet
1 sibling, 1 reply; 4+ messages in thread
From: kernel test robot @ 2026-02-01 0:18 UTC (permalink / raw)
To: Eric Dumazet, David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: llvm, oe-kbuild-all, Simon Horman, Neal Cardwell,
Kuniyuki Iwashima, netdev, eric.dumazet, Eric Dumazet
Hi Eric,
kernel test robot noticed the following build errors:
[auto build test ERROR on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/tcp-move-__reqsk_free-out-of-line/20260201-011758
base: net-next/main
patch link: https://lore.kernel.org/r/20260131171627.1852894-1-edumazet%40google.com
patch subject: [PATCH net-next] tcp: move __reqsk_free() out of line
config: um-randconfig-001-20260201 (https://download.01.org/0day-ci/archive/20260201/202602010830.7VDNDITy-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260201/202602010830.7VDNDITy-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602010830.7VDNDITy-lkp@intel.com/
All errors (new ones prefixed by >>):
/usr/bin/ld: warning: .tmp_vmlinux1 has a LOAD segment with RWX permissions
/usr/bin/ld: net/core/request_sock.o: in function `reqsk_fastopen_remove':
>> include/net/request_sock.h:137:(.ltext+0x103): undefined reference to `__reqsk_free'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
vim +137 include/net/request_sock.h
9403cf23025880 Guillaume Nault 2019-03-19 133
1e2e01172fd11b Eric Dumazet 2015-03-12 134 static inline void reqsk_put(struct request_sock *req)
1e2e01172fd11b Eric Dumazet 2015-03-12 135 {
41c6d650f6537e Reshetova, Elena 2017-06-30 136 if (refcount_dec_and_test(&req->rsk_refcnt))
c34506406dd5cf Eric Dumazet 2024-06-05 @137 __reqsk_free(req);
1e2e01172fd11b Eric Dumazet 2015-03-12 138 }
1e2e01172fd11b Eric Dumazet 2015-03-12 139
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp: move __reqsk_free() out of line
2026-02-01 0:18 ` kernel test robot
@ 2026-02-01 8:17 ` Eric Dumazet
0 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2026-02-01 8:17 UTC (permalink / raw)
To: kernel test robot
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, llvm,
oe-kbuild-all, Simon Horman, Neal Cardwell, Kuniyuki Iwashima,
netdev, eric.dumazet
On Sun, Feb 1, 2026 at 1:18 AM kernel test robot <lkp@intel.com> wrote:
>
> Hi Eric,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on net-next/main]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/tcp-move-__reqsk_free-out-of-line/20260201-011758
> base: net-next/main
> patch link: https://lore.kernel.org/r/20260131171627.1852894-1-edumazet%40google.com
> patch subject: [PATCH net-next] tcp: move __reqsk_free() out of line
> config: um-randconfig-001-20260201 (https://download.01.org/0day-ci/archive/20260201/202602010830.7VDNDITy-lkp@intel.com/config)
> compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260201/202602010830.7VDNDITy-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202602010830.7VDNDITy-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> /usr/bin/ld: warning: .tmp_vmlinux1 has a LOAD segment with RWX permissions
> /usr/bin/ld: net/core/request_sock.o: in function `reqsk_fastopen_remove':
> >> include/net/request_sock.h:137:(.ltext+0x103): undefined reference to `__reqsk_free'
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>
>
> vim +137 include/net/request_sock.h
>
> 9403cf23025880 Guillaume Nault 2019-03-19 133
> 1e2e01172fd11b Eric Dumazet 2015-03-12 134 static inline void reqsk_put(struct request_sock *req)
> 1e2e01172fd11b Eric Dumazet 2015-03-12 135 {
> 41c6d650f6537e Reshetova, Elena 2017-06-30 136 if (refcount_dec_and_test(&req->rsk_refcnt))
> c34506406dd5cf Eric Dumazet 2024-06-05 @137 __reqsk_free(req);
> 1e2e01172fd11b Eric Dumazet 2015-03-12 138 }
> 1e2e01172fd11b Eric Dumazet 2015-03-12 139
>
Great, time to get rid of net/core/request_sock.c
I will send in V2 a series with these 3 patches before moving
__reqsk_free out of line.
commit a79b5cb06e365dc8d3e1fb4872ec861266306c14
Author: Eric Dumazet <edumazet@google.com>
Date: Sun Feb 1 08:12:11 2026 +0000
net: get rid of net/core/request_sock.c
After DCCP removal, this file was not needed any more.
Signed-off-by: Eric Dumazet <edumazet@google.com>
commit 58ab84ff63932e13f1c59aa45493333c04e6f4df
Author: Eric Dumazet <edumazet@google.com>
Date: Sun Feb 1 08:08:40 2026 +0000
tcp: move reqsk_fastopen_remove to net/ipv4/tcp_fastopen.c
This function belongs to TCP stack, not to net/core/request_sock.c
We get rid of the now empty request_sock.c n the following patch.
Signed-off-by: Eric Dumazet <edumazet@google.com>
commit 1718fc81eb4742c1eab842852e600b906a08fded
Author: Eric Dumazet <edumazet@google.com>
Date: Sun Feb 1 08:00:42 2026 +0000
inet: move reqsk_queue_alloc() to net/ipv4/inet_connection_sock.c
Only called once from inet_csk_listen_start(), it can be static.
Signed-off-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-01 8:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-31 17:16 [PATCH net-next] tcp: move __reqsk_free() out of line Eric Dumazet
2026-02-01 0:07 ` kernel test robot
2026-02-01 0:18 ` kernel test robot
2026-02-01 8:17 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox