Skip to content

Enable Memory CGroup swap controller #3886

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

Closed
tstevens opened this issue Oct 6, 2020 · 3 comments
Closed

Enable Memory CGroup swap controller #3886

tstevens opened this issue Oct 6, 2020 · 3 comments

Comments

@tstevens
Copy link

tstevens commented Oct 6, 2020

In PR #3644 the resolution 472be8a included support for memory cgroups but did not include support for the swap controller. I'm looking to see if that support can be added in as well.

When enabling the memory cgroup it is typical to see this snippet to add to your cmdline.txt 'cgroup_enable=memory swapaccount=1'. The current kernel does not support the swapaccount=1 portion so docker info for example will list WARNING: No swap limit support. My request would be to enable CONFIG_MEMCG_SWAP and unselect CONFIG_MEMCG_SWAP_ENABLED so the swap controller is only active when explicitly requested by 'swapaccount=1' and also only when the memory cgroup is enabled.

pelwell added a commit that referenced this issue Oct 7, 2020
Add support for memcg swap accounting, but leave it disabled by
default. Add "swapaccount=1" to the kernel command line to enable it.

See: #3886

Signed-off-by: Phil Elwell <[email protected]>
@pelwell
Copy link
Contributor

pelwell commented Oct 7, 2020

That seems very reasonable - the code involved is tiny. See 21155ec.

popcornmix added a commit to raspberrypi/firmware that referenced this issue Oct 7, 2020
kernel: configs: Add MEMCG_SWAP support initially disabled
See: raspberrypi/linux#3886

kernel: configs: Restore SND_PCM_OSS=m
See: raspberrypi/linux#3883

kernel: overlays: Add sd3078 to the i2c-rtc overlay
kernel: configs: Add CONFIG_RTC_DRV_SD3078=m
See: raspberrypi/linux#3881

kernel: Revert usb/dwc2: Set correct state on gadget disconnect
See: raspberrypi/linux#3885
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Oct 7, 2020
kernel: configs: Add MEMCG_SWAP support initially disabled
See: raspberrypi/linux#3886

kernel: configs: Restore SND_PCM_OSS=m
See: raspberrypi/linux#3883

kernel: overlays: Add sd3078 to the i2c-rtc overlay
kernel: configs: Add CONFIG_RTC_DRV_SD3078=m
See: raspberrypi/linux#3881

kernel: Revert usb/dwc2: Set correct state on gadget disconnect
See: raspberrypi/linux#3885
@popcornmix
Copy link
Collaborator

This is in latest rpi-update kernel

@tstevens
Copy link
Author

tstevens commented Oct 9, 2020

Pulled and works as expected, thanks!

@tstevens tstevens closed this as completed Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants