Skip to content

net: core: use a dedicated kmem_cache for skb head allocs

Eric Dumazet netdev oe-lkp 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 2 repliesApplied 4/4
  2. v14 patches 11 repliesSuperseded

Patches in v2 All 4 applied

#Subject and filesSizeRepliesApplied
1/4net: add SKB_HEAD_ALIGN() helperinclude/linux/skbuff.h net/core/skbuff.c+14 -120 repliesApplied
2/4net: remove osize variable in __alloc_skb()net/core/skbuff.c+4 -60 repliesApplied
3/4net: factorize code in kmalloc_reserve()net/core/skbuff.c+11 -160 repliesApplied
4/4net: add dedicated kmem_cache for typical/small skb->headnet/core/skbuff.c+67 -51 replyApplied

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSoheil Hassas YeganehAlexander Duyck
SeriesR-b
1/4A-b
2/4A-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 net-next 0/4] net: core: use a dedicated kmem_cache for skb head allocs

Our profile data show that using kmalloc(non_const_size)/kfree(ptr) has a certain cost, because kfree(ptr) has to pull a 'struct page' in cpu caches.

Using a dedicated kmem_cache for TCP skb->head allocations makes a difference, both in cpu cycles and memory savings.

This kmem_cache could also be used for GRO skb allocations, this is left as a future exercise.

v2: addressed compile error with CONFIG_SLOB=y (kernel bots)
Changed comment (Jakub)

Eric Dumazet (4):
net: add SKB_HEAD_ALIGN() helper
net: remove osize variable in __alloc_skb()
net: factorize code in kmalloc_reserve()
net: add dedicated kmem_cache for typical/small skb->head

 include/linux/skbuff.h |   8 +++
 net/core/skbuff.c      | 115 +++++++++++++++++++++++++++++------------
 2 files changed, 90 insertions(+), 33 deletions(-)
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog