Make release_agent per-cgroup property. Run release_agent in proper ve.

Submitted by Valeriy Vdovin on March 13, 2020, 10:09 a.m.

Details

Reviewer None
Submitted March 13, 2020, 10:09 a.m.
Last Updated March 24, 2020, 1:37 a.m.
Revision 3

Cover Letter

Problems:
1. Currently release_agent is a mount-wide cgroup property, single for whole hierarchy. It is
not possible to override it's value for a cgroup down the hierarchy, which is a virtual root
for a container.
2. Code that spawnes release_agent notification processes, does so from ve0, inside of a container
any logic that waits for notifications of empty cgroups will fail, 
see https://jira.sw.ru/browse/PSBM-83887 for an example of such problem with systemd.

Solution:
In this patchset release_agent is moved from 'struct cgroupfs_root' to 'struct cgroup', enabling
the possibility to set release_agent per-ve.
Also 'struct cgroup' recieves a pointer to owning ve, so that release_agent notifications
could be spawned under the right ve.

v1: Removed complex locking scheme for ve_owner<->cgroup binding.
v2: release_agent_path protected by RCU

Valeriy Vdovin (2):
  cgroup: 'release_agent' property is now per-cgroup instead of
    per-mount.
  ve/cgroup: Added pointers to owning ve to root cgroups

 include/linux/cgroup.h |  17 +++-
 kernel/cgroup.c        | 211 ++++++++++++++++++++++++++++++++++++++++++++-----
 kernel/ve/ve.c         |   8 +-
 3 files changed, 213 insertions(+), 23 deletions(-)
  

Revisions