cgroup: export list of delegatable control files using sysfs
authorRoman Gushchin <guro@fb.com>
Mon, 6 Nov 2017 18:30:28 +0000 (13:30 -0500)
committerTejun Heo <tj@kernel.org>
Mon, 6 Nov 2017 20:01:54 +0000 (12:01 -0800)
commit01ee6cfb1483fe57c9cbd8e73817dfbf9bacffd3
treee518d99f865f2dcb535737c4cce8402ba1278a20
parentc3ba13298709f46e72b22d087d0aa02bd012e4b0
cgroup: export list of delegatable control files using sysfs

Delegatable cgroup v2 control files may require special handling
(e.g. chowning), and the exact list of such files varies between
kernel versions (and likely to be extended in the future).

To guarantee correctness of this list and simplify the life
of userspace (systemd, first of all), let's export the list
via /sys/kernel/cgroup/delegate pseudo-file.

Format is siple: each control file name is printed on a new line.
Example:
  $ cat /sys/kernel/cgroup/delegate
  cgroup.procs
  cgroup.subtree_control

Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: kernel-team@fb.com
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c