diff options
Diffstat (limited to 'kernel/cgroup/cgroup.c')
-rw-r--r-- | kernel/cgroup/cgroup.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 217cec4e22c6..426a0026225c 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c | |||
@@ -1810,11 +1810,13 @@ int cgroup_show_path(struct seq_file *sf, struct kernfs_node *kf_node, | |||
1810 | 1810 | ||
1811 | enum cgroup2_param { | 1811 | enum cgroup2_param { |
1812 | Opt_nsdelegate, | 1812 | Opt_nsdelegate, |
1813 | Opt_memory_localevents, | ||
1813 | nr__cgroup2_params | 1814 | nr__cgroup2_params |
1814 | }; | 1815 | }; |
1815 | 1816 | ||
1816 | static const struct fs_parameter_spec cgroup2_param_specs[] = { | 1817 | static const struct fs_parameter_spec cgroup2_param_specs[] = { |
1817 | fsparam_flag ("nsdelegate", Opt_nsdelegate), | 1818 | fsparam_flag("nsdelegate", Opt_nsdelegate), |
1819 | fsparam_flag("memory_localevents", Opt_memory_localevents), | ||
1818 | {} | 1820 | {} |
1819 | }; | 1821 | }; |
1820 | 1822 | ||
@@ -1837,6 +1839,9 @@ static int cgroup2_parse_param(struct fs_context *fc, struct fs_parameter *param | |||
1837 | case Opt_nsdelegate: | 1839 | case Opt_nsdelegate: |
1838 | ctx->flags |= CGRP_ROOT_NS_DELEGATE; | 1840 | ctx->flags |= CGRP_ROOT_NS_DELEGATE; |
1839 | return 0; | 1841 | return 0; |
1842 | case Opt_memory_localevents: | ||
1843 | ctx->flags |= CGRP_ROOT_MEMORY_LOCAL_EVENTS; | ||
1844 | return 0; | ||
1840 | } | 1845 | } |
1841 | return -EINVAL; | 1846 | return -EINVAL; |
1842 | } | 1847 | } |
@@ -1848,6 +1853,11 @@ static void apply_cgroup_root_flags(unsigned int root_flags) | |||
1848 | cgrp_dfl_root.flags |= CGRP_ROOT_NS_DELEGATE; | 1853 | cgrp_dfl_root.flags |= CGRP_ROOT_NS_DELEGATE; |
1849 | else | 1854 | else |
1850 | cgrp_dfl_root.flags &= ~CGRP_ROOT_NS_DELEGATE; | 1855 | cgrp_dfl_root.flags &= ~CGRP_ROOT_NS_DELEGATE; |
1856 | |||
1857 | if (root_flags & CGRP_ROOT_MEMORY_LOCAL_EVENTS) | ||
1858 | cgrp_dfl_root.flags |= CGRP_ROOT_MEMORY_LOCAL_EVENTS; | ||
1859 | else | ||
1860 | cgrp_dfl_root.flags &= ~CGRP_ROOT_MEMORY_LOCAL_EVENTS; | ||
1851 | } | 1861 | } |
1852 | } | 1862 | } |
1853 | 1863 | ||
@@ -1855,6 +1865,8 @@ static int cgroup_show_options(struct seq_file *seq, struct kernfs_root *kf_root | |||
1855 | { | 1865 | { |
1856 | if (cgrp_dfl_root.flags & CGRP_ROOT_NS_DELEGATE) | 1866 | if (cgrp_dfl_root.flags & CGRP_ROOT_NS_DELEGATE) |
1857 | seq_puts(seq, ",nsdelegate"); | 1867 | seq_puts(seq, ",nsdelegate"); |
1868 | if (cgrp_dfl_root.flags & CGRP_ROOT_MEMORY_LOCAL_EVENTS) | ||
1869 | seq_puts(seq, ",memory_localevents"); | ||
1858 | return 0; | 1870 | return 0; |
1859 | } | 1871 | } |
1860 | 1872 | ||
@@ -6325,7 +6337,7 @@ static struct kobj_attribute cgroup_delegate_attr = __ATTR_RO(delegate); | |||
6325 | static ssize_t features_show(struct kobject *kobj, struct kobj_attribute *attr, | 6337 | static ssize_t features_show(struct kobject *kobj, struct kobj_attribute *attr, |
6326 | char *buf) | 6338 | char *buf) |
6327 | { | 6339 | { |
6328 | return snprintf(buf, PAGE_SIZE, "nsdelegate\n"); | 6340 | return snprintf(buf, PAGE_SIZE, "nsdelegate\nmemory_localevents\n"); |
6329 | } | 6341 | } |
6330 | static struct kobj_attribute cgroup_features_attr = __ATTR_RO(features); | 6342 | static struct kobj_attribute cgroup_features_attr = __ATTR_RO(features); |
6331 | 6343 | ||