Skip to main content

record

Function record 

Source
pub fn record(stat: KernelStat)
Expand description

Record one dispatch attempt.

A DIAGNOSTIC MUST NOT SERIALIZE THE COMPUTATION IT OBSERVES. This ring is written from the dense-product dispatch seam (try_fast_ab), which every fast_ab in the workspace passes through — including the small products a Rayon fan-out issues thousands of times per outer evaluation, and including the ones the size gate declines before any device is consulted. Behind a single process-wide Mutex those writes were not a diagnostic but a serialization point: on the #979 rigid marginal-slope arm at 16 threads a frame-pointer profile put 19.5 % of the whole run inside this function and a further 14.8 % in lock_contended beneath it, and the arm’s 40-minute wall carried 325 minutes of system time against 188 of user time — sixteen threads taking turns in the kernel to maintain a 1024-entry ring whose contents at that call rate are the last microsecond of history.

Each thread therefore keeps its own ring and takes only its own lock. The recorded SET is unchanged: every attempt, device-bound or not, is still kept, and no ring is discarded when its thread ends. Only the interleaving of different threads’ entries changes, and a ring written by racing threads never defined one.