]> git.baikalelectronics.ru Git - kernel.git/commit
net: minor optimization in __alloc_skb()
authorEric Dumazet <edumazet@google.com>
Thu, 7 Jul 2022 19:18:46 +0000 (19:18 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Jul 2022 13:21:08 +0000 (14:21 +0100)
commit5d48e4643f0b49b018e0c6911f990dbc19aabfc8
treeca262868da3fc1e3880a78ec3efc9beaa7522810
parenteeef83f8b736222645c4e8edad3e071474743963
net: minor optimization in __alloc_skb()

TCP allocates 'fast clones' skbs for packets in tx queues.

Currently, __alloc_skb() initializes the companion fclone
field to SKB_FCLONE_CLONE, and leaves other fields untouched.

It makes sense to defer this init much later in skb_clone(),
because all fclone fields are copied and hot in cpu caches
at that time.

This removes one cache line miss in __alloc_skb(), cost seen
on an host with 256 cpus all competing on memory accesses.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c