Message ID | 20230206173103.2617121-1-edumazet@google.com (mailing list archive) |
---|---|
Headers | show |
Series | net: core: use a dedicated kmem_cache for skb head allocs | expand |
On Mon, 2023-02-06 at 17:30 +0000, Eric Dumazet wrote: > 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(-) > Looks good to me. Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Hello: This series was applied to netdev/net-next.git (master) by Jakub Kicinski <kuba@kernel.org>: On Mon, 6 Feb 2023 17:30:59 +0000 you wrote: > 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. > > [...] Here is the summary with links: - [v2,net-next,1/4] net: add SKB_HEAD_ALIGN() helper https://git.kernel.org/netdev/net-next/c/115f1a5c42bd - [v2,net-next,2/4] net: remove osize variable in __alloc_skb() https://git.kernel.org/netdev/net-next/c/65998d2bf857 - [v2,net-next,3/4] net: factorize code in kmalloc_reserve() https://git.kernel.org/netdev/net-next/c/5c0e820cbbbe - [v2,net-next,4/4] net: add dedicated kmem_cache for typical/small skb->head https://git.kernel.org/netdev/net-next/c/bf9f1baa279f You are awesome, thank you!