Commit 646faf36 authored by Michal Koutný's avatar Michal Koutný Committed by Tejun Heo
Browse files

cgroup: Add compatibility option for content of /proc/cgroups

/proc/cgroups lists only v1 controllers by default, however, this is
only enforced since the commit af000ce8 ("cgroup: Do not report
unavailable v1 controllers in /proc/cgroups") and there is software in
the wild that uses content of /proc/cgroups to decide on availability of
v2 (sic) controllers.

Add a boottime param that can bring back the previous behavior for
setups where the check in the software cannot be changed and it causes
e.g. unintended OOMs.

Also, this patch takes out cgrp_v1_visible from cgroup1_subsys_absent()
guard since it's only important to check which hierarchy (v1 vs v2) the
subsys is attached to. This has no effect on the printed message but
the code is cleaner since cgrp_v1_visible is really about mounted
hierarchies, not the content of /proc/cgroups.

Link: https://lore.kernel.org/r/b26b60b7d0d2a5ecfd2f3c45f95f32922ed24686.camel@decadent.org.uk


Fixes: af000ce8 ("cgroup: Do not report unavailable v1 controllers in /proc/cgroups")
Fixes: a0ab1453 ("cgroup: Print message when /proc/cgroups is read on v2-only system")
Signed-off-by: default avatarMichal Koutný <mkoutny@suse.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 954bacce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment