🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13132

Re: [PATCH net-next v3 2/9] net: devmem: charge the frag length to TX skb truesize

#13132
From: Breno Leitao
Date: Mon, 09 Nov 2026 10:59
22 lines
10074 bytes
On Thu, Nov 05, 2026 at 02:20:51PM -0800, Stanislav Fomichev wrote:
> Devmem TX charges each frag the net_iov size, PAGE_SIZE today:
> zerocopy_fill_skb_from_devmem() adds PAGE_SIZE to skb->truesize per
> frag and __zerocopy_sg_from_iter() charges it to sk_wmem_queued. TCP
> uncharges in bytes as acked data is trimmed from the skb
> (tcp_trim_head()) and uncharges the rest when the skb is freed. A frag
> shorter than a page leaves the difference charged until then, which is
> small with PAGE_SIZE net_iovs.
> 
> TX net_iovs are about to grow up to 2MB, while frags stay bounded by
> the skb and many frags share a net_iov. Charging the net_iov size would
> charge up to 2MB per frag: a 64KB skb with two frags would charge 4MB
> and fill the default 4MB send buffer on its own.
> 
> Charge the frag length instead, which also matches what TCP uncharges.
> 
> Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
> Reviewed-by: Mina Almasry <almasrymina@google.com>
> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>

Reviewed-by: Breno Leitao <leitao@debian.org>
Technical Details
Message-ID: <avGneUOQtUAMvpCq@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-359226-linux-kernel-netdev=dewy.ru
References: <20261105222058.944293-1-sdf@fomichev.me> <20261105222058.944293-3-sdf@fomichev.me>

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-359226-linux-kernel-netdev=dewy.ru
From: leitao@debian.org (Breno Leitao)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v3 2/9] net: devmem: charge the frag length to
 TX skb truesize
Date: Mon, 9 Nov 2026 02:59:16 -0800
Organization: Usenet Network
Message-ID: <avGneUOQtUAMvpCq@gmail.com>
References: <20261105222058.944293-1-sdf@fomichev.me>
 <20261105222058.944293-3-sdf@fomichev.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="334873"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:NN/lAmAVwaTML00MxSf9U9mlH6A= sha256:RuKDwo8WS5TADJhLRxXShFSqPxeEvDHOiU8vQpQcLq4=
	sha1:5vyKUnU9ZOdf2GV+Oksabe7a2ZM= sha256:qzFrsBrgeCQJX0w0joEHO98vOPFTJ3To8GT7C+KeXaY=
Content-Disposition: inline
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 79D721137A3; Mon,  9 Nov 2026 14:04:23 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.052
X-Spam-Status: No, score=-3.052 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,
	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=debian.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 7IcyfMMtMfhK;
	Mon,  9 Nov 2026 14:04:17 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-359226-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=debian.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 6A67211375F; Mon,  9 Nov 2026 14:04:08 +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 D2F223B645; Mon,  9 Nov 2026 11:00:01 +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=1794222001;
	b=evsdY2P1L4kAlYxgJFky55rEpa+4I39BtnyReSIpWIcwtFylO+XhpDtyYubTVn8q71/v
	 YPFme9DHEWp3c4by46f3MdctbTT8gnq+2D2BUL0+9IQ7CtmTppVkbpLmeHB/W86fbJGHV
	 XLUby4F2q/4q6V2Zgc41z6ea8Xk+S7szohYxSEeZ2CV4zLfB3+ZLSqtuVPZM7mLvfpYCA
	 lvtZ0BpjxYLSqW8dLlsMwgDPXm3rMwvrHFTQSNZLoY0WSQtSv1lRXb+31/BBKmodnwYWW
	 Qs34utyGzRKOZnZEtEWxAvX7Dh2sz8C9E9xjVENnD/Pk8Zc4ijqs4g+Ctis6Oa8pxXQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794222001;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
	 From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:
	 X-Debian-User;
	bh=osm7kcunpwMDUpa0AtafPLPtEfGBifAjr7mLSbmoxSs=;
	b=H/NUwsFkChfbQHiwQXyFz+OdSK3Lj4h8+fysUqaw4WE4Kl3O7NP1sKU3M6bTOR/g8aXM
	 f0XX1M5UJ4RiXRaRE9YA4PZleOzw8UuBePZNYahsCBKBMjPlnbtJNYwX1H8IHCqmeU4D/
	 VfQM21IcvybY32iZAlN8xsCdhshgKkGZDHdPhz1aqqTWH2wlpHqEOcyDMjihPmTvJRlVX
	 qL7tzTrnLmFcsSvxMu7jCxJFGzQNilH0cvERJAdHeWvD5lHqIroMXt2lMZ9FwJLxyvJXQ
	 pDWT6/3lR3Bcr9UyT8aSXjX6DOqtYTyNwo6wBny9/BrkiJoGwoD/EVBjvsBM4PLNqJg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=debian.org header.i=@debian.org header.a=rsa-sha256 header.s=smtpauto.stravinsky header.b=PmBSvkJR;
	dmarc=pass header.from=debian.org;
	spf=pass smtp.mailfrom=debian.org;
	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 8C583606A330;
	Mon,  9 Nov 2026 11:00:01 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.a=rsa-sha256 header.s=smtpauto.stravinsky header.b=PmBSvkJR
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=82.195.75.108
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794221977;
	b=BBkwakf/t0wmeNSyNEf4MTPsW/wCPq/jH+gC0FeabN+bX71tdh9sqNRj9bItRh68x+il
	 lOaCHVLSvQO5tIqyzCRDKIClP0IAp+XWpLrRZCx8gn/V4ricnWwFk6dlF4YnDKQgRKNUT
	 JTKScWC2EHjSmEi2IT4nDy1E5dJqSi7bBiCeJThhXybnJdhud7QVX9rrgZP6tpfJ+Bb9e
	 qsrHzYQufLyzvRNhuey6+P+sExR7fmMWGchkc/MBuQkpb0md91SORNdTg9dOG0SiVudFI
	 fvtfNwlPnQbeT2aTs2LRofnzE393QjKLUvpwN7uOF3efkbD/a70JDr+Jk0TRkMw2x6A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794221977;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 In-Reply-To:X-Debian-User;
	bh=osm7kcunpwMDUpa0AtafPLPtEfGBifAjr7mLSbmoxSs=;
	b=eVkzbs0AQ20LkxESzkizoBIqB5xb7zG+6LnyAQcNmnhWrauUvp+CsZL92b1jSQroIhCY
	 e6Omj0aBCyLw/reSt4XZ5IWNU7S112V3nXXMr5oq1vfM7DuiGe28hHzma4/hmbdiW01rf
	 3G70Bt39ZC4QhKDF4pSbjyBUBHESOpGZHcqldNWo1PWS6hm8vTdQ4nibGSsVT97ZRxrY2
	 M1X8LhtUxEshWY8vUEXlKr55FO78g28sBwMC2LXtLv20xS2hduaD1EVz8lV/yUnvaicUt
	 McYq9oO2K8nDX3iqU4qSdvGR2JbrC5eJzJfT4wZ08gw1ijJhiQOJMZ378M1YIFblU3Q==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=debian.org;
	spf=pass smtp.mailfrom=debian.org;
	dkim=pass header.d=debian.org header.i=@debian.org header.a=rsa-sha256 header.s=smtpauto.stravinsky header.b=PmBSvkJR;
	arc=none smtp.remote-ip=82.195.75.108
X-Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id B50D9606A31C;
	Mon,  9 Nov 2026 10:59:36 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B50D9606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org;
	s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=osm7kcunpwMDUpa0AtafPLPtEfGBifAjr7mLSbmoxSs=; b=PmBSvkJRE+E4aDV0EmKy+JqADs
	Sa6/sVJSWWB5gAqwLZ+OohAFfpIy/spemjq5iYrHuBQWdFoNDRNLSiCk9l7cRaapYt5mZFq5ZXQ+H
	81DKStnUBSMjLnUoLpTIFwr5WXFIooYVdx02LgI+ZRla4GMMsAkb8aI9IJknzC7BYWSQzyWqWWQBz
	OxD5NGDpQPj1UIWluYnugbg4XCMzKnIOMwfDITbxUVRH7R9D8MptE97MM3pP5rMk96JjgntoCNdeX
	nn3Qqdz8vCJ7PzN88KXwy4Nnu5RG2hmFZiw49ezDPL0L/kN7sz7Hi5+B+0Jt3SmMftsUseLKFvAVl
	pt3W/rMQ==;
X-Received: from authenticated-user
	by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
	(Exim 4.96)
	(envelope-from <leitao@debian.org>)
	id 1xQN5w-00BZ7X-2e;
	Mon, 09 Nov 2026 10:59:25 +0000
X-Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, 
	kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, edumazet@kernel.org, 
	horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, 
	michael.chan@broadcom.com, pavan.chebbi@broadcom.com, saeedm@nvidia.com, tariqt@nvidia.com, 
	mbloch@nvidia.com, alexanderduyck@fb.com, kernel-team@meta.com, sdf@fomichev.me, 
	dimitri.daskalakis1@gmail.com, almasrymina@google.com, dtatulea@nvidia.com, 
	bobbyeshleman@meta.com, asml.silence@gmail.com, daniel@iogearbox.net, 
	razor@blackwall.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	linux-rdma@vger.kernel.org, linux-kselftest@vger.kernel.org, leon@kernel.org
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: <20261105222058.944293-3-sdf@fomichev.me>
X-Debian-User: leitao