[PATCH slab/for-next v2 05/14] net: skbuff: specify SLAB_MAY_ACCOUNT for skbuff_head_cache
Hao Li
hao.li at linux.dev
Thu Dec 3 14:49:32 UTC 2026
On Wed, Nov 25, 2026 at 09:37:06PM +0000, Harry Yoo (Meta) wrote:
> 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)
>
> Cc: "David S. Miller" <davem at davemloft.net>
> Cc: Eric Dumazet <edumazet at google.com>
> Cc: Jakub Kicinski <kuba at kernel.org>
> Cc: Paolo Abeni <pabeni at redhat.com>
> Cc: Simon Horman <horms at kernel.org>
> Cc: Jason Xing <kerneljasonxing at gmail.com>
> Cc: Willem de Bruijn <willemb at google.com>
> Cc: Mina Almasry <almasrymina at google.com>
> Cc: "Björn Töpel" <bjorn at kernel.org>
> Cc: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
> Cc: Jiayuan Chen <jiayuan.chen at linux.dev>
> Cc: netdev at vger.kernel.org
> Acked-by: Jakub Kicinski <kuba at kernel.org>
> Signed-off-by: Harry Yoo (Meta) <harry at kernel.org>
> ---
> net/core/skbuff.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Looks good to me.
Reviewed-by: Hao Li <hao.li at linux.dev>
--
Thanks,
Hao
More information about the Linux-security-module-archive
mailing list