mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
BACKPORT: cgroup: Add named hierarchy disabling to cgroup_no_v1 boot param
It can be useful to inhibit all cgroup1 hierarchies especially during transition and for debugging. cgroup_no_v1 can block hierarchies with controllers which leaves out the named hierarchies. Expand it to cover the named hierarchies so that "cgroup_no_v1=all,named" disables all cgroup1 hierarchies. Signed-off-by: Tejun Heo <tj@kernel.org> Suggested-by: Marcin Pawlowski <mpawlowski@fb.com> Signed-off-by: Tejun Heo <tj@kernel.org> Change-Id: Ibd093dd9b70d15402a21db3c1ef56005ebc7f99e (cherry picked from commit 3fc9c12d27b4ded4f1f761a800558dab2e6bbac5) Bug: 154548692 Signed-off-by: Marco Ballesio <balejs@google.com> Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
This commit is contained in:
parent
a6c4372166
commit
0cd038b91b
@ -493,10 +493,14 @@
|
||||
Specifying "pressure" disables per-cgroup pressure
|
||||
stall information accounting feature
|
||||
|
||||
cgroup_no_v1= [KNL] Disable one, multiple, all cgroup controllers in v1
|
||||
Format: { controller[,controller...] | "all" }
|
||||
cgroup_no_v1= [KNL] Disable cgroup controllers and named hierarchies in v1
|
||||
Format: { { controller | "all" | "named" }
|
||||
[,{ controller | "all" | "named" }...] }
|
||||
Like cgroup_disable, but only applies to cgroup v1;
|
||||
the blacklisted controllers remain available in cgroup2.
|
||||
"all" blacklists all controllers and "named" disables
|
||||
named mounts. Specifying both "all" and "named" disables
|
||||
all v1 hierarchies.
|
||||
|
||||
cgroup.memory= [KNL] Pass options to the cgroup memory controller.
|
||||
Format: <string>
|
||||
|
@ -27,6 +27,9 @@
|
||||
/* Controllers blocked by the commandline in v1 */
|
||||
static u16 cgroup_no_v1_mask;
|
||||
|
||||
/* disable named v1 mounts */
|
||||
static bool cgroup_no_v1_named;
|
||||
|
||||
/*
|
||||
* pidlist destructions need to be flushed on cgroup destruction. Use a
|
||||
* separate workqueue as flush domain.
|
||||
@ -991,6 +994,10 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
|
||||
}
|
||||
if (!strncmp(token, "name=", 5)) {
|
||||
const char *name = token + 5;
|
||||
|
||||
/* blocked by boot param? */
|
||||
if (cgroup_no_v1_named)
|
||||
return -ENOENT;
|
||||
/* Can't specify an empty name */
|
||||
if (!strlen(name))
|
||||
return -EINVAL;
|
||||
@ -1336,7 +1343,12 @@ static int __init cgroup_no_v1(char *str)
|
||||
|
||||
if (!strcmp(token, "all")) {
|
||||
cgroup_no_v1_mask = U16_MAX;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!strcmp(token, "named")) {
|
||||
cgroup_no_v1_named = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
for_each_subsys(ss, i) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user