netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Huang Shijie <shijie@os.amperecomputing.com>
To: kuba@kernel.org
Cc: patches@amperecomputing.com, davem@davemloft.net,
	horms@kernel.org, edumazet@google.com, ast@kernel.org,
	dhowells@redhat.com, linyunsheng@huawei.com,
	aleksander.lobakin@intel.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, cl@os.amperecomputing.com,
	Huang Shijie <shijie@os.amperecomputing.com>
Subject: [PATCH v2] net: skbuff: set FLAG_SKB_NO_MERGE for skbuff_fclone_cache
Date: Tue, 27 Feb 2024 14:28:33 +0800	[thread overview]
Message-ID: <20240227062833.7404-1-shijie@os.amperecomputing.com> (raw)
In-Reply-To: <CANn89iJoHDzfYfhcwVvR4m7DiVG-UfFNqm+D1WD-2wjOttk6ew@mail.gmail.com>

Since we do not set FLAG_SKB_NO_MERGE for skbuff_fclone_cache,
the current skbuff_fclone_cache maybe not really allocated, it maybe
used an exist old kmem_cache. In NUMA, the fclone allocated by
alloc_skb_fclone() maybe in remote node.

So set FLAG_SKB_NO_MERGE for skbuff_fclone_cache to fix it.

Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
---
v1 --> v2:
       set FLAG_SKB_NO_MERGE for skbuff_fclone_cache in initialization.

v1: https://lkml.org/lkml/2024/2/20/121	
---
 net/core/skbuff.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 1f918e602bc4..5e3e130fb57a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -5013,7 +5013,8 @@ void __init skb_init(void)
 	skbuff_fclone_cache = kmem_cache_create("skbuff_fclone_cache",
 						sizeof(struct sk_buff_fclones),
 						0,
-						SLAB_HWCACHE_ALIGN|SLAB_PANIC,
+						SLAB_HWCACHE_ALIGN|SLAB_PANIC|
+						FLAG_SKB_NO_MERGE,
 						NULL);
 	/* usercopy should only access first SKB_SMALL_HEAD_HEADROOM bytes.
 	 * struct skb_shared_info is located at the end of skb->head,
-- 
2.40.1


  parent reply	other threads:[~2024-02-27  6:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20  2:18 [PATCH] net: skbuff: allocate the fclone in the current NUMA node Huang Shijie
2024-02-20  5:32 ` Eric Dumazet
2024-02-20  6:26   ` Shijie Huang
2024-02-20  8:17     ` Eric Dumazet
2024-02-20  8:37       ` Shijie Huang
2024-02-24 19:07         ` Eric Dumazet
2024-02-26 10:18           ` Jesper Dangaard Brouer
2024-02-26 10:29             ` Eric Dumazet
2024-02-27  6:28   ` Huang Shijie [this message]
2024-02-27 12:55     ` [PATCH v2] net: skbuff: set FLAG_SKB_NO_MERGE for skbuff_fclone_cache Eric Dumazet
2024-02-27 13:15       ` Eric Dumazet
2024-02-28  7:05       ` Shijie Huang
2024-02-28  9:38         ` Eric Dumazet
2024-02-29 17:00         ` Christoph Lameter (Ampere)
2024-02-29 17:07           ` Eric Dumazet
2024-02-29 17:57             ` Christoph Lameter (Ampere)
2024-02-29 16:56     ` Christoph Lameter (Ampere)
2024-02-26 10:10 ` [PATCH] net: skbuff: allocate the fclone in the current NUMA node Alexander Lobakin
2024-02-27  6:30   ` Shijie Huang

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=20240227062833.7404-1-shijie@os.amperecomputing.com \
    --to=shijie@os.amperecomputing.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=ast@kernel.org \
    --cc=cl@os.amperecomputing.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linyunsheng@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=patches@amperecomputing.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).