wirenboard-agent-vm/Cargo.toml
Evgeny Boger b2cadc56d8 v0.1.23: msb jemalloc allocator (fix host RSS balloon)
Bumps the vendored msb to use jemalloc as its global allocator. On
many-core hosts glibc's per-thread malloc arenas (8*ncpu, 64 MiB each)
are retained and never returned to the OS under the sandbox supervisor's
Rust worker-thread churn (virtio-fs / block / blocking pools), ballooning
host RSS to 10-20+ GiB even for a `--memory 4` sandbox — the guest RAM is
a separate, correctly-capped mapping. jemalloc (background_threads on)
purges freed pages back to the OS, so host RSS tracks the live set.

Submodule bump: vendor/microsandbox -> msb-jemalloc-v0123 (jemalloc-only
diff on the v0.1.22 base). Verified: a fresh sandbox under heavy file/exec
churn held 0 glibc 64-MiB arenas at ~300 MiB RSS vs a live glibc sandbox
at 408 arenas / 5.2 GiB.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 00:45:40 +03:00

55 lines
2.7 KiB
TOML

[workspace]
resolver = "3"
members = ["crates/agent-vm"]
# microsandbox declares its own workspace under vendor/; keep it separate
# so Cargo doesn't try to absorb it into ours.
exclude = ["vendor/microsandbox"]
[workspace.package]
version = "0.1.23"
edition = "2024"
license = "MIT"
repository = "https://github.com/wirenboard/agent-vm"
# wirenboard's libkrun fork: msb_krun_* 0.1.13 with three fixes on top
# that are required for the userspace split irqchip to work and for the
# per-VM virtio-mmio cap to scale past ~11 devices:
# - virtio-console pre-activation panic guard (a3d4e3b) — without
# this, enabling split_irqchip(true) crashes the VMM during boot
# when a spurious epoll event hits the console device before the
# guest driver activates it.
# - mptable: emit one MP_INTSRC entry per IOAPIC pin (01d8661) — the
# pre-fix 16-entry table broke virtio-mmio probes on pin > 15.
# - cmdline overflow warning (faf8a58) — surfaces the otherwise
# silent x86 COMMAND_LINE_SIZE=2048 truncation in early boot.
# All sibling msb_krun_* crates are patched from the same git source
# because they share types across crate boundaries (e.g. msb_krun_vmm
# holds `dyn Subscriber` impls of msb_krun_devices' Console); mixing
# registry + git crates from the same cohort gives crate-identity
# mismatches even when the version numbers agree.
# Pinned to a specific commit so this Cargo.lock is reproducible;
# bump when filing the upstream PR is the right time to revisit.
[patch.crates-io]
msb_krun = { git = "https://github.com/wirenboard/libkrun", rev = "38e46f2" }
msb_krun_arch = { git = "https://github.com/wirenboard/libkrun", rev = "38e46f2" }
msb_krun_arch_gen = { git = "https://github.com/wirenboard/libkrun", rev = "38e46f2" }
msb_krun_cpuid = { git = "https://github.com/wirenboard/libkrun", rev = "38e46f2" }
msb_krun_devices = { git = "https://github.com/wirenboard/libkrun", rev = "38e46f2" }
msb_krun_hvf = { git = "https://github.com/wirenboard/libkrun", rev = "38e46f2" }
msb_krun_kernel = { git = "https://github.com/wirenboard/libkrun", rev = "38e46f2" }
msb_krun_polly = { git = "https://github.com/wirenboard/libkrun", rev = "38e46f2" }
msb_krun_smbios = { git = "https://github.com/wirenboard/libkrun", rev = "38e46f2" }
msb_krun_utils = { git = "https://github.com/wirenboard/libkrun", rev = "38e46f2" }
msb_krun_vmm = { git = "https://github.com/wirenboard/libkrun", rev = "38e46f2" }
[profile.release]
codegen-units = 16
lto = "thin"
strip = true
# For distribution builds where binary size / runtime perf matter most.
# Slower to build (single-threaded LTO + 1 codegen unit). Use: `cargo build --profile dist`.
[profile.dist]
inherits = "release"
codegen-units = 1
lto = "fat"