Skip to main content

Module config

Module config 

Source
Expand description

Validated scheduling constants for the flow scheduler.

Copyright (c) 2026 Galih Tama galpt@v.recipes Holds the validated constants with defaults that match intf.h.

Re-exportsยง

use anyhow::Result; ๐Ÿ”’
use anyhow::bail; ๐Ÿ”’

Structsยง

Config
Validated scheduling constants.

Constantsยง

ADAPT_DAMP_SHIFT
Half-damp shift at 1. Halves the capped step once, so one correction moves at most one quarter base.
ADAPT_DEADBAND_MIN_NS
Proportional deadband floor in nanos at 8us. Keeps the quiet band above one tick on small slices.
ADAPT_DEADBAND_SHIFT
Proportional deadband shift at 5. Holds one thirty-second of the base as the quiet band with shifts only.
ADAPT_GROW_NS
Adaptive grow step in nanos at 64us frozen for wire compat only. Whitelisted with no use after the proportional law.
ADAPT_PROP_MAX_NS
Proportional adapt cap in nanos at 1ms. Caps one shift step.
ADAPT_PROP_SHIFT
Proportional adapt shift at 3. Maps exceed plus slack to one eighth.
ADAPT_SHRINK_NS
Adaptive shrink step in nanos at 128us frozen for wire compat only. Whitelisted with no use after the proportional law.
CAP_BASE
Base capacity in units at 1024. Symmetric hosts share the base.
DEF_QUANTUM_NS ๐Ÿ”’
Default fixed slice in nanos.
D_LAT_NS
Latency deadline bound in nanos at 4ms. Holds one twentieth period.
HINT_MAX
Max hint rows bound shared with the BPF header.
LAT_SLEEP_MIN_NS
Latency sleep floor in nanos at 20us. Vetoes only sleeps below this floor toward batch with no knob, so the 100us slice cap stays decoupled with no extra hold. Like fair.c, the floor paces service with no fixed priority hold. Unknown sleep fails open with no stall.
PERIOD_NS
Default period in nanos at 80ms. Holds four 20ms slices, so a fully used throughput task still leaves room for waits plus retries inside the period with no starvation under 20ms holds.
PRED_DEV_DOWN_SHIFT
Deviation narrow shift at 3. Moves the deviation one eighth toward a smaller error, so stable bursts keep margin.
PRED_DEV_MARGIN_SHIFT
Deviation margin shift at 1. Adds half deviation to the period, so the deadline holds average plus one and a half deviation.
PRED_DEV_UP_SHIFT
Deviation widen shift at 2. Moves the deviation one quarter toward a larger error, so ragged bursts gain margin fast.
PRED_DOWN_SHIFT
Predictor fall shift at 4. Moves the average one sixteenth toward a smaller sample, so bursts decay slow.
PRED_MAX_NS
Largest predictor value in nanos at 1s. Clamps long bursts.
PRED_MIN_NS
Least predictor value in nanos at 1. Clamps short bursts.
PRED_UP_SHIFT
Predictor rise shift at 3. Moves the average one eighth toward a larger sample, so bursts grow fast.
PREEMPT_MARGIN_NS
Preempt margin in nanos at 100us. Leads the occupant key, so near ties never bounce with no knob.
PREEMPT_TAIL_NS
Preempt tail in nanos at 100us. Holds the owner leftover, so nearly done owners finish with no knob.
QUANTUM_NS
Fixed slice in nanos at 1ms. Every insert uses this slice.
RED_EMAX_NS
RED bound in nanos at 256us. Caps the maximum exceeding time with the fixed bound shared by admit plus reclaim plus credit.
RED_TOL_NS
RED tolerance in nanos at 64us. Holds hard task slack only with the fixed value shared by admit plus reclaim.
SLICE_ENL_NS
Extended normal latency boundary in nanos at 5ms. Caps the T5 tier, so bulk I/O plus build bursts hold room with no starve.
SLICE_LAT_NS
Latency slice cap in nanos at 100us. Caps the dynamic slice plus the carryover plus the adapt step for latency work, so urgent wakeups rotate each tenth quantum with no extra hold. The cap equals the preempt tail, so a latency head at the cap never passes the tail gate and floors with no resume. Adapt steps cap at 1ms then re-clamp here, so one shift never holds past the cap. RED Emax stays at 256us past the cap, so a capped latency slice never pays as victim with no swap.
SLICE_LL_NS
Low latency boundary in nanos at 100us. Caps the T2 tier, so compositor plus UI bursts rotate each tenth quantum with no hold. Matches the latency slice cap, so urgent wakeups keep one bound.
SLICE_MAX_NS
Dynamic slice ceiling in nanos at 20ms. Caps the T6 tier plus the multi-tier spectrum, so throughput bursts hold room with an 80ms period guarding starvation.
SLICE_MIN_NS
Dynamic slice floor in nanos at 10us. Fresh waits clamp the saturated remaining time to this floor with the quantum ceiling.
SLICE_MLL_NS
Medium-low latency boundary in nanos at 500us. Caps the T3 tier, so IPC plus microservice bursts hold margin with no storm.
SLICE_NL_NS
Normal latency boundary in nanos at 1ms. Caps the T4 tier at one quantum, so desktop plus worker bursts rotate each quantum.
SLICE_ULL_NS
Ultra-low latency boundary in nanos at 50us. Caps the T1 tier, so audio plus frame pacing bursts pace tightly with no extra hold.
WEIGHT_BASE
Base weight with a neutral share.
WEIGHT_MAX
Largest weight admitted.
WEIGHT_MIN
Least weight admitted.