Re: [PATCH v3 1/3] mm/memcg: move mem_cgroup_init() ahead of cgroup_init()
From: Shakeel Butt
Date: Fri Apr 25 2025 - 00:12:16 EST
On Thu, Apr 24, 2025 at 8:19 PM Huan Yang <link@xxxxxxxx> wrote:
>
> When cgroup_init() creates root_mem_cgroup through css_alloc callback,
> some critical resources might not be fully initialized, forcing later
> operations to perform conditional checks for resource availability.
>
> This patch move mem_cgroup_init() to address the init order, it invoke
> before cgroup_init, so, compare to subsys_initcall, it can use to prepare
> some key resources before root_mem_cgroup alloc.
>
> Signed-off-by: Huan Yang <link@xxxxxxxx>
> Suggested-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
Acked-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>