"A. Anno" <aannoaanno(a)gmail.com> writes:
Hello,
Kernel Samepage Merging (KSM) [1] seems to be an interesting linux
kernel feature and I wonder if I should expect it to work with
podman. On my Fedora 35 [2], I tried to enable it (both by `echo 1
>/sys/kernel/mm/ksm/run`, and with `ksmtuned`) and started a few
container instances _of the same_ (podman) image. But
`/sys/kernel/mm/ksm/pages_shared` always shows 0.
According to the KVM documention [3], it is supported there. But it
seems that KSM support is an application opt-in (with `int
madvise(addr, length, MADV_MERGEABLE)`).
Hence my question is: Is KSM supported with podman?
if you are using overlay as the backend and the same image for your
containers, then the memory is already deduplicated by the overlay file
system itself.
You should try using different images that contain similar files. In
this case KSM could help and you'll see different results.
Regards,
Giuseppe