diff --git a/.kiro/steering/resource-accounting.md b/.kiro/steering/resource-accounting.md index 19e12935..0616f74e 100644 --- a/.kiro/steering/resource-accounting.md +++ b/.kiro/steering/resource-accounting.md @@ -42,8 +42,16 @@ about what's free *right now*, not the host's total capacity. ## How admission control actually reads "available" (read this before the formula) The scheduler's admission check does **not** query the OS live at -decision time. `sched_check_host_satisfy_()` (`resource.c`) reads two -already-in-memory arrays and hands them to `unsatisfy_()`: +decision time — deliberately, not as an oversight. All candidate-host +resource information is injected into the scheduler once per session +(pushed by the worker, cached in `w->resvals`/`w->resInUse`); a single +scheduling session then evaluates many pending jobs against many +candidate hosts using that one cached snapshot, without re-querying +between decisions. Querying live on every candidate-host check a session +performs would multiply that already-high decision volume by a live I/O +round-trip each time — the cost this design avoids. `sched_check_host_ +satisfy_()` (`resource.c`) reads two already-in-memory arrays and hands +them to `unsatisfy_()`: ```c total = get_resvals(&(w->resvals), ...); // the worker's last-reported "mem" value