🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13005

Re: [PATCH net 1/2] net: do not run out of frags in alloc_skb_with_frags()

#13005
From: Haishuang Yan
Date: Mon, 09 Nov 2026 14:40
21 lines
9662 bytes
On Mon, Nov 09, 2026 at 02:07:12AM +0000, netdev-bot+sashiko@kernel.org wrote:
> Can alloc_skb_with_frags() still run out of frags when a high-order
> allocation fails? The fallback just below this hunk has not changed:
[...]
> Would it work to treat the frag budget as a hard limit on every order
> reduction? For example, lower the order only when this still covers
> data_len:
>
> 	(MAX_SKB_FRAGS - nr_frags) * (PAGE_SIZE << (order - 1))

Yes, this is a real problem, and it comes from the same commit: before
09c2c90705bb the limit was MAX_SKB_FRAGS pages, so lowering the order
could never run out of frags.

v2 will only lower the order while the frags left can still hold the
rest. If they can't, it tries the same order once more with the
caller's direct reclaim (with __GFP_NORETRY), and fails only if that
fails too.

pw-bot: cr
Technical Details
Message-ID: <20261109144038.36055-1-yanhaishuang@cmss.chinamobile.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-359046-linux-kernel-netdev=dewy.ru
References: <20261108100617.23840-2-yanhaishuang@cmss.chinamobile.com> <179419003251.994134.13120616805502524032@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-359046-linux-kernel-netdev=dewy.ru
From: yanhaishuang@cmss.chinamobile.com (Haishuang Yan)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 1/2] net: do not run out of frags in alloc_skb_with_frags()
Date: Mon,  9 Nov 2026 23:40:36 +0900
Organization: Usenet Network
Message-ID: <20261109144038.36055-1-yanhaishuang@cmss.chinamobile.com>
References: <20261108100617.23840-2-yanhaishuang@cmss.chinamobile.com> <179419003251.994134.13120616805502524032@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="291362"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ovNC57lA9JrHez+m9W0wHbMctBc= sha256:jxX273PtBFz85WTq8j/r3sBBkI+cKAT7sw0gVCXxnXI=
	sha1:QbaTo9Qh+VKliDQwOJaCwnouF90= sha256:GNWysRC+cnxGhDdMPWUHF00ykz7HlK+ZMTYjugLliws=
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 F00C31136EB; Mon,  9 Nov 2026 09:41:59 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.75
X-Spam-Status: No, score=-2.75 tagged_above=-9999 required=6.31
	tests=[DATE_IN_FUTURE_06_12=0.001, DCC_REPUT_70_89=0.1,
	DKIM_INVALID=0.1, DKIM_SIGNED=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=fail (1024-bit key)
	reason="fail (body has been altered)" header.d=cmss.chinamobile.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 sbsk_tE3Y5Jf;
	Mon,  9 Nov 2026 09:41:51 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-359046-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=cmss.chinamobile.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id E7E391136E3; Mon,  9 Nov 2026 09:41:41 +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 457C13CEEB; Mon,  9 Nov 2026 06:41:16 +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=1794206476;
	b=FcmYEN8MHDssD8MRSlv+ioz1w6g3/sLEG/JMxiGinxQQV7/Xk77JNk6Kb2kkwTFhmia6
	 H+i77gFK4ZExJy0i877iky+cb59mSJnEOE0l0CtJImQLFa7E+I/oIUdOJXQN5U2Tu6lZY
	 1RtPMsLEP3twNnfnhjtuSOqnjh59MyrGJtQkBQ6MiCPjvg9BdocqCHWTbRMMFvjLMnWwb
	 RQciIpN7Vdizuc1mvvsbO3pROnybnhEw10arl1wkUUhkbalsrrUPNOZwNr18ijycP55KF
	 kt3L9y8nqAX8ebbn1e8tgNcwJkg7UdHp1tp8oLuRfjo+XIkXceodEkvu27ZWNg7GCHA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794206476;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:X-RM-TagInfo:
	 X-RM-SPAM-FLAG:Received:X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:
	 Received:X-RM-TRANSID:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 In-Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=soqt50K3rw3+soUYivhJF2vTy49ZFgNuuvn5H0S2lRo=;
	b=X0LP4lKcmaUpK0me56VPgX7BPWUDVE4AjQqdfcH5IlEH535zbAhT2gxeKnbYNg1dW2q7
	 l8+qDqPw21VAYVwGREzHZREcgxycJJqELZrf7OfUom2ectLvl7B2n4AHofrSLEPBH7J/O
	 z+TbK6zRhbQZXwzywq/3oXexj5i+FNF5d/Lkr7AG7en8xXd2DF3GZIPuVTTfSPYCgb3xb
	 YRzwlqkBK/g1rY0n+sEjLQMkMkB5ePYqrSZHg6kkl+0uFynONfsydALlJIYe5NGvbKb4a
	 Wo+4fVz1CmLimkkzz9g4eFlGsB1LHdh6XGP9qQ21bkyjKAANA5JVr+2HitMwh97DvMw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=JQunonNj;
	dmarc=pass header.from=cmss.chinamobile.com;
	spf=pass smtp.mailfrom=cmss.chinamobile.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 1CA95606A33A;
	Mon,  9 Nov 2026 06:41:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=JQunonNj
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=111.22.67.137
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794206470;
	b=y95wsBEn8Ew9ADFo/UNQ0Wjve6K1Y/nXlyr15UB7If1Yuj8hEeKjgia3zNG3jyRwmDcR
	 aRRdum8oLdGrNn94hwsxhqd/hLHwwZLtp21ZMnmLJHAo/eOUWe1UIhIMI8WXA4ya7fM/q
	 wRdNtmVCc8uTZkdbXOxspC9Ex3fqZ3tv8McsGBKa/OjqGTjfyiv23Kh2nzvAB53QbLYQK
	 SliH4hg42EVFgUv8vVg5olRXqU4C6uUKBROm/yqBWCp9cUVH2JVno8AbtAXgNaGN3JDlR
	 mWGxIrpEIDlhw3z9XiRCKRfQflTU4sF9JLpC+inYg6srWpc2gzRQO3bFyKRJ6mLD9eQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794206470;
	h=DMARC-Filter:DKIM-Signature:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:
	 X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:X-RM-TRANSID:From:
	 To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 MIME-Version:Content-Transfer-Encoding;
	bh=soqt50K3rw3+soUYivhJF2vTy49ZFgNuuvn5H0S2lRo=;
	b=Gc1GXi/KsH7tEwBJvb4AUmUNT6KcPl69rmpXKkmwBaOIKTuw50ME7z4g1WUgg3QnEUMg
	 NCmFCIpGXVyOLnrFt4tAXow0Xg3WMhsOA+fubDc7MVbCPCfEXLLb4N3LnxyX6Pz6CTzJO
	 0muoZDt0tx0x7ZyHr5CuCWTXV/KDYmtq8fO4lP3X+iLoMHMAqRVeLPcBvXQlVnUBrZPet
	 3w4yV0LDVI6hn/3EcXgAlSr6wydbh/MFjjXakLxk4Ot5Qy5cpSmHwL9/yQQWPO2tDE+dh
	 YVQcovJN37vFUvdayFjvid/yKD0pXH2okEh5fKW5ssSgozzBvyBIkZDjmUMYiHgw1Uw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=cmss.chinamobile.com;
	spf=pass smtp.mailfrom=cmss.chinamobile.com;
	dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=JQunonNj;
	arc=none smtp.remote-ip=111.22.67.137
X-Received: from cmccmta4.chinamobile.com (cmccmta4.chinamobile.com [111.22.67.137])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E7C1606A31C;
	Mon,  9 Nov 2026 06:41:08 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5E7C1606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmss.chinamobile.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=cmss.chinamobile.com; s=default; l=0;
	h=from:subject:message-id:to:cc:mime-version;
	bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=;
	b=JQunonNjB0FhU+PTB8co+UPpaRFyfokDEv8w2n0asMuhORSW5JOpbW9aUTZaLWfe+Hk9fHOt2RQSA
	 QGQzgw9poK+dIlDC3WtT0qZs2lR8TJ4YtJUs6IvHLNLeHNCjTJf9esfVKP2yF4X3GX34mDwotserYc
	 +tKl1yrprNvSZhgA=
X-RM-TagInfo: emlType=0                                       
X-RM-SPAM-FLAG: 00000000
X-Received: from spf.mail.chinamobile.com (unknown[10.188.0.87])
	by rmmx-syy-dmz-app04-12004 (RichMail) with SMTP id 2ee46af16b00901-616b3;
	Mon, 09 Nov 2026 14:41:06 +0800 (CST)
X-RM-TRANSID: 2ee46af16b00901-616b3
X-RM-TagInfo: emlType=0                                       
X-RM-SPAM-FLAG: 00000000
X-Received: from openEuler-24.03.03 (unknown[74.82.203.40])
	by rmsmtp-syy-appsvr08-12008 (RichMail) with SMTP id 2ee86af16ae9d21-84788;
	Mon, 09 Nov 2026 14:41:06 +0800 (CST)
X-RM-TRANSID: 2ee86af16ae9d21-84788
X-Cc: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>,
	davem@davemloft.net,
	edumazet@kernel.org,
	kuba@kernel.org,
	pabeni@redhat.com,
	horms@kernel.org,
	willemb@google.com,
	mst@redhat.com,
	jasowangio@gmail.com,
	eperezma@redhat.com,
	willemdebruijn.kernel@gmail.com,
	narcisav.kernel@gmail.com,
	linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.43.0
X-In-Reply-To: <179419003251.994134.13120616805502524032@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