Drop memory-cg.conf
into /etc/init
. The upstart job will ensure
that the memory cgroup is configured with hierarchical stats tracking
before systemd-logind and/or docker start creating cgroups.
(Yes, it's mostly a crude hack with an obscure way of syncing with cgroup-lite. That can't be helped, though)
Edit /etc/default/grub
and append to GRUB_CMDLINE_LINUX_DEFAULT
swapaccount=1
.
You don't want to add it to GRUB_CMDLINE_LINUX
, since it would be applied even while
booting recovery mode kernels.
Run update-grub2
afterwards to apply the new configuration.
While it might sound otheros-like, you really have to reboot to pick up the new cgroup configuration, even if you haven't modified the kernel command line. The rationale behind this is that you'd have to stop nearly every service to safely get rid of existing cgroups, then start the new upstart job and restart everything else.
Rebooting is just easier - and it's required if you're enabling swap accounting.
I made some modifications due to various upstart "issues" (misfeatures, actually) but forgot to update the upstart job here.
I'll post the updated job ASAP.