🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21429

Re: [PATCH net v7] tun: bound the NAPI receive queue

#21429
From: Willem de Bruijn
Date: Tue, 24 Nov 2026 01:15
71 lines
13377 bytes
Antonio Quartulli wrote:
> 
> 
> On 22/11/2026 00:37, netdev-bot+sashiko@kernel.org wrote:
> > Thank you for your contribution! Sashiko AI review found 2 potential
> > issue(s) to consider.
> > 
> > Critical: 0 · High: 1 · Medium: 1 · Low: 0
> > 
> > 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).
> > 
> > - [High] Bounding the IFF_NAPI queue by packet count only
> >    (net_hotdata.max_backlog skbs per tun_file, ignoring size) does not…
> 
> 
> Right, and the commit message says so under "Still open": this bounds
> each queue the way enqueue_to_backlog() bounds the per-CPU backlog, but
> not the memory a user can queue. Closing that needs the queued skbs
> charged to the writer's memcg, which touches more allocation sites (one
> in vhost-net) and every tun user, so it will be a separate change.
> 
> 
> > - [Medium] The patch silently changes behaviour for IFF_NAPI users who
> >    set a finite send buffer with TUNSETSNDBUF, and the commit message…
> > 
> 
> True for a send buffer larger than about netdev_max_backlog packets:
> there the queue limit now drops before the writer would block on socket
> memory. With a smaller send buffer the writer still blocks first. A full
> queue dropping instead of pushing back is also what netif_rx() does for
> a full backlog, regardless of the send buffer, and blocking on the NAPI
> queue would need a wait/wake mechanism tun does not have.
> I'd rather
> keep the fix minimal; netdev_max_backlog tunes the limit and be done 
> with it.
> 
> 
> Given the above, I am not going to respin.

Agreed.
Technical Details
Message-ID: <willemdebruijn.kernel.19db5ff627b4e@gmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369912-linux-kernel-netdev=dewy.ru
References: <20261119153056.353156-1-antonio@mandelbit.com> <179530424233.3135.6226986969775563090@kernel.org> <c663141e-78bf-41cf-81d0-fdda6fcbca74@mandelbit.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369912-linux-kernel-netdev=dewy.ru
From: willemdebruijn.kernel@gmail.com (Willem de Bruijn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v7] tun: bound the NAPI receive queue
Date: Mon, 23 Nov 2026 20:15:57 -0500
Organization: Usenet Network
Message-ID: <willemdebruijn.kernel.19db5ff627b4e@gmail.com>
References: <20261119153056.353156-1-antonio@mandelbit.com>
 <179530424233.3135.6226986969775563090@kernel.org>
 <c663141e-78bf-41cf-81d0-fdda6fcbca74@mandelbit.com>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="4023952"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:o7ynOP2a35TEN1GQK2LzkSYeGME= sha256:Hd6Y1gb3134kZ2Mru7+WXalvGwKOvNR1a5MQ9HQWq0w=
	sha1:ml5QQpK8otnH+MXBFrZdDn3M5VI= sha256:C3RXHsNY2g4bHhPRdLemql9DfqgtCSzYvBv7y8+C6Rw=
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 227BB125DCA; Tue, 24 Nov 2026 04:16:16 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	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=gmail.com
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 SLo4W2Px5q5j;
	Tue, 24 Nov 2026 04:16:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-369912-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id A1FCE125DC9; Tue, 24 Nov 2026 04:16:04 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 6721C26163; Tue, 24 Nov 2026 01:16:03 +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=1795482960;
	b=wNbo62sENB8KDuM8rOCjkNx9A80gwuzgReKOFXOXvHD+tUpNPPqdIkR1vTZq9cKzCL5N
	 KOIZrcwwRbYOZTbBjZyt0apFKYvjedJBMo34O8QVjxih48E1yLjLW5IgMG868UHASStDB
	 ayNpB2aSPhtWxmTmZndFGz48rpDVd7tX7FrS8veFGjxWo+Ge/mOmZyG1bClMBXw5max/m
	 2uSXnIjTQYVGkCbGvxdjDSwqmiUJyxdV6iUqLXoJKVVct8WAPTWVom8SKnFr7XnQk2tcY
	 h4XYqDt1xT2bCNiJ26Mkq26TDMdjH+hM36bGmQ4J33rhlPdUllOKRc6SPH9f/JKQ79A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795482960;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:Date:From:To:Cc:Message-ID:In-Reply-To:
	 References:Subject:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Transfer-Encoding;
	bh=C6hzf2s6hKShPf7oAcRuMB0755YohpVsSX/WLyG5XrU=;
	b=LcCZO/ft/g2PSfpU+gpxE+enUlrpvrohFvgmgpVC+ODHgdbBeThTCoBjrUiYDjab/PhQ
	 mtblwNhskxscU/a6peGySnfpU7vCpAUdMUWG5x2/agv4tmOA7IuAOv2Xkz5RkiT+EYaO0
	 u/0//Qf0QTknTVd/YBBcMsNPHi9iti0VGqutueJqaQL5+vQz1zHvlhsCKdRrkFehPSgO3
	 C/j8OjedyH4cvyKBtW64BwR5Kz9u5g2dK4m5IzyZBQRMDUOsdJ1OUzL/dOTrQqlmkHVRZ
	 61fAajjFSh14Npkf95fDzekumfVGwGf17J8yn+NBzyE7uaVE1S7MtstAvCW6IogvZcw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=NzfeTj7P;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	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 7C883606A335;
	Tue, 24 Nov 2026 01:16:00 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=NzfeTj7P
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.47
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795482959;
	b=qKAA+2h17GGBuTVL/Z2poV0LBfbnvvGkLQa52I3boHxuJTg7GIr6BJfqzDnvCT1cWA2A
	 ZVGkHCq54FBgNPTR9EAVW+68YWvmhLh7xzwIWtyCyvHJQy0AZtaRVHRXCtsiOKF2VP58f
	 rX1nbOJSp2IG6xtgEIX2QUJM97Qvg1U+qUgRl3FGylE9Ov4NVzaT4XHd/LvJdrA2BxDUL
	 MdVoNpuG/46xYtrmvVpCpklqwyHkxXEiGkbpn84dHPa4yjQilf/T/1fisnZHT7vlgkqsW
	 y3r801B7QD+SAKEEqIh0wIVqOdwcEF9BnbVMJQFPPRclAXxoJqkFS1Shd7zKobmKaqA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795482959;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:
	 MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=C6hzf2s6hKShPf7oAcRuMB0755YohpVsSX/WLyG5XrU=;
	b=lbGVhqIs1HsiVqOuFdT0NVO2IYP0QoIjkzKMKKbx+xLYb3SGyaCVvkJNeUcyGbLP4TO8
	 6cLG/EpArQf7RyR5A0VLTZ58GMF0b9tmafaaTz4qch724EIhK7GT15PO2Kx0bQr8tocPi
	 atHammXlncMKcgYfYIHJziqTwoYSQYLQ1AFc2YO+Ve0SscOrYQqSNDjZkFZFaYD14lzE2
	 XOxG3rBeRXlPkUY+9yVnirRO+7ukU2tnn9eOJIoC+CVg7c7ZRXIRq7Y/ky/yzowdtlOA1
	 SCNTMSjtLEcwlQXCFelkTxHKDrZl939D6VqcwMGI0+v6tM+6qzqkAcLYp9Egz/55asA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=NzfeTj7P;
	arc=none smtp.remote-ip=209.85.219.47
X-Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39046606A321
	for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 01:15:59 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 39046606A321
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-91c1f548f87so55960216d6.2
        for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 17:15:59 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1795482958; x=1796087758; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:mime-version:subject
         :references:in-reply-to:message-id:cc:to:from:date:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=C6hzf2s6hKShPf7oAcRuMB0755YohpVsSX/WLyG5XrU=;
        b=NzfeTj7Pj5s2+Md8UTM6BYvGoT1rx5OWIoiyb/ayCzfqk+1jTTgngERRL32/PWRykd
         J6FbS185f/6H/TH5yEkoW2ub9IFSiqeoWBVGdrn77H1z6Z+41uuBGle0uiEER1ROD3ak
         y+0pzrLyn70PwKY4GUeR7joNEiUx53tzEVSz1cGx6q0syMwc2ylmXMY2FZiHHZ7fVJN5
         hiqTjYpQ2IYIL99JhsrIgLj0bekrQkeeGweeh54CtsBdq7WiPVKgg23oBkWaGjD+JLoI
         e8E1yGBJhpIGoPWPMMfJzCZsx/lMoQGDEktqdJK8UlwcEnQ0g8F/qBU2lQnX3Pm1xI39
         g5jA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795482958; x=1796087758;
        h=content-transfer-encoding:content-type:mime-version:subject
         :references:in-reply-to:message-id:cc:to:from:date:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=C6hzf2s6hKShPf7oAcRuMB0755YohpVsSX/WLyG5XrU=;
        b=pb0LSa6nv3M6BjvnoVfx6m/2UCvqjKYs+fV+2cEdSMc6BdgFXU44r+T3V6nF2tsHCp
         c4ej5KAeSZu06gAkFou2kKPsprKW2YuDqYVqM+/5XrVxKG9TiAkA7e2LxSEE8w41Lx8I
         mNA6SKB4GkFZBopaVNYdutctplNmL+gXYZLCeumLQJiqlnmWGo551bRhkCEr98RIIblK
         Uq466besjZ11DesWJEcek8rWYvPWIbOmcPUXO6FzBDG2HyAndVqg63TlhOT560K973eG
         EKX+AJE0j86ZUhzhfDAIS87rk889mpyIxS4jilUnOO5cFGT45mwfNrNO3e2xA7zA0/xR
         F4XA==
X-Forwarded-Encrypted: i=1; AL+hErHCi8LBVHdNH00DLAaQPaDQaN6QrZ52CpblphTVljMwmR8dLEp9IC83i2/P8WXYWC91V4CFbH4=@vger.kernel.org
X-Gm-Message-State: APuU4Z8B1dXp9mMOOFZBr6wX9bnjyyZChW0ka77l/Ma6lp5q53hxLkEp
	j/sCT0Pvi25nLJVamQkM/qXR6x5j/h+qV1JA7LaFOgNLjA8pYzpOTUYb
X-Gm-Gg: AZFdTZcECt7yi+diYFT/uI3GiMMoP5QIm6kunbbJDELDo0AEuOCUGBafMUK+tCpLklJ
	J6IY1rH9Gz5dZMzvlrwC3/Yu0XA4STWow8LDoNzQKXhCkx1dp/D+ZXgjBhvoNrV1Nc48PihwkOX
	1QPwXWsmeiXl8UjnVsrkUfyFWtesjHnBLR7p2ZMrmkkuWWybppbGykQW2FQoy77ZJQV9CHC/Wxw
	HHPk5LniRLBNx3MenQTREJHmyQp4A1kFT9S/lGGSvsWKtou/ONrKINrUYaWK1lSHuspmfUjwva9
	3O6X5SUt9LCl7GLusKfDoHICHChrfhfv2H1WGBIJcJ0oRsi9AFk2obtG6Ewg9UAM1dNLPFw8T6r
	03SJVDi81TMFZHQParaxsYPr46k8+p4GJWhptiiGmw/eb/lEVHUa0W5XkC8VELT7jUA2bVXQHSq
	XYQ3/5l9wZWBecONiPMZwqBENnH/yvhJtN/GFuewFRxiwrCXS8cU/w8Ui8b4qsdsrzS6hWNfzxx
	yMk+duzNv/SyPeYILQP0l8FldGEEbkE99jy8uNvwkmYJBfNRAhngDqkR0iNR41DMMS4UUyKNJHf
	C42afUZQFuuMBb/xy1KiisHP0do5aobAcaCxYNu/lgrWCUXBktZNwbRJ7HcuuB1f2tF3kUla6SI
	HWcs8tWmmsf1jGyVC4Jd4RhudM0cyx9qaLCyizvaggdmTtx4NV0BZI19c8qkwFQE=
X-Received: by 2002:a05:6214:8504:20b0:921:2245:73c2 with SMTP id 6a1803df08f44-92134abe315mr179048286d6.20.1795482958278;
        Mon, 23 Nov 2026 17:15:58 -0800 (PST)
X-Received: from gmail.com (15.60.86.34.bc.googleusercontent.com. [34.86.60.15])
        by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921349ee175sm123288296d6.26.2026.11.23.17.15.57
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Mon, 23 Nov 2026 17:15:57 -0800 (PST)
X-Cc: willemdebruijn.kernel@gmail.com, 
 jasowangio@gmail.com, 
 andrew+netdev@lunn.ch, 
 davem@davemloft.net, 
 edumazet@kernel.org, 
 kuba@kernel.org, 
 pabeni@redhat.com, 
 horms@kernel.org, 
 mst@redhat.com, 
 eperezma@redhat.com, 
 ast@kernel.org, 
 daniel@iogearbox.net, 
 hawk@kernel.org, 
 john.fastabend@gmail.com, 
 sdf@fomichev.me, 
 maheshb@google.com, 
 peterpenkov96@gmail.com, 
 netdev@vger.kernel.org, 
 virtualization@lists.linux.dev, 
 bpf@vger.kernel.org
X-In-Reply-To: <c663141e-78bf-41cf-81d0-fdda6fcbca74@mandelbit.com>
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