Apparently it is/was used to enable swap accounting, i.e. it tells the kernel to monitor and restrict swap usage per control groups (cgroups for short). RedHat seems to have started enabling it by default in RHEL7, so apparently the drawbacks are minimal.
You should check your kernel configuration (typically /boot/config-<kernel_version>
). If it includes the line:
CONFIG_MEMCG_SWAP=y
then the potential to track swap usage by cgroups exists, and the swapaccount=
boot option is available. Any actual restriction only takes effect if a cgroup with a swap limit is created, and a process is moved into that cgroup.
If it also includes the line:
CONFIG_MEMCG_SWAP_ENABLED=y
then swapaccount=1
is enabled by default, and you would need to use an explicit swapaccount=0
boot option to disable it if desired.
systemd
and Docker will use cgroups extensively as part of their normal functionality.
swapaccount=1
causes 2% performance degration. However, without it you cannot effectively limit swap usage at all and falling too heavy on swap will cause much worse degration than only 2% so I think you should be fine to enable it. I'd expect that 2% performance hit to only affect swapping so for most cases you should only see benefits from using that flag. – Mikko Rantalainen Sep 04 '21 at 14:50