Re: [PATCH v14 02/14] cgroup/misc: Add per resource callbacks for CSS events

2024-06-07 Thread Haitao Huang
On Thu, 06 Jun 2024 20:53:11 -0500, chenridong wrote: I think it is better when _misc_cg_res_alloc fails, it just calls _misc_cg_res_free(cg, index)(add index parameter, it means ending of iterator), so it can avoid calling ->free() that do not call ->alloc(). And in misc_cg_free, just c

Re: [PATCH v14 02/14] cgroup/misc: Add per resource callbacks for CSS events

2024-06-06 Thread chenridong
I think it is better when _misc_cg_res_alloc fails, it just calls _misc_cg_res_free(cg, index)(add index parameter, it means ending of iterator), so it can avoid calling ->free() that do not call ->alloc(). And in misc_cg_free, just call _misc_cg_res_free(cg, MISC_CG_RES_TYPES)  to free all.

Re: [PATCH v14 02/14] cgroup/misc: Add per resource callbacks for CSS events

2024-06-06 Thread Haitao Huang
On Thu, 06 Jun 2024 08:37:31 -0500, chenridong wrote: If _misc_cg_res_alloc fails, maybe some types do not call ->alloc(), but all types ->free() callback >will be called, is that ok? Not sure I understand. Are you suggesting we ignore failures from ->alloc() callback in _misc_cg_r

[PATCH v14 02/14] cgroup/misc: Add per resource callbacks for CSS events

2024-05-31 Thread Haitao Huang
From: Kristen Carlson Accardi The misc cgroup controller (subsystem) currently does not perform resource type specific action for Cgroups Subsystem State (CSS) events: the 'css_alloc' event when a cgroup is created and the 'css_free' event when a cgroup is destroyed. Define callbacks for those e