2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/kernel/cgroup
T.J. Mercier 1bf67c8fdb cgroup/cpuset-v1: Add missing support for cpuset_v2_mode
Android has mounted the v1 cpuset controller using filesystem type
"cpuset" (not "cgroup") since 2015 [1], and depends on the resulting
behavior where the controller name is not added as a prefix for cgroupfs
files. [2]

Later, a problem was discovered where cpu hotplug onlining did not
affect the cpuset/cpus files, which Android carried an out-of-tree patch
to address for a while. An attempt was made to upstream this patch, but
the recommendation was to use the "cpuset_v2_mode" mount option
instead. [3]

An effort was made to do so, but this fails with "cgroup: Unknown
parameter 'cpuset_v2_mode'" because commit e1cba4b85d ("cgroup: Add
mount flag to enable cpuset to use v2 behavior in v1 cgroup") did not
update the special cased cpuset_mount(), and only the cgroup (v1)
filesystem type was updated.

Add parameter parsing to the cpuset filesystem type so that
cpuset_v2_mode works like the cgroup filesystem type:

$ mkdir /dev/cpuset
$ mount -t cpuset -ocpuset_v2_mode none /dev/cpuset
$ mount|grep cpuset
none on /dev/cpuset type cgroup (rw,relatime,cpuset,noprefix,cpuset_v2_mode,release_agent=/sbin/cpuset_release_agent)

[1] b769c8d24f
[2] https://cs.android.com/android/platform/superproject/main/+/main:system/core/libprocessgroup/setup/cgroup_map_write.cpp;drc=2dac5d89a0f024a2d0cc46a80ba4ee13472f1681;l=192
[3] https://lore.kernel.org/lkml/f795f8be-a184-408a-0b5a-553d26061385@redhat.com/T/

Fixes: e1cba4b85d ("cgroup: Add mount flag to enable cpuset to use v2 behavior in v1 cgroup")
Signed-off-by: T.J. Mercier <tjmercier@google.com>
Acked-by: Waiman Long <longman@redhat.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Acked-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2025-04-17 07:32:53 -10:00
..
cgroup-internal.h cgroup: Print message when /proc/cgroups is read on v2-only system 2025-03-11 09:22:54 -10:00
cgroup-v1.c Driver core updates for 6.15-rc1 2025-04-01 11:02:03 -07:00
cgroup.c cgroup/cpuset-v1: Add missing support for cpuset_v2_mode 2025-04-17 07:32:53 -10: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 cgroup/cpuset: Fix race between newly created partition and dying one 2025-04-01 21:46:22 -10:00
debug.c kernel: cgroup: fix misuse of %x 2019-05-06 08:47:48 -07:00
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 cgroup: Add deprecation message to legacy freezer controller 2025-03-11 09:22:54 -10:00
Makefile kernel/cgroup: Add "dmem" memory accounting cgroup 2025-01-06 17:24:38 +01:00
misc.c cgroup/misc: Remove unused misc_cg_res_total_usage 2025-01-28 09:00:54 -10: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: rstat: call cgroup_rstat_updated_list with cgroup_rstat_lock 2025-04-01 07:33:26 -10:00