Re: [PATCH net-next] net: inline napi_skb_cache_get()

From
Paolo Abeni <pabeni@redhat.com>
Date
2026-01-15 11:29:53
Reply to
Eric Dumazet, 2026-01-12
On 1/12/26 2:15 PM, Eric Dumazet wrote:
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 <redacted>
Not blocking this patch, but I'm wondering if we should consider
defining an 'inline_for_performance' macro for both documentation
purpose and to allow no inline for size-sensitive build.

Paolo
Thread (4 messages) 4 messages, 3 authors, last reply 2026-01-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help