All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Christoph Lameter <cl@linux.com>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Pekka Enberg <penberg@kernel.org>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, rcu@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@lists.linux.dev, netdev@vger.kernel.org,
	linux-doc@vger.kernel.org, Vlastimil Babka <vbabka@suse.cz>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: [PATCH 2/7] net: skbuff: remove SLOB-specific ifdefs
Date: Fri, 10 Mar 2023 11:32:04 +0100	[thread overview]
Message-ID: <20230310103210.22372-3-vbabka@suse.cz> (raw)
In-Reply-To: <20230310103210.22372-1-vbabka@suse.cz>

As the comment for HAVE_SKB_SMALL_HEAD_CACHE says:

> skb_small_head_cache and related code is only supported
> for CONFIG_SLAB and CONFIG_SLUB.
> As soon as SLOB is removed from the kernel, we can clean up this.

With CONFIG_SLOB removed, remove HAVE_SKB_SMALL_HEAD_CACHE and make all
code that it guards unconditional.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
---
 net/core/skbuff.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index eb7d33b41e71..8bba4e91d0d5 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -90,15 +90,6 @@ static struct kmem_cache *skbuff_fclone_cache __ro_after_init;
 static struct kmem_cache *skbuff_ext_cache __ro_after_init;
 #endif
 
-/* skb_small_head_cache and related code is only supported
- * for CONFIG_SLAB and CONFIG_SLUB.
- * As soon as SLOB is removed from the kernel, we can clean up this.
- */
-#if !defined(CONFIG_SLOB)
-# define HAVE_SKB_SMALL_HEAD_CACHE 1
-#endif
-
-#ifdef HAVE_SKB_SMALL_HEAD_CACHE
 static struct kmem_cache *skb_small_head_cache __ro_after_init;
 
 #define SKB_SMALL_HEAD_SIZE SKB_HEAD_ALIGN(MAX_TCP_HEADER)
@@ -115,7 +106,6 @@ static struct kmem_cache *skb_small_head_cache __ro_after_init;
 
 #define SKB_SMALL_HEAD_HEADROOM						\
 	SKB_WITH_OVERHEAD(SKB_SMALL_HEAD_CACHE_SIZE)
-#endif /* HAVE_SKB_SMALL_HEAD_CACHE */
 
 int sysctl_max_skb_frags __read_mostly = MAX_SKB_FRAGS;
 EXPORT_SYMBOL(sysctl_max_skb_frags);
@@ -514,7 +504,6 @@ static void *kmalloc_reserve(unsigned int *size, gfp_t flags, int node,
 	void *obj;
 
 	obj_size = SKB_HEAD_ALIGN(*size);
-#ifdef HAVE_SKB_SMALL_HEAD_CACHE
 	if (obj_size <= SKB_SMALL_HEAD_CACHE_SIZE &&
 	    !(flags & KMALLOC_NOT_NORMAL_BITS)) {
 
@@ -530,7 +519,6 @@ static void *kmalloc_reserve(unsigned int *size, gfp_t flags, int node,
 			goto out;
 		}
 	}
-#endif
 	*size = obj_size = kmalloc_size_roundup(obj_size);
 	/*
 	 * Try a regular allocation, when that fails and we're not entitled
@@ -852,11 +840,9 @@ static bool skb_pp_recycle(struct sk_buff *skb, void *data)
 
 static void skb_kfree_head(void *head, unsigned int end_offset)
 {
-#ifdef HAVE_SKB_SMALL_HEAD_CACHE
 	if (end_offset == SKB_SMALL_HEAD_HEADROOM)
 		kmem_cache_free(skb_small_head_cache, head);
 	else
-#endif
 		kfree(head);
 }
 
@@ -4692,7 +4678,6 @@ void __init skb_init(void)
 						0,
 						SLAB_HWCACHE_ALIGN|SLAB_PANIC,
 						NULL);
-#ifdef HAVE_SKB_SMALL_HEAD_CACHE
 	/* usercopy should only access first SKB_SMALL_HEAD_HEADROOM bytes.
 	 * struct skb_shared_info is located at the end of skb->head,
 	 * and should not be copied to/from user.
@@ -4704,7 +4689,6 @@ void __init skb_init(void)
 						0,
 						SKB_SMALL_HEAD_HEADROOM,
 						NULL);
-#endif
 	skb_extensions_init();
 }
 
-- 
2.39.2


  parent reply	other threads:[~2023-03-10 10:32 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 10:32 [PATCH 0/7] remove SLOB and allow kfree() with kmem_cache_alloc() Vlastimil Babka
2023-03-10 10:32 ` [PATCH 1/7] mm/slob: remove CONFIG_SLOB Vlastimil Babka
2023-03-14  7:18   ` Hyeonggon Yoo
2023-03-14 22:11   ` Lorenzo Stoakes
2023-03-10 10:32 ` Vlastimil Babka [this message]
2023-03-10 10:32 ` [PATCH 3/7] mm, page_flags: remove PG_slob_free Vlastimil Babka
2023-03-14  7:25   ` Hyeonggon Yoo
2023-03-14 22:12   ` Lorenzo Stoakes
2023-03-10 10:32 ` [PATCH 4/7] mm, pagemap: remove SLOB and SLQB from comments and documentation Vlastimil Babka
2023-03-14  8:19   ` Hyeonggon Yoo
2023-03-15 11:05     ` Vlastimil Babka
2023-03-14 22:16   ` Lorenzo Stoakes
2023-03-10 10:32 ` [PATCH 5/7] mm/slab: remove CONFIG_SLOB code from slab common code Vlastimil Babka
2023-03-14  9:28   ` Hyeonggon Yoo
2023-03-14 22:16     ` Lorenzo Stoakes
2023-03-10 10:32 ` [PATCH 6/7] mm/slob: remove slob.c Vlastimil Babka
2023-03-14  9:34   ` Hyeonggon Yoo
2023-03-14 22:18   ` Lorenzo Stoakes
2023-03-15  2:54   ` Roman Gushchin
2023-03-10 10:32 ` [PATCH 7/7] mm/slab: document kfree() as allowed for kmem_cache_alloc() objects Vlastimil Babka
2023-03-12  9:59   ` Mike Rapoport
2023-03-15 13:38     ` Vlastimil Babka
2023-03-15 14:50       ` Mike Rapoport
2023-03-11  1:00 ` [PATCH 0/7] remove SLOB and allow kfree() with kmem_cache_alloc() Jakub Kicinski
2023-03-12  9:51 ` Mike Rapoport
2023-03-13 16:31   ` Steven Rostedt
2023-03-13 18:00     ` Mike Rapoport
2023-03-15 13:53     ` Vlastimil Babka
2023-03-15 14:20       ` Steven Rostedt
2023-03-15 14:22         ` Vlastimil Babka
2023-03-13 16:36   ` Vlastimil Babka
2023-03-14 22:10     ` Lorenzo Stoakes
2023-03-15 13:40       ` Vlastimil Babka

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=20230310103210.22372-3-vbabka@suse.cz \
    --to=vbabka@suse.cz \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=patches@lists.linux.dev \
    --cc=penberg@kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    /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.