linux-yocto/kernel/cgroup
Michal Koutný 1e53f83deb cgroup: Add compatibility option for content of /proc/cgroups
[ Upstream commit 646faf36d7 ]

/proc/cgroups lists only v1 controllers by default, however, this is
only enforced since the commit af000ce852 ("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: af000ce852 ("cgroup: Do not report unavailable v1 controllers in /proc/cgroups")
Fixes: a0ab145322 ("cgroup: Print message when /proc/cgroups is read on v2-only system")
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-15 16:39:10 +02:00
..
cgroup-internal.h cgroup: use subsystem-specific rstat locks to avoid contention 2025-05-19 10:29:42 -10:00
cgroup-v1.c cgroup: Add compatibility option for content of /proc/cgroups 2025-08-15 16:39:10 +02:00
cgroup.c cgroup: Changes for v6.16 2025-05-27 20:59:53 -07:00
cpuset-internal.h cgroup/cpuset: Don't allow creation of local partition over a remote one 2025-03-31 13:26:53 -10:00
cpuset-v1.c RFC cgroup/cpuset-v1: Add deprecation messages to sched_relax_domain_level 2025-03-11 09:22:54 -10:00
cpuset.c - The 11 patch series "Add folio_mk_pte()" from Matthew Wilcox 2025-05-31 15:44:16 -07:00
debug.c
dmem.c cgroup/dmem: Don't open-code css_for_each_descendant_pre 2025-02-19 09:50:37 +01:00
freezer.c cgroup/freezer: Add cgroup CGRP_FROZEN flag update helper 2024-10-23 09:45:09 -10:00
legacy_freezer.c Revert "cgroup_freezer: cgroup_freezing: Check if not frozen" 2025-07-17 07:57:02 -10:00
Makefile kernel/cgroup: Add "dmem" memory accounting cgroup 2025-01-06 17:24:38 +01:00
misc.c Merge branch 'kvm-tdx-initial' into HEAD 2025-04-07 07:36:33 -04:00
namespace.c cgroup:namespace: Remove unused cgroup_namespaces_init() 2023-08-14 14:29:47 -10:00
pids.c cgroup/pids: Remove unreachable paths of pids_{can,cancel}_fork 2024-08-05 10:32:16 -10:00
rdma.c rdmacg: fix kernel-doc warnings in rdmacg 2023-06-05 09:45:14 -10:00
rstat.c cgroup: adjust criteria for rstat subsystem cpu lock access 2025-05-30 14:36:13 -10:00