Re: [PATCH] tun: avoid high-order page allocation for packet header

From: Jakub Kicinski
Date: Mon Jul 31 2023 - 16:59:01 EST


On Tue, 25 Jul 2023 20:09:36 -0700 Tahsin Erdogan wrote:
> @@ -1838,6 +1838,9 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
> */
> zerocopy = false;
> } else {
> + if (linear == 0)
> + linear = min_t(size_t, good_linear, copylen);

nit: would you mind changing to !linear instead of linear == 0 ?

Also - I don't see linear explicitly getting set to 0. What guarantees
that? What's the story there?

Otherwise seems reasonable. One more allocation but hopefully nobody
will notice.
--
pw-bot: cr