All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com,
	Soheil Hassas Yeganeh <soheil@google.com>,
	Eric Dumazet <edumazet@google.com>
Subject: [PATCH v2 net-next 0/4] net: core: use a dedicated kmem_cache for skb head allocs
Date: Mon,  6 Feb 2023 17:30:59 +0000	[thread overview]
Message-ID: <20230206173103.2617121-1-edumazet@google.com> (raw)

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(-)

-- 
2.39.1.519.gcb327c4b5f-goog


             reply	other threads:[~2023-02-06 17:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 17:30 Eric Dumazet [this message]
2023-02-06 17:31 ` [PATCH v2 net-next 1/4] net: add SKB_HEAD_ALIGN() helper Eric Dumazet
2023-02-06 17:31 ` [PATCH v2 net-next 2/4] net: remove osize variable in __alloc_skb() Eric Dumazet
2023-02-06 17:31 ` [PATCH v2 net-next 3/4] net: factorize code in kmalloc_reserve() Eric Dumazet
2023-02-06 17:31 ` [PATCH v2 net-next 4/4] net: add dedicated kmem_cache for typical/small skb->head Eric Dumazet
2023-02-08  8:37   ` kernel test robot
2023-02-08 13:38     ` Eric Dumazet
2023-02-07 16:58 ` [PATCH v2 net-next 0/4] net: core: use a dedicated kmem_cache for skb head allocs Alexander H Duyck
2023-02-08  0:20 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230206173103.2617121-1-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=soheil@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.