Article View: linux.kernel.netdev
Article #5982[PATCH slab/for-next 05/14] net: skbuff: specify SLAB_MAY_ACCOUNT for skbuff_head_cache
From: "Harry Yoo (Meta)"
Date: Wed, 21 Oct 2026 11:46
Date: Wed, 21 Oct 2026 11:46
44 lines
9964 bytes
9964 bytes
AF_UNIX sets sk->sk_allocation to GFP_KERNEL_ACCOUNT, so skbs can be allocated from skbuff_head_cache with __GFP_ACCOUNT. Specify SLAB_MAY_ACCOUNT when the object may be charged to a memcg. __GFP_ACCOUNT without SLAB_MAY_ACCOUNT will not be allowed. Path: unix_dgram_sendmsg() -> sock_alloc_send_pskb(sk->sk_allocation) -> alloc_skb_with_frags() -> __alloc_skb() -> kmem_cache_alloc_node(skbuff_head_cache) Assisted-by: LLM 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> Cc: Simon Horman <horms@kernel.org> Cc: Jason Xing <kerneljasonxing@gmail.com> Cc: Willem de Bruijn <willemb@google.com> Cc: Mina Almasry <almasrymina@google.com> Cc: "Björn Töpel" <bjorn@kernel.org> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Jiayuan Chen <jiayuan.chen@linux.dev> Cc: netdev@vger.kernel.org Signed-off-by: Harry Yoo (Meta) <harry@kernel.org> --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 966af3beed94..34ebbaf04fc7 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -5213,7 +5213,7 @@ void __init skb_init(void) sizeof(struct sk_buff), 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC| - FLAG_SKB_NO_MERGE, + SLAB_MAY_ACCOUNT|FLAG_SKB_NO_MERGE, offsetof(struct sk_buff, cb), sizeof_field(struct sk_buff, cb), NULL); -- 2.54.0
Technical Details
Message-ID:
<20261021-memalloc-prof-dont-waste-slabobj-ext-metadata-v1-5-096800aa3330@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349985-linux-kernel-netdev=dewy.ruReferences:
<20261021-memalloc-prof-dont-waste-slabobj-ext-metadata-v1-0-096800aa3330@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349985-linux-kernel-netdev=dewy.ru
From: harry@kernel.org ("Harry Yoo (Meta)")
Newsgroups: linux.kernel.netdev
Subject: [PATCH slab/for-next 05/14] net: skbuff: specify SLAB_MAY_ACCOUNT
for skbuff_head_cache
Date: Wed, 21 Oct 2026 12:46:46 +0100
Organization: Usenet Network
Message-ID: <20261021-memalloc-prof-dont-waste-slabobj-ext-metadata-v1-5-096800aa3330@kernel.org>
References: <20261021-memalloc-prof-dont-waste-slabobj-ext-metadata-v1-0-096800aa3330@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="4130194"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:4xliXngBxt7ENDXlDQZIGc2Fjrg= sha256:6gB27vx3q51bHREsjNoRvVHLesgHj2JpsqI7AV7eKNU=
sha1:IQ8bIYPXFl+xEILMP7iPxy7Kcvo= sha256:jJvA89GS+E4uA0A29r9TwnscMN3bqx1F2P0JWYeT7zg=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 57490110FCC; Wed, 21 Oct 2026 14:56:05 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id oV5Xlh-_oYyc;
Wed, 21 Oct 2026 14:56:02 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349985-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 6837B110FAA; Wed, 21 Oct 2026 14:55:52 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id D4F7E80A96; Wed, 21 Oct 2026 11:48:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1792583268;
b=yezijPZEFZt4OMXj4h5O5fC0OW+Ybk2AYjJSyCjscmvpP3CjvlrI4OZ7PEUikHxnDq18
odsUNvKucVd1o6o/MdRit8lo6lPygeqeiKMOSi9lriqRrdBTkvh+bxdMenCs+wTONLkeE
mTXTnhw9UDfgH0aTdWBTOY1FfzhTfuW0JdxY7lJT2GohVzxrJPTVpUiGbTfA0eDsJsW07
1CFgeGtzb9ARKy1iiAdDsnFckrzPHCvrEuuBHhhbVmzYQ33W120GUQt4YkzDYQRIiLIsu
cwkHOgsEW1VrWdAHWe1cmXY+mP2fdrYY2VW5x4huNEhvYWwZCjq5RYrYoUTWoomoVyQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792583268;
h=X-Original-To:Received:Received:DKIM-Signature:From:Date:Subject:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc:
X-Mailer;
bh=ko/uOWW9MmVDlyLdxGJWgtr/ksS4XAjHrpz+xNjK37M=;
b=2JLV2B7tw/sF7HUKn5M6H0KJGP4waJ09kwO5Ronthb0t5AXInPhBGM/WRIMyC2vmAxSz
UeIG7Zl/5v6GoGXvnsh2NpcT32b7Ao5utTsKM58XMQAm1HMbrqG0FTNkLLSLY23qa+tfe
16g5lhv503+oYNMJkoNanT3y9OlgjdPS1QwWrqFkacXIcs+5ElxWzU6K2AuoZL9JfFqoh
Su5SPa3vPiG8pgON2EblHiUkSnF1tQvz8DMZnZp3PbC5wy0AjMjZDsFTTotPe0GLr+uID
/N0cVgH41IlysMnlEl6Be/zFUy2rweyOXxiUu59PtB+HTDAeh9Pmm3TXWsvJXQrJ0Fg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ER9CSkf+;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 8521860A2607;
Wed, 21 Oct 2026 11:47:48 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ER9CSkf+
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792583262;
b=OLzMEfVG/Rejr6iPuTqgwZDXfQwkJ7NJ5S63nI3uVTJslC6Gqfeg4lpwH4hkWyrYS//t
s296o15bgsqLs6n2Bc6o0xeif8CcyE8/5wmz559tyG+Vrat9q6wa1LuNWiCH63c0eOGWF
lEbfKqSQJYAivwQ/2E1O4gJva7FhBrKR+W6EIIrBsJir9QBOLWm3UjKAEAbXq9mEPkSgi
NSyUzMBhNmuNwyI14RJcoGLUEndPKQnU+8NouM6vYJ9/IOkf2VdIIY0TLmjMLWrMLILbO
zQFFGsaJn4Id1lFtBEq4qRZ/+g9+iJ1/b/2yGxHqjhtXS7bzlYPsdHxZLKI0MPVacKg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792583262;
h=Received:DKIM-Signature:From:Date:Subject:MIME-Version:Content-Type:
Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc:
X-Mailer;
bh=ko/uOWW9MmVDlyLdxGJWgtr/ksS4XAjHrpz+xNjK37M=;
b=0ShZMM8blsMrh4HdbmAgiToE1u29Hn1dkKl+UHVV9YZS1QRWcYb2HSm8GtdkVNK8MFXl
i3WM9MKaeknoSrGddldmtEEc2wL918DT6uje/pIu+yPRyr1fYNFV0PCQoqpKAj8u5pNKe
EZ57fQry2c6SXl165no9t0GoRHGTAp9AgDOghJ6zv3yYsHGsLv3ZwLgvli1PHDCuNcI7W
pwHulU6iPXlWuwMnxFJKuKd8r6LC7Mv6ksdYT4Nqxb3wLt3sMgsVsjH2xXJYNvVOoRmzx
voVoBOXQq0EjqkGiUpiUxgxzXZBR9GNiuRRomrsmgI8J6WmUs7RYPkODraP4jRGXMaQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ER9CSkf+;
arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED22D60A2611;
Wed, 21 Oct 2026 11:47:41 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85E051F000C6;
Wed, 21 Oct 2026 11:47:37 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1792583261;
bh=ko/uOWW9MmVDlyLdxGJWgtr/ksS4XAjHrpz+xNjK37M=;
h=From:Date:Subject:References:In-Reply-To:To:Cc;
b=ER9CSkf+A5Vu8PQAVZYvXDfMfptAvyV2alH2rkS0jPl0vXqowyTHG01tf/DX1Zo+V
RAKWvHyE8bi0yWDTE2/+wB9lWEHhYwd3DypUKdNADqC8PX6TRpaxLAMJS7R2VofTud
G01klTdk3Yxe0aiws3DBE97AIR6LeNpoeY+5tfr20hxJ3nzZIOBdewXHTMXNOX7wfp
Z+BwSD40lJ891nYzcdORZl47QWDeaPN2cmxJTuWI5Q3l6NodgV8Z7VGpusEHEEHtF7
37ZQ4ONsmkm0o8paXV25QXRVmMgMcWHHcsqDB+U6oR5dobE7ZzAxFmXQxfa0tfKnNw
Xq1vtwpJAaAMA==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261021-memalloc-prof-dont-waste-slabobj-ext-metadata-v1-0-096800aa3330@kernel.org>
X-Cc: Hao Li <hao.li@linux.dev>, Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>, Muchun Song <muchun.song@linux.dev>,
Hao Ge <hao.ge@linux.dev>, Pedro Falcato <pfalcato@suse.de>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com,
"Harry Yoo (Meta)" <harry@kernel.org>,
"David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Jason Xing <kerneljasonxing@gmail.com>,
Willem de Bruijn <willemb@google.com>,
Mina Almasry <almasrymina@google.com>,
Björn Töpel <bjorn@kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Jiayuan Chen <jiayuan.chen@linux.dev>, netdev@vger.kernel.org
X-Mailer: b4 0.16.0