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

Submitted by Valeriy Vdovin on April 1, 2020, 1 p.m.


Reviewer None
Submitted April 1, 2020, 1 p.m.
Last Updated April 2, 2020, 12:03 a.m.
Revision 1

Cover Letter

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 for an example of such problem with systemd.

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
v3: cgroup_root_from_opts uses ..set_release_agent helper without lockdep
v4: fixed possible race at cgroup_release_agent
v5: Use per-ve workqueue to maintain per-ve cgroups notifications

Valeriy Vdovin (6):
  cgroup: Added rcu node string wrapper for in-cgroup usage.
  cgroup: Declared cgroup_mark_ve_root in public header
  ve/cgroup: Moved cgroup release notifications to per-ve workqueues.
  ve/cgroup: private per-cgroup-root data container
  ve/cgroup: Set release_agent_path for root cgroups separately for each
  cgroup: Added logging along cgroup_release_agent failure codepaths.

 include/linux/cgroup.h |  40 ++++++-
 include/linux/ve.h     |  31 ++++++
 kernel/cgroup.c        | 297 +++++++++++++++++++++++++++++++++++++------------
 kernel/ve/ve.c         | 214 ++++++++++++++++++++++++++++++++++-
 4 files changed, 501 insertions(+), 81 deletions(-)