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
fix(cgroup): enforce --memory-reservation/--memory-swap in-guest (#35 Part B) (#114)
Completes #35: with the dead host-side cgroup path removed (#113), these two
flags were left unenforced. Apply them in the in-guest per-container cgroup,
the same way #10 did for the CPU caps:
- ContainerCgroup::create gains memory_low (memory.low) + memory_swap_max
(memory.swap.max) params, written best-effort like the cpu limits.
- Run path: spec.rs emits A3S_SEC_MEM_LOW (from --memory-reservation) and
A3S_SEC_MEM_SWAP (from --memory-swap); guest main.rs reads them.
- CRI path: exec_server passes them through (parsed from the env; absent for
CRI, which has no soft-reservation concept, so they no-op there).
The hard --memory limit stays VM-sized (no A3S_SEC_MEM_LIMIT on the run path).
All cgroup resource limits are now enforced in ONE place (the in-guest cgroup).
Test: test_run_path_plumbs_memory_reservation_and_swap_to_guest asserts the two
A3S_SEC_MEM_* vars are emitted and A3S_SEC_MEM_LIMIT is not.
Co-authored-by: Roy Lin <roylin@a3s.box>
0 commit comments