From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796480490; b=4TownTcMx4cGdDxABmsBI7nyz0qla4dPZhy4Kcl0aRMRrdU+sX1OjMQjOkxlw9Yw6n6F PORIkNzcS/6s2M/XhTICR1wGr8ze23nudLX1bfdT+8EFU6k3OmYjeqPtUCAVkunGDuj3n PaUN44/JcbvmxdDi/iunOgluRl9zFKQPK7CsdDbJRZVofPJbmozp6uptDF94ulMFnCPY5 yALodWhNpGxgzn9N2qnH7KKpM+ugnzMr0FmO67ZhkUI8ja2fuUtV7RS9eqx/YyEl3+L94 cUhP04eDoGPohkzBUCGmAxIiPkQYbTTnHtvbqiZoWP5+DATk26sq8Einru73nHnX+Rw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796480490; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=y7cgjfKmvOUIHA7VnGK4HsIrAFpyN3DvzAErJG8wK0k=; b=PDh3T8RKrHYmE/S6+MdqjULARgqEhnnZIAmsbyoZBpLhpWw2XX+KMNm7YEGV3vvfD1kQ wk7068jNwnbnsWxG7pOSv4MTcmuuwycQa+LWtmXiGSvMcPmacYcTUnq1Th3FMtodoz8Zg dQ/BfhqVu/hBZ68jTihzOLLzkz42ZtuqPczHsz1hmq5E9VIwMNFnJ2YhO729Ramw+KdQ7 k6zg8a+gP+NwNWnVQwbWV2mz7j+S6rVG8H8JMBmfi6OmVdG7kYEB8gB8IRmcG6jRbjf/r tza4h4cm0Lm0rUGYPFMR4CIFJI51Cyebs31dIHt06zEbB02xz8Vj+XmgMBT/KYF4pAQ== 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=bEFwy0p4; arc=none smtp.remote-ip=100.103.45.18 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 388C0606A333 for ; Sat, 5 Dec 2026 14:21:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bEFwy0p4 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C05F31F00936; Sat, 5 Dec 2026 14:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796480489; bh=y7cgjfKmvOUIHA7VnGK4HsIrAFpyN3DvzAErJG8wK0k=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=bEFwy0p4gnjhjdo6luAkne7GXIaJg3q2UzGiCgOPDvaBjQT7dU4QgCd8deRqp/nfU z/zb3Odbyj/KXYf232B2psM5WoRZLPSVKDSPXGyXW93vRfq0OZv9ALejm+VrBOk6mB 4dz4N/OHtk6gblQDKU1aV5TMIAN6IMbRciT/8bdsHIbTh2UBNB7srGYZoPvmkAOop6 JuO/tDhKOdHJFIjV8BdZzi1VWRj4CDsRGER9GPHzJishQGnv4xBMiFgZa2t2KBELfg wHSOulrR1BcUgcITJnZfuuHEpKwqpSqEMpqaPskUXo8f5QDPFhs+96onFJL969VAtP mojFKYAQAGOwg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net v4 5/5] xsk: Keep the shared info of zero-copy buffers in kernel memory Reply-To: sashiko-reviews@lists.linux.dev To: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , bpf@vger.kernel.org Cc: intel-wired-lan@lists.osuosl.org In-Reply-To: <20261204142030.626820-6-bjorn@kernel.org> References: <20261204142030.626820-1-bjorn@kernel.org> <20261204142030.626820-6-bjorn@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 14:21:29 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] xsk: order-1 kmalloc demotion on 4K multi-buffer XDP_PASS skb heads -- commit 97c565848cf50ed7cfbc3a8831daad9dd6b074f8 Author: Bj=C3=B6rn T=C3=B6pel xsk: Keep the shared info of zero-copy buffers in kernel memory This commit moves the skb_shared_info of zero-copy XSK buffers from UMEM tailroom into struct xsk_buff_pool and drops the tailroom reservation from zero-copy multi-buffer Rx frame sizes. > diff --git a/include/net/xdp_sock_drv.h b/include/net/xdp_sock_drv.h > index a40ad3f90f13c..ec74bf3ffa510 100644 > --- a/include/net/xdp_sock_drv.h > +++ b/include/net/xdp_sock_drv.h [ ... ] > @@ -58,18 +53,7 @@ static inline u32 __xsk_pool_get_rx_frame_size(struct = xsk_buff_pool *pool) > =20 > static inline u32 xsk_pool_get_rx_frame_size(struct xsk_buff_pool *pool) > { > - u32 frame_size =3D __xsk_pool_get_rx_frame_size(pool); > - struct xdp_umem *umem =3D pool->umem; > - bool mbuf; > - > - /* Reserve tailroom only for zero-copy pools that opted into > - * multi-buffer. The reserved area is used for skb_shared_info, > - * matching the XDP core's xdp_data_hard_end() layout. > - */ > - mbuf =3D pool->dev && (umem->flags & XDP_UMEM_SG_FLAG); > - frame_size -=3D xsk_pool_get_tailroom(mbuf); > - > - return ALIGN_DOWN(frame_size, 128); > + return ALIGN_DOWN(__xsk_pool_get_rx_frame_size(pool), 128); > } [Severity: Medium] Does removing the tailroom subtraction demote 4 KiB-chunk multi-buffer XDP_PASS skb heads to order-1 kmalloc-8k allocations? With a 4096-byte UMEM chunk and zero headroom, xsk_pool_get_rx_frame_size() now returns 3840 bytes instead of 3456. On idpf (libeth_xskfq_create()), a multi-buffer XDP_PASS head passes 256 + 3840 =3D 4096 bytes to xdp_build_skb_from_zc() -> xdp_zc_alloc_head(). Because SKB_HEAD_ALIGN(4096) is 4416 > PAGE_SIZE (previously 4032), xdp_zc_alloc_head() bypasses system_page_pool and falls back to __netdev_alloc_skb() -> kmalloc-8k. i40e_construct_skb_zc() hits the same order-1 fallback in napi_alloc_skb() once totalsize reaches 3840. This doubles skb head memory and truesize from 4 KiB to 8 KiB on every multi-buffer XDP_PASS packet, loses per-CPU page recycling, and risks GFP_ATOMIC order-1 allocation failures under memory fragmentation. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204142030.6268= 20-1-bjorn@kernel.org?part=3D5