Skip to main content

Module kvm_address_space

Module kvm_address_space 

Source
Expand description

Refuse to start the KVM backend under a finite address-space limit.

reverie-kvm reserves host address space for guest memory (its README, “Host address space”): the guest memory size Hermit gives it for every live guest process, once more while an exec validates its new image, and, for an exited child, until the child’s host thread releases it, which can be after the parent has gone on. RLIMIT_AS counts every reserved byte, though only the pages a guest touches use memory. The peak therefore follows the guest’s process tree and the host’s thread scheduling, and a run under a finite limit stops wherever those put it: on the same command one run completes and the next does not (https://github.com/rrnewton/reverie/issues/1225). Hermit refuses such a run before the guest starts instead, by name and on every run.

This is launch policy, about Hermit’s own process. It never raises the limit, and it does not touch the guest’s view of RLIMIT_AS, which Detcore models as before. The backend still refuses, by name, an exec whose memory a host refuses for another reason (a limit lowered after launch, vm.max_map_count), and the run ends on that refusal.

Structs§

KvmAddressSpaceRefusal
A named, pre-guest refusal of a finite RLIMIT_AS on the KVM backend.

Functions§

admit_kvm_address_space
Refuses (KvmAddressSpaceRefusal) when this process, which is about to run the KVM backend, has a finite soft RLIMIT_AS; the backend would reserve guest_memory_bytes for each guest memory.