From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: "Michal Koutný" <mkoutny-IBi9RG/b67k@public.gmane.org>
Cc: Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
John Stultz <john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Dmitry Shmidt <dimitrysh-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH cgroup/for-5.20] cgroup: remove "no" prefixed mount options options
Date: Tue, 26 Jul 2022 13:48:17 -1000 [thread overview]
Message-ID: <YuB9QXapVUy1t8TZ@slm.duckdns.org> (raw)
In-Reply-To: <YuB5ICv3bXsy5Xuh-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
30312730bd02 ("cgroup: Add "no" prefixed mount options") added "no" prefixed
mount options to allow turning them off and 6a010a49b63a ("cgroup: Make
!percpu threadgroup_rwsem operations optional") added one more "no" prefixed
mount option. However, Michal pointed out that the "no" prefixed options
aren't necessary in allowing mount options to be turned off:
# grep group /proc/mounts
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,relatime,nsdelegate,memory_recursiveprot 0 0
# mount -o remount,nsdelegate,memory_recursiveprot none /sys/fs/cgroup
# grep cgroup /proc/mounts
cgroup2 /sys/fs/cgroup cgroup2 rw,relatime,nsdelegate,memory_recursiveprot 0 0
Note that this is different from the remount behavior when the mount(1) is
invoked without the device argument - "none":
# grep cgroup /proc/mounts
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
# mount -o remount,nsdelegate,memory_recursiveprot /sys/fs/cgroup
# grep cgroup /proc/mounts
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
While a bit confusing, given that there is a way to turn off the options,
there's no reason to have the explicit "no" prefixed options. Let's remove
them.
Signed-off-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Michal Koutný <mkoutny-IBi9RG/b67k@public.gmane.org>
---
Documentation/admin-guide/cgroup-v2.rst | 8 ++++----
kernel/cgroup/cgroup.c | 24 ++++--------------------
2 files changed, 8 insertions(+), 24 deletions(-)
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -177,14 +177,14 @@ disabling controllers in v1 and make the
cgroup v2 currently supports the following mount options.
- [no]nsdelegate
+ nsdelegate
Consider cgroup namespaces as delegation boundaries. This
option is system wide and can only be set on mount or modified
through remount from the init namespace. The mount option is
ignored on non-init namespace mounts. Please refer to the
Delegation section for details.
- [no]favordynmods
+ favordynmods
Reduce the latencies of dynamic cgroup modifications such as
task migrations and controller on/offs at the cost of making
hot path operations such as forks and exits more expensive.
@@ -192,7 +192,7 @@ cgroup v2 currently supports the followi
controllers, and then seeding it with CLONE_INTO_CGROUP is
not affected by this option.
- memory_[no]localevents
+ memory_localevents
Only populate memory.events with data for the current cgroup,
and not any subtrees. This is legacy behaviour, the default
behaviour without this option is to include subtree counts.
@@ -200,7 +200,7 @@ cgroup v2 currently supports the followi
modified through remount from the init namespace. The mount
option is ignored on non-init namespace mounts.
- memory_[no]recursiveprot
+ memory_recursiveprot
Recursively apply memory.min and memory.low protection to
entire subtrees, without requiring explicit downward
propagation into leaf cgroups. This allows protecting entire
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -1872,22 +1872,18 @@ int cgroup_show_path(struct seq_file *sf
}
enum cgroup2_param {
- Opt_nsdelegate, Opt_nonsdelegate,
- Opt_favordynmods, Opt_nofavordynmods,
- Opt_memory_localevents, Opt_memory_nolocalevents,
- Opt_memory_recursiveprot, Opt_memory_norecursiveprot,
+ Opt_nsdelegate,
+ Opt_favordynmods,
+ Opt_memory_localevents,
+ Opt_memory_recursiveprot,
nr__cgroup2_params
};
static const struct fs_parameter_spec cgroup2_fs_parameters[] = {
fsparam_flag("nsdelegate", Opt_nsdelegate),
- fsparam_flag("nonsdelegate", Opt_nonsdelegate),
fsparam_flag("favordynmods", Opt_favordynmods),
- fsparam_flag("nofavordynmods", Opt_nofavordynmods),
fsparam_flag("memory_localevents", Opt_memory_localevents),
- fsparam_flag("memory_nolocalevents", Opt_memory_nolocalevents),
fsparam_flag("memory_recursiveprot", Opt_memory_recursiveprot),
- fsparam_flag("memory_norecursiveprot", Opt_memory_norecursiveprot),
{}
};
@@ -1905,27 +1901,15 @@ static int cgroup2_parse_param(struct fs
case Opt_nsdelegate:
ctx->flags |= CGRP_ROOT_NS_DELEGATE;
return 0;
- case Opt_nonsdelegate:
- ctx->flags &= ~CGRP_ROOT_NS_DELEGATE;
- return 0;
case Opt_favordynmods:
ctx->flags |= CGRP_ROOT_FAVOR_DYNMODS;
return 0;
- case Opt_nofavordynmods:
- ctx->flags &= ~CGRP_ROOT_FAVOR_DYNMODS;
- return 0;
case Opt_memory_localevents:
ctx->flags |= CGRP_ROOT_MEMORY_LOCAL_EVENTS;
return 0;
- case Opt_memory_nolocalevents:
- ctx->flags &= ~CGRP_ROOT_MEMORY_LOCAL_EVENTS;
- return 0;
case Opt_memory_recursiveprot:
ctx->flags |= CGRP_ROOT_MEMORY_RECURSIVE_PROT;
return 0;
- case Opt_memory_norecursiveprot:
- ctx->flags &= ~CGRP_ROOT_MEMORY_RECURSIVE_PROT;
- return 0;
}
return -EINVAL;
}
next prev parent reply other threads:[~2022-07-26 23:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 4:38 [PATCH 1/3 cgroup/for-5.20] cgroup: Elide write-locking threadgroup_rwsem when updating csses on an empty subtree Tejun Heo
[not found] ` <YtDvN0wJ6CKaEPN8-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2022-07-15 4:38 ` [PATCH 2/3 cgroup/for-5.20] cgroup: Add "no" prefixed mount options Tejun Heo
[not found] ` <YtDvU4jRPSsarcNp-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2022-07-15 4:39 ` [PATCH 3/3 cgroup/for-5.20] cgroup: Make !percpu threadgroup_rwsem operations optional Tejun Heo
2022-07-23 5:12 ` Tejun Heo
2022-07-23 14:28 ` [PATCH RESEND " Tejun Heo
[not found] ` <YtwFjPnCtw8ySnuv-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2022-07-25 12:12 ` Oleg Nesterov
[not found] ` <20220725121208.GB28662-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2022-07-26 23:14 ` Tejun Heo
2022-07-27 17:39 ` Oleg Nesterov
2022-07-25 14:16 ` Christian Brauner
2022-07-26 14:32 ` Michal Koutný
[not found] ` <20220726143257.GA23882-9OudH3eul5jcvrawFnH+a6VXKuFTiq87@public.gmane.org>
2022-07-26 17:33 ` Tejun Heo
2022-07-26 14:32 ` [PATCH 2/3 cgroup/for-5.20] cgroup: Add "no" prefixed mount options Michal Koutný
[not found] ` <20220726143246.GA23794-9OudH3eul5jcvrawFnH+a6VXKuFTiq87@public.gmane.org>
2022-07-26 20:01 ` Tejun Heo
2022-07-26 23:30 ` Tejun Heo
[not found] ` <YuB5ICv3bXsy5Xuh-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2022-07-26 23:48 ` Tejun Heo [this message]
[not found] ` <YuB9QXapVUy1t8TZ-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2022-07-27 9:27 ` [PATCH cgroup/for-5.20] cgroup: remove "no" prefixed mount options options Michal Koutný
[not found] ` <20220727092715.GA1569-9OudH3eul5jcvrawFnH+a6VXKuFTiq87@public.gmane.org>
2022-07-27 17:55 ` Tejun Heo
2022-07-26 14:31 ` [PATCH 1/3 cgroup/for-5.20] cgroup: Elide write-locking threadgroup_rwsem when updating csses on an empty subtree Michal Koutný
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YuB9QXapVUy1t8TZ@slm.duckdns.org \
--to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dimitrysh-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mkoutny-IBi9RG/b67k@public.gmane.org \
--cc=oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox