🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12130

Re: [PATCH net-next] net: ena: reuse the whole RX page on 64kB page kernels

#12130
From: Breno Leitao
Date: Fri, 06 Nov 2026 10:09
35 lines
10354 bytes
On Fri, Nov 06, 2026 at 03:17:11AM +0000, Harry Yoo (Meta) wrote:
> Since commit ef5b0771d247 ("net: ena: fix driver when PAGE_SIZE ==
> 64kB"), the RX buffer given to the device is limited to ENA_PAGE_SIZE
> (16kB) because the buffer length field in the RX descriptor is 16 bits.
> However, the driver still allocates a full page for each RX buffer, so
> on a 64kB page kernel only the first 16kB of the page is handed to the
> device and the remaining 48kB is never used.
> 
> The dynamic RX buffer recycling added by commit f7d625adeb7b ("net: ena:
> Add dynamic recycling mechanism for rx buffers") does not fully utilize
> the page because ena_try_rx_buf_page_reuse() only reuses what is left
> in the current buffer and ignores unused memory in the page.
> 
> This shows up when RX data stays in socket receive queues, as each
> queued skb keeps the whole 64kB page alive while at most 16kB of it
> holds data. On an EC2 t4g.large instance (64kB pages, 8GB memory) with
> 519MB left unread across 64 TCP sockets, RX pages pinned 2869MB of
> memory while the socket layer accounted only 687MB.
> 
> Fix this by mapping the whole page and letting
> ena_try_rx_buf_page_reuse() size the next buffer from the room left in
> the page instead of from what is left of ena_buf->len. ena_buf->len is
> then only the length written to the RX descriptor and stays capped at
> ENA_PAGE_SIZE. With this fixed, a comparable workload pins only 497MB.
> 
> When PAGE_SIZE equals ENA_PAGE_SIZE, the room left in the page equals
> ena_buf->len, so nothing changes.
> 
> Signed-off-by: Harry Yoo (Meta) <harry@kernel.org>

Nice finding, this seems like a bug, no? Which means 'net' tree and
a Fix: tag.

Reviewed-by: Breno Leitao <leitao@debian.org>
Technical Details
Message-ID: <au2nNm44LnaoXcB2@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-357914-linux-kernel-netdev=dewy.ru
References: <20261106-ena-rx-reuse-64k-page-v1-1-ac75b20c5de8@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-357914-linux-kernel-netdev=dewy.ru
From: leitao@debian.org (Breno Leitao)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next] net: ena: reuse the whole RX page on 64kB page
 kernels
Date: Fri, 6 Nov 2026 02:09:34 -0800
Organization: Usenet Network
Message-ID: <au2nNm44LnaoXcB2@gmail.com>
References: <20261106-ena-rx-reuse-64k-page-v1-1-ac75b20c5de8@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="3843944"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:CtGH/XcdYdu7gLw5JIobUYQhjOM= sha256:9vQ+Jd4J/e5c6d28YJd8sowhXixUARCuB+6rkvX5GvM=
	sha1:Vvh2AlJtuZcDuxhNgYxZCE6O7X4= sha256:fYGRyyQiwZ4XYSZ6IsiTIUs1PlQaQVqRu4ejdiSA5K8=
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 3FBD71131F0; Fri,  6 Nov 2026 13:10:19 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.152
X-Spam-Status: No, score=-3.152 tagged_above=-9999 required=6.31
	tests=[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 IlbkMH6zwesr;
	Fri,  6 Nov 2026 13:10:13 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-357914-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 717DD1131EE; Fri,  6 Nov 2026 13:10:05 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id F166F602602; Fri,  6 Nov 2026 10:10: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=1793959798;
	b=gUihpKt2gvGrUaMM2OUVAAxSoNQjE2COi3owPDraVtTc1G6RLmIh5me+8CUeKhkSTb3S
	 +yqgadyEWdn8PAn9uQwPDTH4ZseSBWIrBDAVrAIyEs36QY2KJvd7eQLoIXAd/Z3palGee
	 uL7FOQC8biMV7XRj4QECXnTFiYgRLV8Ys1TW6L8cdepW3I15KfViNRC2UDeMTKo26JWMq
	 B0gWly1HfFAPshGgndP8BICglIA6MJgf7+j/YpketnPelg86jXFZmkrAxUnEXeuyTqKqJ
	 9aEX3wcvO4F5UNIfYRtgu4H58fp+Nj2yXafLzdyaV2nOeVMujpPjn65F4fP8WlsrVwg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793959798;
	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=nlXCNuaGteJMHPhKOMcWqAFCETDFUXQYuHFMl+88FyI=;
	b=gaaWtu8GtPXGd22c4AdKcqZnnE4k/8jJ+YTiXe54p7tt24vo+30r8YQ0A9S1O6n9nxZE
	 zvKCz/UqLThvvdIFXjLHgiBp0hU7Sa+c75/myk3Kqk+vQyO/bJsL5/yRMNMG0BVVpdtsa
	 arBZttvMrxH/xEfRLM0ukoCNv8DoAAwBfI1kmU2jasUYACtt6MjwQH1Eoki2BHiOVtX6e
	 YC4SpNHTcOtfTnHuhkGOKNwwkjtdHfjLfNFnp1sMeEVSLbZ1a59FYNnLlw3OBG9JaIlqg
	 31JFtZQQYN2V27CveVTaFf2vPUV4+DuIA8YTQhgmFyjyNnMvMd+rC5hRhnDgq9Y+lPQ==
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=ciB7EYh5;
	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 9A6F9606A335;
	Fri,  6 Nov 2026 10:09:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=debian.org header.i=@debian.org header.a=rsa-sha256 header.s=smtpauto.stravinsky header.b=ciB7EYh5
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=1793959792;
	b=YUbTlOXaHXdgVcwhISB/7MPbxdRNdVf0noh7O2gxhkw9BIGXZJxMsLZo/GP47gKzdE3v
	 TaUdwukMv/rsLa/wxloEG22pK7fidOxHFdJLqyhObOGRwS8eVsDApQFvH+0Sxne6HPpce
	 IaNZu1kfiahBFGg+fqCn8+vr5pZevI0vfMMwUB5rJGnFyhlZXIHSaTH6JK3Q+R9S954NJ
	 8tvN10YuX0MuCzFoOiuW6NZQ1tIKOC+V+TxMLA94HlBKQt8aM6heGvi47i60rRG5P6E82
	 VairwKaeUZn/tmREE2DOGdNGsz4Pt+hE4U8WV34JIPQLyFJENuZR+3A5gWVwyugPdPw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793959792;
	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=nlXCNuaGteJMHPhKOMcWqAFCETDFUXQYuHFMl+88FyI=;
	b=bcpMhIXSgBCDekJMkx2X/RDDagLsyaReG2XHGCO53DQxpqt0Ebaojs/9rAbnsYlvGpu4
	 daG6/oyoZisUdk08aHUVYeBZJnZaY4OxSfyA3RKnXMTzveXmuw39L+wxYNjcm00lIF8Tz
	 mn1NV24/9M6e6WCHzNG2N1vvw9yCcyg0ZycKnDCR7hi2BsvergfLwUNkVFxCG1L8cOyOv
	 rFKm2gr/f774gmHNkFUSCcsxKDk6/YaZ45TNslZQqg3kwuqiYBt3zYVmO++JNDDCE4lqY
	 M2FNF20wt+an+MADo1f8JrqmsODgICKMU+/4kvYwYy3UBp1wk8/rN0R7RSsr2vHq4nQ==
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=ciB7EYh5;
	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 1E6A4606A32C;
	Fri,  6 Nov 2026 10:09:51 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1E6A4606A32C
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=nlXCNuaGteJMHPhKOMcWqAFCETDFUXQYuHFMl+88FyI=; b=ciB7EYh5KJ21H8k7CQUVDoJPTK
	aBgaJ2IlEbwPkXY9J0ggZMzwj2MomPQwOFuHGrQ/bu+U+sIvQ3mUrs2U0aWehjAQ05Ld8ivjdv8Lu
	1qX1L+1al//RhizxEOSN8lJNFi6qNCaD/awwNhUAQBydIMdLfUk5NnAcyzW/5aZPoxhwVr2Mue/CH
	Y639ld4gMvJb0p9TWcG463E1q2UwLxKrmW25xatpGquDgJZTsT6NvgrhJEq3A/Jb9wAfOM6kAIbAi
	AFWgzqqpRkAvAF/V10jbPGGrKl8ru2m9v22wh3MAYPHG90zvrpePLR8tpaWgd/R/keZgJ9BsWQnVT
	V+NBT3bw==;
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 1xPGtA-009CvW-07;
	Fri, 06 Nov 2026 10:09:40 +0000
X-Cc: Arthur Kiyanovski <akiyano@amazon.com>, 
	David Arinzon <darinzon@amazon.com>, Andrew Lunn <andrew+netdev@lunn.ch>, 
	"David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, 
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, kernel-team@meta.com, 
	netdev@vger.kernel.org, linux-kernel@vger.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: <20261106-ena-rx-reuse-64k-page-v1-1-ac75b20c5de8@kernel.org>
X-Debian-User: leitao