x86: restore swap and enable zram, MGLRU and PSI - #146
Conversation
CONFIG_SWAP (along with CONFIG_VM_EVENT_COUNTERS) was dropped from this config in b085fa0, while the other variants kept it. A guest whose working set exceeds its krun.ram_mib ceiling can only OOM-kill: there is no other swap path (no block devices are exposed through podman+krun, and virtiofs cannot host swapfiles), so zram is the only viable in-guest backend. - CONFIG_ZRAM + zstd backend: inert until guest userspace initialises the device (disksize starts at 0) - CONFIG_LRU_GEN (MGLRU): strictly-better reclaim under anon-heavy pressure; default on mainstream distro kernels - CONFIG_VM_EVENT_COUNTERS, CONFIG_PSI: restore memory telemetry (pswpin/pswpout in /proc/vmstat, /proc/pressure/*) ZSMALLOC and CONFIG_ZRAM_DEF_COMP="zstd" materialise via make olddefconfig; ZSTD_COMPRESS/ZSTD_DECOMPRESS are already enabled. Refs: libkrun#145 Signed-off-by: Jeffrey Magder <jeff.magder@gmail.com>
|
Sounds like a good idea, thanks @jmagder ! Could you please sync these changes with the |
Sync the changes from the x86_64 config into the remaining non-confidential variants, as requested in review. Both already carry CONFIG_SWAP=y, CONFIG_ZSMALLOC=y, CONFIG_VM_EVENT_COUNTERS=y and CONFIG_PSI=y, so reaching the same end state only requires adding CONFIG_ZRAM with the zstd backend and CONFIG_LRU_GEN (MGLRU). MGLRU is included with zram deliberately: with swap enabled, the classic LRU can declare all_unreclaimable under anon-heavy pressure while swap is still free (field-observed on x86_64), so shipping the pair together avoids recreating that failure mode on these variants. The tdx and sev variants are left aside for now, per review. Refs: libkrun#145 Signed-off-by: Jeffrey Magder <jeff.magder@gmail.com>
|
Sure thing @slp! I added a new commit with the requested changes: I cross-built both variants locally ( |
CONFIG_LRU_GEN_ENABLED is a plain bool with no default in 6.12, so CONFIG_LRU_GEN=y alone leaves the multi-gen LRU compiled in but disabled at runtime (/sys/kernel/mm/lru_gen/enabled reads 0), and make olddefconfig keeps it unset. Caught by building the riscv64 variant and inspecting the materialised .config. Set it explicitly on all three variants that gained CONFIG_LRU_GEN, matching mainstream distro kernels (MGLRU default-enabled since 6.1). Refs: libkrun#145 Signed-off-by: Jeffrey Magder <jeff.magder@gmail.com>
|
Thanks @jmagder ! |
CONFIG_SWAP (along with CONFIG_VM_EVENT_COUNTERS) was dropped from this config in b085fa0, while the other variants kept it. A guest whose working set exceeds its krun.ram_mib ceiling can only OOM-kill: there is no other swap path (no block devices are exposed through podman+krun, and virtiofs cannot host swapfiles), so zram is the only viable in-guest backend.
ZSMALLOC and CONFIG_ZRAM_DEF_COMP="zstd" materialise via make olddefconfig; ZSTD_COMPRESS/ZSTD_DECOMPRESS are already enabled.
Refs: #145