You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: memory tuning knobs and memory tracing in integration tests
Every leaf and machine is a QEMU VM, and QEMU RSS behaves as a high-water
mark: the guest touches all of its RAM through the page cache eventually,
so a guest started with -m 4096 stays resident at ~4 GiB no matter how
little it actually needs. virtio-balloon with free page reporting barely
helps because the page cache keeps almost nothing on the free lists.
Add three opt-in knobs, all defaulting to the previous behaviour:
MINI_LAB_LEAF_MEMORY / MINI_LAB_MACHINE_MEMORY guest RAM, substituted
into the topologies. All three launchers read QEMU_MEMORY (SONiC
launch.py, machine launch.py and vrnetlab for the dell flavors).
MINI_LAB_KSM host kernel samepage merging, dedupes the identical
guest RAM of leaf01/leaf02 and of the machine VMs
MINI_LAB_THP transparent hugepage policy
KSM and THP are host global and are applied/reverted by
scripts/memory-tuning.sh, which records the pristine values so the host
is left as it was found.
scripts/memory-profile.sh bundles the knobs into one-factor-at-a-time
profiles (baseline, low-memory, ksm, thp-madvise, all) so each knob can
be measured on its own. baseline pins KSM and THP explicitly instead of
leaving them untouched, so a comparison is not skewed by the host state.
scripts/memory-trace.py samples host and per-container memory plus QEMU
RSS into a CSV; scripts/memory-report.py renders per-run summaries and a
cross-run comparison. The integration test starts the tracer and stops it
in an EXIT trap, so a profile that is too tight for a flavor still
produces data instead of nothing.
The integration workflow builds its matrix from flavors x profiles. Pull
requests and pushes run baseline only so regular CI cost is unchanged;
workflow_dispatch defaults to the full matrix. Runs are serialised
because the host level numbers would otherwise be contaminated by
concurrent labs. Each run uploads its trace, and a final job merges them
into a per-flavor comparison table.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments