Skip to content

systemd driver: zswap settings are reset on systemctl daemon-reload #75

Closed

Description

@MKrupauskas

With the systemd cgroup v2 driver, memory.zswap.max and memory.zswap.writeback set via unified are written only to cgroupfs. They aren't translated to systemd unit properties, so systemd resets them to its defaults on systemctl daemon-reload, silently discarding the container's zswap configuration.

The systemd driver is the recommended Kubernetes setup, so this blocks reliable zswap use in production. We've hit it in production at Uber.

Proposed fix: map them to the corresponding systemd properties, skipping them on older systemd, as is already done for AllowedCPUs:

from: https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html#MemoryZSwapMax=bytes
memory.zswap.max → MemoryZSwapMax (systemd >= v253)
memory.zswap.writeback → MemoryZSwapWriteback (systemd >= v256)

Activity

  1. kolyshkin commented on Oct 1, 2026

    @kolyshkin
    Contributor

    @MKrupauskas thanks for reporting this. Feel free to open a PR.

  2. added this to the 0.1.1 milestone on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions