lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7ea8e560-89f6-4f3a-97a6-cf70c1d3d0d0@kernel.org>
Date: Thu, 11 Sep 2025 15:05:14 +0200
From: Jesper Dangaard Brouer <hawk@...nel.org>
To: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
 andrew+netdev@...n.ch, horms@...nel.org, ilias.apalodimas@...aro.org,
 nathan@...nel.org, nick.desaulniers+lkml@...il.com, morbo@...gle.com,
 justinstitt@...gle.com, llvm@...ts.linux.dev, Linux-MM <linux-mm@...ck.org>
Subject: Re: [PATCH net-next] page_pool: always add GFP_NOWARN for ATOMIC
 allocations



On 11/09/2025 02.52, Jakub Kicinski wrote:
> On Mon,  8 Sep 2025 08:21:23 -0700 Jakub Kicinski wrote:
>> Driver authors often forget to add GFP_NOWARN for page allocation
>> from the datapath. This is annoying to operators as OOMs are a fact
>> of life, and we pretty much expect network Rx to hit page allocation
>> failures during OOM. Make page pool add GFP_NOWARN for ATOMIC allocations
>> by default.
> 
> Hi Jesper! Are you okay with this? [2] It's not a lot of instructions and
> it's in the _slow() function, anyway. 

For this "_slow()" function I don't worry about the performance.
The optimization you did seems a bit premature... did you run the
page_pool benchmark to see if it is worth it?

> TBH I wrote the patch to fix the
> driver (again) first but when writing the commit message I realized my
> explanation why we can't fix this in the core was sounding like BS :$

It feels slightly strange to fix drivers misuse of the API in the core,
but again I'm not going to nack it, as it might be easier for us as
maintainers as it is hard to catch all cases during driver review.

All driver are suppose to use page_pool_dev_alloc[1] as it sets
(GFP_ATOMIC | __GFP_NOWARN).  Or page_pool_dev_alloc_netmems().

  [1] https://elixir.bootlin.com/linux/v6.16.6/source/include/net/
page_pool/helpers.h#L175-L179

The reason I added page_pool_dev_alloc() is because all driver used to
call a function named dev_alloc_page(), that also sets the appropriate
GFP flags.  So, I simple piggybacked on that design decision (which I
don't know whom came up with). Thus, I'm open to change.  Maybe DaveM
can remember/explain why "dev_alloc" was a requirement.

I'll let it be up to you,
--Jesper

[2] https://lore.kernel.org/all/20250908152123.97829-1-kuba@kernel.org/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ