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

From
Haishuang Yan <hidden>
Date
2026-11-08 10:10:21
Also in
lkml
Reply to
Narcisa Vasile, 2026-11-08
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.

Thread (10 messages) 10 messages, 3 authors, last reply 12d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help