Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: inline napi_skb_cache_get()

clang is inlining it already, gcc (14.2) does not.

Small space cost (215 bytes on x86_64) but faster sk_buff allocations.

$ scripts/bloat-o-meter -t net/core/skbuff.gcc.before.o net/core/skbuff.gcc.after.o
add/remove: 0/1 grow/shrink: 4/1 up/down: 359/-144 (215)
Function old new delta
__alloc_skb 471 611 +140
napi_build_skb 245 363 +118
napi_alloc_skb 331 416 +85
skb_copy_ubufs 1869 1885 +16
skb_shift 1445 1413 -32
napi_skb_cache_get 112 - -112
Total: Before=59941, After=60156, chg +0.36%

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260112131515.4051589-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Eric Dumazet and committed by
Paolo Abeni
d4596891 d281dff9

+1 -1
+1 -1
net/core/skbuff.c
··· 280 280 */ 281 281 static u32 skbuff_cache_size __read_mostly; 282 282 283 - static struct sk_buff *napi_skb_cache_get(bool alloc) 283 + static inline struct sk_buff *napi_skb_cache_get(bool alloc) 284 284 { 285 285 struct napi_alloc_cache *nc = this_cpu_ptr(&napi_alloc_cache); 286 286 struct sk_buff *skb;