@@ -6066,6 +6066,9 @@ int __init cgroup_init_early(void)
6066
6066
return 0 ;
6067
6067
}
6068
6068
6069
+ static u16 cgroup_enable_mask __initdata ;
6070
+ static int __init cgroup_disable (char * str );
6071
+
6069
6072
/**
6070
6073
* cgroup_init - cgroup initialization
6071
6074
*
@@ -6099,6 +6102,12 @@ int __init cgroup_init(void)
6099
6102
6100
6103
cgroup_unlock ();
6101
6104
6105
+ /*
6106
+ * Apply an implicit disable, knowing that an explicit enable will
6107
+ * prevent if from doing anything.
6108
+ */
6109
+ cgroup_disable ("memory" );
6110
+
6102
6111
for_each_subsys (ss , ssid ) {
6103
6112
if (ss -> early_init ) {
6104
6113
struct cgroup_subsys_state * css =
@@ -6741,6 +6750,10 @@ static int __init cgroup_disable(char *str)
6741
6750
strcmp (token , ss -> legacy_name ))
6742
6751
continue ;
6743
6752
6753
+ /* An explicit cgroup_enable overrides a disable */
6754
+ if (cgroup_enable_mask & (1 << i ))
6755
+ continue ;
6756
+
6744
6757
static_branch_disable (cgroup_subsys_enabled_key [i ]);
6745
6758
pr_info ("Disabling %s control group subsystem\n" ,
6746
6759
ss -> name );
@@ -6759,6 +6772,31 @@ static int __init cgroup_disable(char *str)
6759
6772
}
6760
6773
__setup ("cgroup_disable=" , cgroup_disable );
6761
6774
6775
+ static int __init cgroup_enable (char * str )
6776
+ {
6777
+ struct cgroup_subsys * ss ;
6778
+ char * token ;
6779
+ int i ;
6780
+
6781
+ while ((token = strsep (& str , "," )) != NULL ) {
6782
+ if (!* token )
6783
+ continue ;
6784
+
6785
+ for_each_subsys (ss , i ) {
6786
+ if (strcmp (token , ss -> name ) &&
6787
+ strcmp (token , ss -> legacy_name ))
6788
+ continue ;
6789
+
6790
+ cgroup_enable_mask |= 1 << i ;
6791
+ static_branch_enable (cgroup_subsys_enabled_key [i ]);
6792
+ pr_info ("Enabling %s control group subsystem\n" ,
6793
+ ss -> name );
6794
+ }
6795
+ }
6796
+ return 1 ;
6797
+ }
6798
+ __setup ("cgroup_enable=" , cgroup_enable );
6799
+
6762
6800
void __init __weak enable_debug_cgroup (void ) { }
6763
6801
6764
6802
static int __init enable_cgroup_debug (char * str )
0 commit comments