@@ -6051,6 +6051,9 @@ int __init cgroup_init_early(void)
6051
6051
return 0 ;
6052
6052
}
6053
6053
6054
+ static u16 cgroup_enable_mask __initdata ;
6055
+ static int __init cgroup_disable (char * str );
6056
+
6054
6057
/**
6055
6058
* cgroup_init - cgroup initialization
6056
6059
*
@@ -6084,6 +6087,12 @@ int __init cgroup_init(void)
6084
6087
6085
6088
cgroup_unlock ();
6086
6089
6090
+ /*
6091
+ * Apply an implicit disable, knowing that an explicit enable will
6092
+ * prevent if from doing anything.
6093
+ */
6094
+ cgroup_disable ("memory" );
6095
+
6087
6096
for_each_subsys (ss , ssid ) {
6088
6097
if (ss -> early_init ) {
6089
6098
struct cgroup_subsys_state * css =
@@ -6724,6 +6733,10 @@ static int __init cgroup_disable(char *str)
6724
6733
strcmp (token , ss -> legacy_name ))
6725
6734
continue ;
6726
6735
6736
+ /* An explicit cgroup_enable overrides a disable */
6737
+ if (cgroup_enable_mask & (1 << i ))
6738
+ continue ;
6739
+
6727
6740
static_branch_disable (cgroup_subsys_enabled_key [i ]);
6728
6741
pr_info ("Disabling %s control group subsystem\n" ,
6729
6742
ss -> name );
@@ -6742,6 +6755,31 @@ static int __init cgroup_disable(char *str)
6742
6755
}
6743
6756
__setup ("cgroup_disable=" , cgroup_disable );
6744
6757
6758
+ static int __init cgroup_enable (char * str )
6759
+ {
6760
+ struct cgroup_subsys * ss ;
6761
+ char * token ;
6762
+ int i ;
6763
+
6764
+ while ((token = strsep (& str , "," )) != NULL ) {
6765
+ if (!* token )
6766
+ continue ;
6767
+
6768
+ for_each_subsys (ss , i ) {
6769
+ if (strcmp (token , ss -> name ) &&
6770
+ strcmp (token , ss -> legacy_name ))
6771
+ continue ;
6772
+
6773
+ cgroup_enable_mask |= 1 << i ;
6774
+ static_branch_enable (cgroup_subsys_enabled_key [i ]);
6775
+ pr_info ("Enabling %s control group subsystem\n" ,
6776
+ ss -> name );
6777
+ }
6778
+ }
6779
+ return 1 ;
6780
+ }
6781
+ __setup ("cgroup_enable=" , cgroup_enable );
6782
+
6745
6783
void __init __weak enable_debug_cgroup (void ) { }
6746
6784
6747
6785
static int __init enable_cgroup_debug (char * str )
0 commit comments