]>
Commit | Line | Data |
---|---|---|
59d5af67 | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
e03fa66f FG |
2 | From: Waiman Long <longman@redhat.com> |
3 | Date: Thu, 17 Aug 2017 15:33:09 -0400 | |
59d5af67 FG |
4 | Subject: [PATCH] cgroup: Add mount flag to enable cpuset to use v2 behavior in |
5 | v1 cgroup | |
e03fa66f FG |
6 | MIME-Version: 1.0 |
7 | Content-Type: text/plain; charset=UTF-8 | |
8 | Content-Transfer-Encoding: 8bit | |
9 | ||
10 | A new mount option "cpuset_v2_mode" is added to the v1 cgroupfs | |
11 | filesystem to enable cpuset controller to use v2 behavior in a v1 | |
12 | cgroup. This mount option applies only to cpuset controller and have | |
13 | no effect on other controllers. | |
14 | ||
15 | Signed-off-by: Waiman Long <longman@redhat.com> | |
16 | Signed-off-by: Tejun Heo <tj@kernel.org> | |
17 | (cherry-picked from e1cba4b85daa71b710384d451ff6238d5e4d1ff6) | |
18 | Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> | |
19 | --- | |
20 | include/linux/cgroup-defs.h | 5 +++++ | |
21 | kernel/cgroup/cgroup-v1.c | 6 ++++++ | |
22 | 2 files changed, 11 insertions(+) | |
23 | ||
24 | diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h | |
25 | index 09f4c7df1478..c344e77707a5 100644 | |
26 | --- a/include/linux/cgroup-defs.h | |
27 | +++ b/include/linux/cgroup-defs.h | |
28 | @@ -74,6 +74,11 @@ enum { | |
29 | * aren't writeable from inside the namespace. | |
30 | */ | |
31 | CGRP_ROOT_NS_DELEGATE = (1 << 3), | |
32 | + | |
33 | + /* | |
34 | + * Enable cpuset controller in v1 cgroup to use v2 behavior. | |
35 | + */ | |
36 | + CGRP_ROOT_CPUSET_V2_MODE = (1 << 4), | |
37 | }; | |
38 | ||
39 | /* cftype->flags */ | |
40 | diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c | |
41 | index 7bf4b1533f34..ce7426b875f5 100644 | |
42 | --- a/kernel/cgroup/cgroup-v1.c | |
43 | +++ b/kernel/cgroup/cgroup-v1.c | |
44 | @@ -846,6 +846,8 @@ static int cgroup1_show_options(struct seq_file *seq, struct kernfs_root *kf_roo | |
45 | seq_puts(seq, ",noprefix"); | |
46 | if (root->flags & CGRP_ROOT_XATTR) | |
47 | seq_puts(seq, ",xattr"); | |
48 | + if (root->flags & CGRP_ROOT_CPUSET_V2_MODE) | |
49 | + seq_puts(seq, ",cpuset_v2_mode"); | |
50 | ||
51 | spin_lock(&release_agent_path_lock); | |
52 | if (strlen(root->release_agent_path)) | |
53 | @@ -900,6 +902,10 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts) | |
54 | opts->cpuset_clone_children = true; | |
55 | continue; | |
56 | } | |
57 | + if (!strcmp(token, "cpuset_v2_mode")) { | |
58 | + opts->flags |= CGRP_ROOT_CPUSET_V2_MODE; | |
59 | + continue; | |
60 | + } | |
61 | if (!strcmp(token, "xattr")) { | |
62 | opts->flags |= CGRP_ROOT_XATTR; | |
63 | continue; | |
64 | -- | |
777ee9fe | 65 | 2.14.2 |
e03fa66f | 66 |