Skip to content

Commit 0892051

Browse files
authored
feat(base): disable proactive memory compaction in guest (#2553)
Adds `vm.compaction_proactiveness=0` to the base template's `/etc/sysctl.conf` so kcompactd no longer runs background page migrations in the guest. 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 snapshot-aligned benefit. The pre-pause `compact_memory` write (#2551) does the work deterministically right before we capture state. Existing templates inherit the change on rebuild.
1 parent 3b3f8d9 commit 0892051

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • packages/orchestrator/pkg/template/build/phases/base

packages/orchestrator/pkg/template/build/phases/base/provision.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ EOF
7575
echo "Increasing inotify watch limit"
7676
echo 'fs.inotify.max_user_watches=65536' | tee -a /etc/sysctl.conf
7777

78+
# Disable kcompactd background page migration. With 2 MiB host-side hugepage
79+
# backing of guest RAM, every migration dirties a destination hugepage from
80+
# the host UFFD's perspective and lands in the next memfile diff, with no
81+
# corresponding workload benefit between snapshots. We trigger compaction
82+
# explicitly pre-pause instead.
83+
echo "Disabling proactive memory compaction"
84+
echo 'vm.compaction_proactiveness=0' | tee -a /etc/sysctl.conf
85+
7886
echo "Don't wait for ttyS0 (serial console kernel logs)"
7987
# This is required when the Firecracker kernel args has specified console=ttyS0
8088
systemctl mask serial-getty@ttyS0.service

0 commit comments

Comments
 (0)