[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aAGUAztJqwnDQquo@t14>
Date: Thu, 17 Apr 2025 16:51:31 -0700
From: Jordan Rife <jordan@...fe.io>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: martin.lau@...ux.dev, aditi.ghag@...valent.com, bpf@...r.kernel.org,
daniel@...earbox.net, netdev@...r.kernel.org,
willemdebruijn.kernel@...il.com
Subject: Re: [PATCH v3 bpf-next 2/6] bpf: udp: Make sure iter->batch always
contains a full bucket snapshot
> > If I read it correctly, the last retry with GFP_ATOMIC is not because of the
> > earlier GFP_USER allocation failure but the size of the bucket has changed a lot
> > that it is doing one final attempt to get the whole bucket and this requires to
> > hold the bucket lock to ensure the size stays the same which then must use
> > GFP_ATOMIC.
>
> Ah exactly, when allocation fails, it always returned an error.
>
> Sorry, I should've read code first.
I was about to type out a response, but Martin beat me to it :). Yep,
GFP_ATOMIC is a necessary side-effect of holding onto the lock to make
sure the bucket doesn't grow anymore. It's a last resort to make sure
the batch size is big enough to grab a full bucket snapshot not a last
resort to allocate memory.
-Jordan
Powered by blists - more mailing lists