Expand description
What the host’s memory leaves runners beside its other programs (ADR 0055): the slice’s runners may hold what
they hold now without page cache plus the host’s MemAvailable, less a margin kept for the host’s page cache, so
reclaim stays cheap; and nothing starts while the host, short of memory, stalls for it. Each bound has
hysteresis, so a host at the edge does not start and hold runners by turns. Pure: the engine passes in the
reading and what it remembers of the last plan.
Structs§
- Remembered
- What admission remembers of the host from the last plan.
Constants§
- STALL_
ENTER - Starts stop once every runnable task of the host waits for memory this share of the last 10 s, in hundredths of
a percent: 5%, while the host is short of memory (
stalls). - STALL_
LEAVE - Once stopped, starts resume when that share falls under this: 1%.
Functions§
- budget
- What
memoryleaves runners beside thereservedmemory of what runs in the slice, given what the last planremembered. - left
- What a host
limitleaves new runners beside thereservedmemory of what runs in the slice: negative by what they reserve past it, none while the host isstalled. A runner that stops gives its reservation back to this, so a deficit stays owed rather than hidden byHostBudget::spare, which stops at 0. - limit
- What
memorylets the slice’s runners hold in all: what the slice holds now without page cache plusMemAvailable, less the margin, larger while the host isshort. - margin
- The margin
MemAvailablekeeps beside the runners’ predicted peaks for a host withtotalmemory: the larger ofMARGIN_MINandtotal / MARGIN_SHARE, half again as much while the host isshort. - stalls
- Whether
memory’s stall shares say the host stalls for memory, given whether it did at the last plan. A stall counts only whileMemAvailableis under twice the margin: the shares are the whole host’s, and a runner reclaiming at its own cap raises them with memory to spare, which starts elsewhere do not make worse.