Bug#1108294: [PATCH 4/4] cgroup: Do not report unavailable v1 controllers in /proc/cgroups
- To: Michal Koutný <mkoutny@suse.com>
- Cc: Ben Hutchings <ben@decadent.org.uk>, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Zefan Li <lizefan.x@bytedance.com>, Johannes Weiner <hannes@cmpxchg.org>, Michal Hocko <mhocko@kernel.org>, Roman Gushchin <roman.gushchin@linux.dev>, Shakeel Butt <shakeel.butt@linux.dev>, Muchun Song <muchun.song@linux.dev>, Andrew Morton <akpm@linux-foundation.org>, Chen Ridong <chenridong@huawei.com>, 1108294@bugs.debian.org
- Subject: Bug#1108294: [PATCH 4/4] cgroup: Do not report unavailable v1 controllers in /proc/cgroups
- From: Tejun Heo <tj@kernel.org>
- Date: Sat, 19 Jul 2025 06:18:48 -1000
- Message-id: <[🔎] aHvFaAtLUVAaPq6D@slm.duckdns.org>
- Reply-to: Tejun Heo <tj@kernel.org>, 1108294@bugs.debian.org
- In-reply-to: <[🔎] 7sbzasggfk3elhvxsd5mtuzd4yo3c64wuzkaulr7yqybpfxwuh@g6dcatriw7hx>
- References: <20240909163223.3693529-1-mkoutny@suse.com> <20240909163223.3693529-5-mkoutny@suse.com> <[🔎] b26b60b7d0d2a5ecfd2f3c45f95f32922ed24686.camel@decadent.org.uk> <[🔎] bio4h3soa5a64zqca66fbtmur3bzwhggobplzg535erpfr2qxe@xsgzgxihirpa> <[🔎] aHGM6_WOTWLiUdpU@slm.duckdns.org> <[🔎] 7sbzasggfk3elhvxsd5mtuzd4yo3c64wuzkaulr7yqybpfxwuh@g6dcatriw7hx> <87tt44jpor.fsf@tweety.afaics.de>
On Fri, Jul 18, 2025 at 11:18:54AM +0200, Michal Koutný wrote:
> From ace88e9e3a77ff3fe86aee4b7a5866b3bfd2df58 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Michal=20Koutn=C3=BD?= <mkoutny@suse.com>
> Date: Thu, 17 Jul 2025 17:38:47 +0200
> Subject: [PATCH] cgroup: Add compatibility option for content of /proc/cgroups
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> /proc/cgroups lists only v1 controllers by default, however, this is
> only enforced since the commit af000ce85293b ("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: [🔎] b26b60b7d0d2a5ecfd2f3c45f95f32922ed24686.camel@decadent.org.uk">https://lore.kernel.org/r/[🔎] b26b60b7d0d2a5ecfd2f3c45f95f32922ed24686.camel@decadent.org.uk
> Fixes: af000ce85293b ("cgroup: Do not report unavailable v1 controllers in /proc/cgroups")
> Fixes: a0ab1453226d8 ("cgroup: Print message when /proc/cgroups is read on v2-only system")
> Signed-off-by: Michal Koutný <mkoutny@suse.com>
Applied to cgroup/for-6.17.
Thanks.
--
tejun
Reply to: