benilla-re systems structs docs

s_schedulerCallGuard

global · core

Address
0x832cc0 · 4 bytes, up to 0x832cc3
Type
int32_t
Meaning
Holds -1 plus the number of scheduler calls in flight
Confidence
verified, proof one
Finding
core/scheduler#load-accounting

Finding: Load accounting in core: scheduler

0x832cc0 holds -1 at rest and counts the scheduler calls in flight: AcquireSlot, ReleaseSlot, 0x421370, 0x421570 and 0x4222a0 increment it on entry and decrement it on exit, and the balancing in 0x421570 runs only when its own increment returns 0. A slot keeps a cost sum (+0x10), a context count (+0x18) and a mean (+0x14, sum / count, 0 when empty). RemoveContextLoad (0x421370) takes a context's cost +0x50 off its slot and recomputes the mean. To each other slot whose mean is nonzero and whose sum is at least this slot's plus its mean it adds (that sum - this sum) / that mean to its credit +0x1c, capped at its context count.

The derivation is in the doc.