On Fri, Apr 25, 2025 at 09:11:01AM +0800, Huan Yang wrote:Yes, that's right.
Hi ShakeelIf that is needed in future then that can be done in future. I would say
在 2025/4/25 07:00, Shakeel Butt 写道:
On Thu, Apr 24, 2025 at 09:00:01AM -0700, Shakeel Butt wrote:Maybe someone also need init something after cgroup init done?
On Thu, Apr 24, 2025 at 08:09:29PM +0800, Huan Yang wrote:BTW I think just putting this kmem cache creation in mem_cgroup_init()
When cgroup_init() creates root_mem_cgroup through css_online callback,Please move this patch as the first patch of the series and also remove
some critical resources might not be fully initialized, forcing later
operations to perform conditional checks for resource availability.
This patch introduces mem_cgroup_early_init() to address the init order,
it invoke before cgroup_init, so, compare mem_cgroup_init which invoked
by initcall, mem_cgroup_early_init 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>
the "early" from the function name as it has a different meaning in the
context of cgroup init. Something like either memcg_init() or
memcg_kmem_caches_init().
and explicitly calling it before cgroup_init() would be fine. In that
case there would be a single memcg init function.
Currently no, but for furture may need?
simply call mem_cgroup_init() before cgroup_init() for now.