Re: [PATCH net 1/2] net: do not run out of frags in alloc_skb_with_frags()
From: Haishuang Yan
Date: Sun Nov 08 2026 - 05:11:27 EST
On Sun, Nov 08, 2026 at 12:20:11AM -0800, Narcisa Vasile wrote:
> I think we should decouple the two parts you've pointed out:
[...]
> Should we also return -EMSGSIZE when header_len
> is above the kmalloc limit, like it already does for an oversized
> data_len? I'm not sure whether the errno change is acceptable?.
Thanks for the review.
Agreed, these are two separate problems. I'll keep this patch to the
frag accounting, and reword the changelog in v2 so it doesn't suggest
that it fixes the vhost spin in general.
Right, for larger frames tun_alloc_skb() moves everything above
MAX_SKB_FRAGS << PAGE_ALLOC_COSTLY_ORDER into the linear part, so once
that is above the kmalloc limit alloc_skb() can never succeed. I'll
look at that one separately in tun.
> nit, feel free to ignore, this might read more simply as:
>
> /* If splitting the rest into smaller pages would need
> * more frags than we have left, use one larger page.
> */
Will take it in v2, thanks.