🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6076

Re: [PATCH net] net: shrink the payload-only part of skb dataref to one bit

#6076
From: Eric Dumazet
Date: Wed, 21 Oct 2026 15:59
40 lines
10477 bytes
Le mer. 21 oct. 2026 à 17:21, <netdev-bot+sashiko@kernel.org> a écrit :
>
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 1
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [Medium] The patch raises the wrap point of the shared-head reference
>   count from 2^16 to 2^30, but it adds no bound or saturation.
> - [Low] After the patch, the 'DOC: dataref and headerless skbs' block in
>   include/linux/skbuff.h contradicts itself.

Clones queued by packet_rcv() are charged to the receiving socket with
skb_set_owner_r(), after the sk_rmem_alloc vs sk_rcvbuf check.
Each socket can therefore hold only a bounded number of clones.
Reaching 2^30 clones would need a huge number of sockets
plus hundreds of GB of memory, outside of any reasonable memcg setup.

It took 20 years for someone to reach 2^16 clones. 2^30 is far beyond
practical reach, and I do not want to add a check in the clone fast path for it.

Instead we plan (in net-nex) to limit the number of AF_PACKET sockets
per netns or per device,
since a large number of taps already causes soft lockups in the data path.
We also plan similar limits for RAW sockets per netns and for UDP
multicast receivers.
These will bound clone fan-out at the source.

The DOC comment nit can be addressed in a net-next cleanup.
Technical Details
Message-ID: <CAL4Wiiq+++igFUEuWjznMZYDshBEocD8+JnGx0c2NU9GwBsqYw@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350105-linux-kernel-netdev=dewy.ru
References: <20261020151954.22953-1-edumazet@kernel.org> <179259610296.3135.5083998587535514838@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-350105-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net: shrink the payload-only part of skb dataref to
 one bit
Date: Wed, 21 Oct 2026 17:59:10 +0200
Organization: Usenet Network
Message-ID: <CAL4Wiiq+++igFUEuWjznMZYDshBEocD8+JnGx0c2NU9GwBsqYw@mail.gmail.com>
References: <20261020151954.22953-1-edumazet@kernel.org> <179259610296.3135.5083998587535514838@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="4191875"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:AmTRtwRSDV8YHtrPXSqhbsVEJD0= sha256:eCKma5PfUvEAYhCEaExayka5Q+P+OQN2cV9V9r4bnXc=
	sha1:Vhmkib67ixJbSwOezMhfG+XIPNs= sha256:DXl1WT77mEX9WJvlfhL7TUuSfoWf+DU6LSy7MVUu98o=
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 5CA77111074; Wed, 21 Oct 2026 19:06:31 +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 kkTEXzF8i9jB;
	Wed, 21 Oct 2026 19:06:28 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-350105-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 79833111047; Wed, 21 Oct 2026 19:06:13 +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 293F133488; Wed, 21 Oct 2026 15:59:31 +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=1792598369;
	b=ZRa9rT9yyQBRo0HuWL+qaBejWOmbx3Sdf6kq5Mq0ALrSXJa0Ev97NJKrPzvD1q0EDvgj
	 3ltrG0cvfEHpROVuuVj7nS+1J++bA0gELD6/3jUc+JWqbrlHlAObN17EnHm/yVYiySJw8
	 5T5XJtjODsysxeLEl+5jFAkRXzU/vXQwzVMddx46TrdNL0Ms5ToWWU1gl0IHZUoF8U4Vg
	 9U+DhQaPacyxYEHh11jB3QhKyRdAe/kYwi9t0tKYIJ8Yn3Tb3Zf41e3iXQOU+RPWq1w4o
	 KIkLurHdJDBoQN4hAVN9n4n7T4Ks7lR0bz+3Ic1oYe0/ipS0NMS12YNMQIRh3tk7Eaw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792598369;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:References:In-Reply-To:From:Date:
	 X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type:Content-Transfer-Encoding;
	bh=2BQn0eKB89bn2AsAmi6ydE5TlLgCqTpsqvIon7kf9sM=;
	b=UykDI8zW1CypuKzq5/aV3fIoHjIfuVuG1Ck6A0U1Hd6KwhRx9cy+4jJmmTD84L4b8VHY
	 YBFoQyUcLYr/lOWEvKrL21tadctsKVdr4XHx6VBw/NwAWTgGJkFRGi0xAiVnhPy6lbsTI
	 ZAj55NBq0BiOtJ2JI+6+w3qM71WoMzPaJSg/Zvv4Z96Noq/k8uMv5U49vtzcdLyPbJ4wP
	 biS4YGTY5LdYsnHGa8/SxFLvZ398HB1Vsx1yxdFdWkEUvK8XHCPLRP6GMNpksyaKwAnyx
	 ZZgFcTSRdKuTmTk+k/aC4T+pGXDwPTSEvSNdlItCP80jdykHPxV0lNsJaAnrXkIpk/w==
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=WTqe5o9z;
	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 F00C6606A325;
	Wed, 21 Oct 2026 15:59:28 +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=WTqe5o9z
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=1792598368;
	b=u9Nk6U/P5r/Y7/PMUfOUvZTJhFRXf6+s+Rz4e4TV8a75yEjG854wI5wPR8VFvRVUy+XK
	 MQqcNhwiJ6hJLI+DwuEx7sY3uhrK98KDeXSmemIl6l8n7iVYXskR1jpqm2koZJEsp9PYr
	 2Knov5sr79Y6+qOn4EBNEJuIqz2Eg4XbnebDurR9xAm1pdF2YEFqvG06HCSiMBfyz1nnI
	 afSDIVBMtFbr9DfD6FdtySzRhuytkEZjz4qlpXJYIN/eJhrcKnFEN/f0n+jxZYN3+gmoq
	 9yqVJK0seGWGGyOWgmueYoIjxqgC2RfvbbF7GDfNSR1T6BJ+b6/vBsultGeLw4Pgp/Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792598368;
	h=Received:DKIM-Signature:Received:X-Forwarded-Encrypted:
	 X-Gm-Message-State:X-Received:MIME-Version:References:In-Reply-To:
	 From:Date:X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:
	 Subject:To:Cc:Content-Type:Content-Transfer-Encoding;
	bh=2BQn0eKB89bn2AsAmi6ydE5TlLgCqTpsqvIon7kf9sM=;
	b=j0klVFbmxLyTPS64PWIfDsPJD4NxXt59qNhgCpW9NxRXjJxpgBf6U0+mQPB/Gm7xuC0H
	 4d0diNVyx8j3Fi+6DaI5FJKG3wE0ETSSItkMEiZnsPkzn34+LNxpkM42DirLkj0f9AMkL
	 9WgIb202FJMxcjzqAbkl5MUCpWXodPa6oyWI2PeaxSCgXBKiP5a2cuDilrOroJbx2OnSc
	 ainPnaKgb/SseFSN6PYBXew8SgVGoEXK1koCkjNDFt4O4kaeVBMI2EPHF4B7w16X+jmdt
	 8hE8gN13xFBmnyn/4HlnOTlD2WdHy0TpzallvU8OOTy9lEkKNYMdDwpZIMX7qFlxFfQ==
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=WTqe5o9z;
	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 D4CE2606A324
	for <netdev@vger.kernel.org>; Wed, 21 Oct 2026 15:59:27 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65BCB1F000C3
	for <netdev@vger.kernel.org>; Wed, 21 Oct 2026 15:59:27 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792598367;
	bh=2BQn0eKB89bn2AsAmi6ydE5TlLgCqTpsqvIon7kf9sM=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=WTqe5o9z2SHw07GfrJdOTLni4EGp8lhLF6A3hbDk0E+hJdTTh4kqPSvRw+rRr0Hgx
	 PTNbWzUz4dBi4oLwhL4aMrkAnzyMtAjkwD4sliBIiCj52f7wxwHB9C34jYCdqnC9OW
	 k4njKCkWBiUZFija6iNKWNUQFuJE9Fa5stzuyMM4TInmRYYgu3WY3I5O8GkKZhSWH1
	 4ZNakoxlUS//niTskKIakPxEe34xcKpZDKHSTwE1+OcvAT8xQ/+SDmlGrjR/lgvgTC
	 AgwIKYfv2Z9OQFQbQts2VTJvPpqDY6Xb15SRZIEIdWK1zCNntGuzH+JrauS19K/tXl
	 OgxhzhDBOgMZA==
X-Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5bfa686881fso48253e87.2
        for <netdev@vger.kernel.org>; Wed, 21 Oct 2026 08:59:27 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AKwUvBzbzRYnhWZgWQvYlYkmrlR1nqfqOvnKvXMSJ64NcppDEcfR0Nh8GpU/Oow3kabHevne2iX+i7A=@vger.kernel.org
X-Gm-Message-State: AFq9FYIhTZm5lT2HpZGIgUT92HS0TsyZhAcm6WMEQP6GVYfozuZBPSdv
	oZElBs1Dxqf5n9QwRPZSsjDUrnN4O1d/79qJO46t3q9njqkWdKlCgvgawl6GesrW9UIaHrAOUYG
	X+5zJf/i3MCmbE2sCPi72BpkD18rGzWg=
X-Received: by 2002:a05:6512:1152:b0:5bf:a4e5:7266 with SMTP id
 2adb3069b0e04-5bfa4e573b5mr233787e87.41.1792598366157; Wed, 21 Oct 2026
 08:59:26 -0700 (PDT)
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: <179259610296.3135.5083998587535514838@kernel.org>
X-Gmail-Original-Message-ID: <CAL4Wiiq+++igFUEuWjznMZYDshBEocD8+JnGx0c2NU9GwBsqYw@mail.gmail.com>
X-Gm-Features: AclHuK8-17ZnhwZ3KUYwYg6zpdPE1zaadxvyZrxcLPZHmjKLsHV6_wP9UQsvEMk
X-Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, 
	netdev@vger.kernel.org, Stephan@adalogics.com