Commit c808f463 authored by Tejun Heo's avatar Tejun Heo

cgroup: remove "no" prefixed mount options

30312730 ("cgroup: Add "no" prefixed mount options") added "no" prefixed
mount options to allow turning them off and 6a010a49 ("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: default avatarTejun Heo <tj@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 6a010a49
...@@ -177,14 +177,14 @@ disabling controllers in v1 and make them always available in v2. ...@@ -177,14 +177,14 @@ disabling controllers in v1 and make them always available in v2.
cgroup v2 currently supports the following mount options. cgroup v2 currently supports the following mount options.
[no]nsdelegate nsdelegate
Consider cgroup namespaces as delegation boundaries. This Consider cgroup namespaces as delegation boundaries. This
option is system wide and can only be set on mount or modified option is system wide and can only be set on mount or modified
through remount from the init namespace. The mount option is through remount from the init namespace. The mount option is
ignored on non-init namespace mounts. Please refer to the ignored on non-init namespace mounts. Please refer to the
Delegation section for details. Delegation section for details.
[no]favordynmods favordynmods
Reduce the latencies of dynamic cgroup modifications such as Reduce the latencies of dynamic cgroup modifications such as
task migrations and controller on/offs at the cost of making task migrations and controller on/offs at the cost of making
hot path operations such as forks and exits more expensive. hot path operations such as forks and exits more expensive.
...@@ -192,7 +192,7 @@ cgroup v2 currently supports the following mount options. ...@@ -192,7 +192,7 @@ cgroup v2 currently supports the following mount options.
controllers, and then seeding it with CLONE_INTO_CGROUP is controllers, and then seeding it with CLONE_INTO_CGROUP is
not affected by this option. not affected by this option.
memory_[no]localevents memory_localevents
Only populate memory.events with data for the current cgroup, Only populate memory.events with data for the current cgroup,
and not any subtrees. This is legacy behaviour, the default and not any subtrees. This is legacy behaviour, the default
behaviour without this option is to include subtree counts. behaviour without this option is to include subtree counts.
...@@ -200,7 +200,7 @@ cgroup v2 currently supports the following mount options. ...@@ -200,7 +200,7 @@ cgroup v2 currently supports the following mount options.
modified through remount from the init namespace. The mount modified through remount from the init namespace. The mount
option is ignored on non-init namespace mounts. option is ignored on non-init namespace mounts.
memory_[no]recursiveprot memory_recursiveprot
Recursively apply memory.min and memory.low protection to Recursively apply memory.min and memory.low protection to
entire subtrees, without requiring explicit downward entire subtrees, without requiring explicit downward
propagation into leaf cgroups. This allows protecting entire propagation into leaf cgroups. This allows protecting entire
......
...@@ -1872,22 +1872,18 @@ int cgroup_show_path(struct seq_file *sf, struct kernfs_node *kf_node, ...@@ -1872,22 +1872,18 @@ int cgroup_show_path(struct seq_file *sf, struct kernfs_node *kf_node,
} }
enum cgroup2_param { enum cgroup2_param {
Opt_nsdelegate, Opt_nonsdelegate, Opt_nsdelegate,
Opt_favordynmods, Opt_nofavordynmods, Opt_favordynmods,
Opt_memory_localevents, Opt_memory_nolocalevents, Opt_memory_localevents,
Opt_memory_recursiveprot, Opt_memory_norecursiveprot, Opt_memory_recursiveprot,
nr__cgroup2_params nr__cgroup2_params
}; };
static const struct fs_parameter_spec cgroup2_fs_parameters[] = { static const struct fs_parameter_spec cgroup2_fs_parameters[] = {
fsparam_flag("nsdelegate", Opt_nsdelegate), fsparam_flag("nsdelegate", Opt_nsdelegate),
fsparam_flag("nonsdelegate", Opt_nonsdelegate),
fsparam_flag("favordynmods", Opt_favordynmods), fsparam_flag("favordynmods", Opt_favordynmods),
fsparam_flag("nofavordynmods", Opt_nofavordynmods),
fsparam_flag("memory_localevents", Opt_memory_localevents), fsparam_flag("memory_localevents", Opt_memory_localevents),
fsparam_flag("memory_nolocalevents", Opt_memory_nolocalevents),
fsparam_flag("memory_recursiveprot", Opt_memory_recursiveprot), 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_context *fc, struct fs_parameter *param ...@@ -1905,27 +1901,15 @@ static int cgroup2_parse_param(struct fs_context *fc, struct fs_parameter *param
case Opt_nsdelegate: case Opt_nsdelegate:
ctx->flags |= CGRP_ROOT_NS_DELEGATE; ctx->flags |= CGRP_ROOT_NS_DELEGATE;
return 0; return 0;
case Opt_nonsdelegate:
ctx->flags &= ~CGRP_ROOT_NS_DELEGATE;
return 0;
case Opt_favordynmods: case Opt_favordynmods:
ctx->flags |= CGRP_ROOT_FAVOR_DYNMODS; ctx->flags |= CGRP_ROOT_FAVOR_DYNMODS;
return 0; return 0;
case Opt_nofavordynmods:
ctx->flags &= ~CGRP_ROOT_FAVOR_DYNMODS;
return 0;
case Opt_memory_localevents: case Opt_memory_localevents:
ctx->flags |= CGRP_ROOT_MEMORY_LOCAL_EVENTS; ctx->flags |= CGRP_ROOT_MEMORY_LOCAL_EVENTS;
return 0; return 0;
case Opt_memory_nolocalevents:
ctx->flags &= ~CGRP_ROOT_MEMORY_LOCAL_EVENTS;
return 0;
case Opt_memory_recursiveprot: case Opt_memory_recursiveprot:
ctx->flags |= CGRP_ROOT_MEMORY_RECURSIVE_PROT; ctx->flags |= CGRP_ROOT_MEMORY_RECURSIVE_PROT;
return 0; return 0;
case Opt_memory_norecursiveprot:
ctx->flags &= ~CGRP_ROOT_MEMORY_RECURSIVE_PROT;
return 0;
} }
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment