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=1796378249; b=g3c+EfemD3GSqXGAqVRpU9rIrpwLg69XLRCPEUShc/XX5+YSae2TJUvzL9lwcFP5et9B MaNi8kiDdWbcb4RQ4mjtSUwyi4tc9el18eUvHL55gSoNxzx77ti93OK2qLcYVicqStU2Q ohTAzpUhDl7h6iUV1rjXXahW25Z+D+AaUpaP3vyyQI3n74sz6gACHlraUq/qwInbWCjJM kad3vf3L1tHb4E/bGXC3fZfqh9AMUlNWd4/+4nUVW1sFx/57sGNaKF5f/kmvrFX4T/S4z GOnFCWk5oZCFD2iVxL1aQB+SVJpJFix6/p5aDD9cTvinVIiEtV/c2TVSKSqjl5vvpbQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796378249; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=S9hLInr8ru6wdzXLGat1gTnERRHFz0wObVC2XdtlTgs=; b=a8te9zC0jNJB/6IlI/I2y6+oOGlskdUjGcaIRU+s0wxZdPf2/6eTC6XfGlWSiTcfEYMP APVmHcNer4k/uX4inD0ddZs+mm3twSetAhjXcOtryvupflfdSnYSs41xRy5lHwsePWMa/ 6hx+tN8T6Wz6y1xZ1gVVTBmMCqwbtbvU7+FkGX5HKzWwIT1xncbY5bvBW9XUus+RGWiuz gFYGCDvr/lax/4BpZ3+cZ1Ii0s5hKddy0eIimR02Emfom+sByOXbn9edt5TR4heDHl4l/ NONGFb+3UhKaBhinz0u+NQGzt3iaCCpSA3JKwml0HDzzcGEv1JIlGVo92Qpq0hLsvCg== 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=WfdLd2SC; 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 BB5E4606A32C for ; Fri, 4 Dec 2026 09:57:29 +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=WfdLd2SC Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D4901F00931; Fri, 4 Dec 2026 09:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796378249; bh=S9hLInr8ru6wdzXLGat1gTnERRHFz0wObVC2XdtlTgs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=WfdLd2SCK5+iiL3iANM7mAGQjd10ZEQ0o6NedhDmHofBobT2fulfUhMRqqV7jdeMU rJDs5c1a7e7lXNN3MPJNCh5XowjNiJnQ3g02jeiUBo9D+7Lkbw4NXkROUqVPJ7Y6vQ gHEzfwS0pmweUE0Y8oUmR4PPgMT39daXI0rM6pVN5sCMtqLmWAMJE/T2wpclD/5RvH t+LOb3Qv6lvsFxmT6Vwfd17JWXWFTSq7VMyX2+gg6FzmlhYMgbqn/rCgCfvKdFUEiK YMxxxfclGEbxly3ncCWnFjGv2i6T4ZwKR/NOLoLGN6RsW3QeOR0YYcERM38V06qNhP 7RzZnuvDxteIQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net v3 4/4] 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: <20261203095647.3448925-5-bjorn@kernel.org> References: <20261203095647.3448925-1-bjorn@kernel.org> <20261203095647.3448925-5-bjorn@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 09:57:28 +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 398e24a8ed1c684ab049fa90f5ec27a7ab098093 Author: Bj=C3=B6rn T=C3=B6pel xsk: Keep the shared info of zero-copy buffers in kernel memory This commit moves skb_shared_info for zero-copy XSK buffers out of UMEM tailroom into struct xsk_buff_pool, marks those buffers with XDP_FLAGS_SINFO_EXT, and stops reserving tailroom in xsk_pool_get_rx_frame_size() and xdp_umem_reg(). > 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 here demote 4K-chunk multi-buffer XDP_PASS skb head allocations to order-1 kmalloc-8k? With 4096-byte UMEM chunks and zero headroom, xsk_pool_get_rx_frame_size() grows from 3456 to 3840 bytes. On idpf (via libeth_xskfq_create()), a multi-buffer jumbo packet returning XDP_PASS passes a 4096-byte head (XDP_PACKET_HEADROOM + 3840) to xdp_zc_alloc_head(): net/core/xdp.c:xdp_zc_alloc_head() { u32 truesize =3D SKB_HEAD_ALIGN(size); ... if (truesize > PAGE_SIZE) return __netdev_alloc_skb(dev, size, GFP_ATOMIC | __GFP_NOWARN); } Because SKB_HEAD_ALIGN(4096) is 4416 bytes (versus 4032 bytes before), every such packet now bypasses system_page_pool and falls back to __netdev_alloc_skb(), which exceeds SKB_WITH_OVERHEAD(PAGE_SIZE) and allocates from kmalloc-8k instead of recycled order-0 pages. This doubles the skb head memory footprint, loses page-pool recycling, and risks GFP_ATOMIC order-1 allocation failures under memory fragmentation. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203095647.3448= 925-1-bjorn@kernel.org?part=3D4