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: <c2ef8ae6-d813-424b-9c8d-1cb76bb62652@intel.com>
Date: Tue, 26 Mar 2024 10:56:47 +0100
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: <davem@...emloft.net>, <netdev@...r.kernel.org>, <edumazet@...gle.com>,
	<pabeni@...hat.com>, <alexs@...nel.org>, <siyanteng@...ngson.cn>,
	<jesse.brandeburg@...el.com>, <anthony.l.nguyen@...el.com>,
	<alexandre.torgue@...s.st.com>, <joabreu@...opsys.com>,
	<mcoquelin.stm32@...il.com>, <intel-wired-lan@...ts.osuosl.org>
Subject: Re: [PATCH net-next] net: remove gfp_mask from napi_alloc_skb()

From: Jakub Kicinski <kuba@...nel.org>
Date: Mon, 25 Mar 2024 15:41:14 -0700

> __napi_alloc_skb() is napi_alloc_skb() with the added flexibility
> of choosing gfp_mask. This is a NAPI function, so GFP_ATOMIC is
> implied. The only practical choice the caller has is whether to
> set __GFP_NOWARN. But that's a false choice, too, allocation failures
> in atomic context will happen, and printing warnings in logs,
> effectively for a packet drop, is both too much and very likely
> non-actionable.
> 
> This leads me to a conclusion that most uses of napi_alloc_skb()
> are simply misguided, and should use __GFP_NOWARN in the first
> place. We also have a "standard" way of reporting allocation
> failures via the queue stat API (qstats::rx-alloc-fail).
> 
> The direct motivation for this patch is that one of the drivers
> used at Meta calls napi_alloc_skb() (so prior to this patch without
> __GFP_NOWARN), and the resulting OOM warning is the top networking
> warning in our fleet.
> 
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>

Nice cleanup!

Reviewed-by: Alexander Lobakin <aleksander.lobakin@...el.com>

> ---
> This is changing mostly the Intel drivers, if the choice of
> flags is important there, please do let me know, why IDPF
> uses bare GFP_ATOMIC, specifically.

idpf uses bare atomic w/o nowarn because the author didn't pay attention
to it. The change is totally safe.

Thanks,
Olek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ