Skip to content

cgroup_subsys_state lifecycle fixups

Michal Koutný cgroups lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2cgroup: Wait for cgroup_subsys_state offlining on unmountkernel/cgroup/cgroup.c+4 -10 replies
2/2cgroup: Use separate work structs on css release pathinclude/linux/cgroup-defs.h kernel/cgroup/cgroup.c+10 -917 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] cgroup_subsys_state lifecycle fixups

Two corner cases were hanging around [2][3] related to css lifecycles, since they're loosely related I'm sending them together.

The 2nd patch fixes problems encountered in syzbot tests only. Alternative solutions could be:
- daisy-chain css_release_work_fn from the offending css_killed_work_fn call,
- rework kill_css() not to rely on multi-stage css_killed_work_fn() [1].

The simplest approach was chosen.

The other existing users of percpu_ref_kill_and_confirm are not affected by similar issues.

[1] Rough idea is to only synchronize via a completion like e.g. nvmet_sq_destroy() does and move most of css_killed_work_fn() at the end of kill_css(). kill_css() is only used in process context when de-configuring controllers or rmdiring a cgroup.

[2] https://lore.kernel.org/lkml/20220404142535.145975-1-minhquangbui99-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org/
[3] https://lore.kernel.org/lkml/20220412192459.227740-1-tadeusz.struk-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org/

Michal Koutný (2):
cgroup: Wait for cgroup_subsys_state offlining on unmount
cgroup: Use separate work structs on css release path

 include/linux/cgroup-defs.h |  5 +++--
 kernel/cgroup/cgroup.c      | 19 +++++++++++--------
 2 files changed, 14 insertions(+), 10 deletions(-)
Signature · 1 line
2.35.3