Re: [PATCH] mm: memcontrol-v1: use nofail allocations for soft limit trees

From: Andrew Morton

Date: Tue Jun 09 2026 - 21:30:26 EST


On Mon, 8 Jun 2026 16:34:48 +0800 Ruoyu Wang <ruoyuw560@xxxxxxxxx> wrote:

> This was found by static analysis and then checked by reading the code:
> memcg1_init() dereferences rtpn unconditionally after kzalloc_node(). I
> treated the soft-limit tree as mandatory memcg v1 init state and used
> __GFP_NOFAIL because continuing without it would not be useful.
>
> I agree this is early boot init code, and I do not have a
> runtime failure report or fault-injection reproduction for it.

Thanks.

Please teach the static analyzer that kernel practice is to ignore
allocation failures in __init code.