public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Erdogan, Tahsin" <trdgn@amazon.com>
To: "kuba@kernel.org" <kuba@kernel.org>
Cc: "herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
	"edumazet@google.com" <edumazet@google.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tun: avoid high-order page allocation for packet header
Date: Mon, 31 Jul 2023 23:03:19 +0000	[thread overview]
Message-ID: <eab96d92e08f63de5a2321571781faf2343802eb.camel@amazon.com> (raw)
In-Reply-To: <20230731135854.3628918b@kernel.org>

Thanks Jakub for considering this patch.

On Mon, 2023-07-31 at 13:58 -0700, Jakub Kicinski wrote:
> 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 ?

Yes, I will fix this in v2.


> Also - I don't see linear explicitly getting set to 0. What
> guarantees
> that? What's the story there?
linear is set to 0 in the earlier if block. When gso.hdr_len is 0,
linear also becomes 0:
        if (!zerocopy) {
                copylen = len;
                if (tun16_to_cpu(tun, gso.hdr_len) > good_linear)
                        linear = good_linear;
                else
                        linear = tun16_to_cpu(tun, gso.hdr_len);
        }

      reply	other threads:[~2023-07-31 23:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26  3:09 [PATCH] tun: avoid high-order page allocation for packet header Tahsin Erdogan
2023-07-31 20:58 ` Jakub Kicinski
2023-07-31 23:03   ` Erdogan, Tahsin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eab96d92e08f63de5a2321571781faf2343802eb.camel@amazon.com \
    --to=trdgn@amazon.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox