[Unit]
Description=Kernel Samepage Merging
DefaultDependencies=false
After=sysinit.target local-fs.target
Before=basic.target

[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo 1 > /sys/kernel/mm/ksm/run'
ExecStart=/bin/sh -c 'echo 400 > /sys/kernel/mm/ksm/pages_to_scan'
ExecStart=/bin/sh -c 'echo 10 > /sys/kernel/mm/ksm/sleep_millisecs'
RemainAfterExit=true

[Install]
WantedBy=multi-user.target