Skip to content

cgroup: Use kernel command line to disable memory cgroup #6439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/broadcom/bcm2708-rpi-bt.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

/ {
chosen {
bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0";
bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0 cgroup_disable=memory";

Check failure on line 27 in arch/arm/boot/dts/broadcom/bcm2708-rpi-bt.dtsi

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 116 exceeds 100 columns
};

aliases {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/broadcom/bcm270x.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/ {
chosen: chosen {
// Disable audio by default
bootargs = "coherent_pool=1M snd_bcm2835.enable_headphones=0";
bootargs = "coherent_pool=1M snd_bcm2835.enable_headphones=0 cgroup_disable=memory";
stdout-path = "serial0:115200n8";
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/broadcom/bcm2711-rpi-cm4s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@

/ {
chosen {
bootargs = "coherent_pool=1M snd_bcm2835.enable_headphones=0 numa_policy=interleave";
bootargs = "coherent_pool=1M snd_bcm2835.enable_headphones=0 cgroup_disable=memory numa_policy=interleave";

Check failure on line 151 in arch/arm/boot/dts/broadcom/bcm2711-rpi-cm4s.dts

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 123 exceeds 100 columns
};

aliases {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/ {
chosen {
bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0 numa_policy=interleave";
bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0 cgroup_disable=memory numa_policy=interleave";

Check failure on line 6 in arch/arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 139 exceeds 100 columns
};

__overrides__ {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/broadcom/bcm271x-rpi-bt.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

/ {
chosen {
bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0";
bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0 cgroup_disable=memory";

Check failure on line 27 in arch/arm/boot/dts/broadcom/bcm271x-rpi-bt.dtsi

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 116 exceeds 100 columns
};

aliases {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/broadcom/bcm2712-rpi.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

/ {
chosen: chosen {
bootargs = "reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe numa_policy=interleave iommu_dma_numa_policy=interleave system_heap.max_order=0";
bootargs = "reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave iommu_dma_numa_policy=interleave system_heap.max_order=0";

Check failure on line 102 in arch/arm64/boot/dts/broadcom/bcm2712-rpi.dtsi

View workflow job for this annotation

GitHub Actions / checkpatch review

WARNING: line length of 191 exceeds 100 columns
stdout-path = "serial10:115200n8";
};

Expand Down
15 changes: 1 addition & 14 deletions kernel/cgroup/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -6060,9 +6060,6 @@ int __init cgroup_init_early(void)
return 0;
}

static u16 cgroup_enable_mask __initdata;
static int __init cgroup_disable(char *str);

/**
* cgroup_init - cgroup initialization
*
Expand Down Expand Up @@ -6096,12 +6093,6 @@ int __init cgroup_init(void)

cgroup_unlock();

/*
* Apply an implicit disable, knowing that an explicit enable will
* prevent if from doing anything.
*/
cgroup_disable("memory");

for_each_subsys(ss, ssid) {
if (ss->early_init) {
struct cgroup_subsys_state *css =
Expand Down Expand Up @@ -6742,10 +6733,6 @@ static int __init cgroup_disable(char *str)
strcmp(token, ss->legacy_name))
continue;

/* An explicit cgroup_enable overrides a disable */
if (cgroup_enable_mask & (1 << i))
continue;

static_branch_disable(cgroup_subsys_enabled_key[i]);
pr_info("Disabling %s control group subsystem\n",
ss->name);
Expand Down Expand Up @@ -6779,7 +6766,7 @@ static int __init cgroup_enable(char *str)
strcmp(token, ss->legacy_name))
continue;

cgroup_enable_mask |= 1 << i;
cgroup_feature_disable_mask &= ~(1 << i);
static_branch_enable(cgroup_subsys_enabled_key[i]);
pr_info("Enabling %s control group subsystem\n",
ss->name);
Expand Down
Loading