From 479a399d4fb73a5c37fbcbb55a74d6eca0243c58 Mon Sep 17 00:00:00 2001 From: ValentaTomas Date: Sun, 3 May 2026 18:21:42 -0700 Subject: [PATCH] feat(base): disable proactive memory compaction in guest kcompactd's background migrations dirty destination 2 MiB host hugepages without producing a snapshot-aligned benefit, inflating memfile diffs. We trigger compaction explicitly pre-pause instead. --- .../pkg/template/build/phases/base/provision.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/orchestrator/pkg/template/build/phases/base/provision.sh b/packages/orchestrator/pkg/template/build/phases/base/provision.sh index ce307bee0e..c4c1b934d0 100644 --- a/packages/orchestrator/pkg/template/build/phases/base/provision.sh +++ b/packages/orchestrator/pkg/template/build/phases/base/provision.sh @@ -75,6 +75,14 @@ EOF echo "Increasing inotify watch limit" echo 'fs.inotify.max_user_watches=65536' | tee -a /etc/sysctl.conf +# Disable kcompactd background page migration. With 2 MiB host-side hugepage +# backing of guest RAM, every migration dirties a destination hugepage from +# the host UFFD's perspective and lands in the next memfile diff, with no +# corresponding workload benefit between snapshots. We trigger compaction +# explicitly pre-pause instead. +echo "Disabling proactive memory compaction" +echo 'vm.compaction_proactiveness=0' | tee -a /etc/sysctl.conf + echo "Don't wait for ttyS0 (serial console kernel logs)" # This is required when the Firecracker kernel args has specified console=ttyS0 systemctl mask serial-getty@ttyS0.service