Build1 distinct publisher3 min readUpdated
A dev.to writeup samples /proc/<pid>/task/<tid>/schedstat on a 16-core host and finds the intuitive ratio ranks an idle kernel thread above workers genuinely denied a core.
The Engineer · Build desk
Compiled by The EngineerSomething wrong?How this is made
A dev.to writeup samples /proc/<pid>/task/<tid>/schedstat on a 16-core host and finds the intuitive ratio ranks an idle kernel thread above workers genuinely denied a core.
A writeup published on dev.to takes one 16-core Linux host through a quiet regime and a saturated one, sampling per-thread runqueue wait out of /proc/<pid>/task/<tid>/schedstat, a file that is already on every host you run [1][7]. The useful result is not the file; it is that the obvious way to normalise it inverts the ranking, putting an idle kernel thread ahead of application threads that were actually denied a core [11][16][17].
The file holds three numbers: nanoseconds this thread spent on the CPU, nanoseconds it spent waiting on a runqueue while runnable, and the count of timeslices it ran [1][2]. On PID 1 of the test host that read as 297508187061 22806177929 768442 [3]. Field two is the operationally distinct one, because it is not blocked on I/O, not sleeping, not idle: it is ready to run and denied a core, which the author calls the only kind of waiting a bigger machine would have fixed [4]. That is the line between the two failure modes operators keep conflating. A thread parked on a socket read contributes nothing to field two, and adding cores will not move it. A thread with seconds in field two is telling you there was more runnable work than cores.
Nothing standard reports this per thread. /proc/pressure/cpu says how much of the last ten seconds some task spent stalled on a runqueue, and top says who is burning CPU; neither names the thread that wanted the CPU and did not get it, and as the author puts it, "The one burning CPU is winning" [5][6]. The instrument is two snapshots of every thread's schedstat, a sleep, and a subtraction, printed as wait seconds, run seconds, and a fraction, sorted both ways [8].
The fraction is wait/(wait+run) [9]. On the quiet machine, load average 5.12 across 16 cores, roughly 32 percent of core count, the top thread by fraction was ksoftirqd/10 at 94.7 percent [10][23][11]. Its wait was 0.003 seconds over a three-second window, with run time too small to print at millisecond resolution [11][12]. Machine-wide, all 85 waiting threads together booked 0.018 seconds of runqueue wait [13].
Then four concurrent whisper.cpp transcriptions, eight threads each: 32 runnable threads on 16 cores, two times oversubscribed, load average 11.14 and climbing [14][22]. All four runs returned byte-identical correct transcripts of the JFK sample, so this was real work rather than a spinlock imitating one [15]. The top three threads by absolute wait sat at 2.063, 2.013 and 1.972 seconds of queue time, against 1.075, 1.147 and 1.190 seconds of run time [16]. Those three alone accumulated 6.048 seconds of runqueue wait in a three-second window, about 336 times the entire quiet machine's total [19][20]. The worst of them spent 69 percent of wall clock runnable and not running [21].
Their fractions were 65.7, 63.7 and 62.4 percent [16] - below the idle ksoftirqd. The author's summary: the starved thread waited 690 times longer and scored 29 points lower, so an alarm keyed on the fraction fires continuously on an idle box and quietens when work actually starves [17][18]. The denominator is the problem. A thread that wakes, queues briefly, runs for microseconds and sleeps pins the ratio near 100 percent; threads doing sustained work dilute it with run time.
What to watch: page on absolute wait-seconds per window, divided by the window rather than by run time, and aggregate it by process or cgroup before it reaches a dashboard. Then check whether your own hosts expose the field at all, and whether the reading is stable across sampling windows, because all of the above comes from one 16-core machine in one writeup [7].
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
The author states the genuinely starved thread waited 690 times longer and scores 29 points lower on the fraction metric than the idle ksoftirqd thread.
The author concludes that any alarm keyed on the fraction fires continuously on an idle machine and gets quieter when work actually starves.
Per-thread scheduling data is available at /proc/<pid>/task/<tid>/schedstat as three numbers.
The three schedstat fields are: nanoseconds the thread spent on the CPU, nanoseconds it spent waiting on a runqueue while runnable, and the number of timeslices it ran.
A live read of /proc/1/schedstat on the test host returned: 297508187061 22806177929 768442.
The second schedstat field is not blocked on I/O, not sleeping, not idle: it is time ready to run and denied a core, described by the author as the only kind of waiting a bigger machine would have fixed.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Checkable first-party measurements from a single unreplicated host
The piece is unusually self-verifiable for a community blog post: it publishes the raw schedstat read, the entire measurement script, both regimes' tables, and a workload whose output correctness was checked (identical whisper.cpp transcripts with an md5), and the key inversion is also demonstrated within one reading rather than only across regimes. What caps the score is scope: one author, one 16-core machine, one kernel/scheduler configuration, no independent replication and no second publisher.
No adoption evidence in supplied sources
The only observation available is the author's own measurement run on his own machine. The supplied material contains no third-party deployment, no release or download data, no disclosure of any team or product using this technique or metric, and no evidence about how widely wait-percentage metrics actually appear in monitoring stacks. Adoption cannot be scored without inventing facts.
Mildly overstated: universal prescription from an n=1 host
The demonstration is honest and the mechanism argument (a self-normalized ratio whose denominator is the thread's own runnable time) is structural rather than host-specific, so the gap is small. It is positive rather than zero because the headline prescription ('do not turn it into a percentage', any fraction-keyed alarm inverts) generalizes to all Linux boxes from two readings on one 16-core machine, with no cross-kernel, container-quota or alternative-tooling comparison offered.
Low: no product, vendor or commercial ask
Nothing in the source sells anything: the instrument is a self-contained shell script using stock /proc interfaces, the load generator is an open-source binary, and there is no vendor, sponsor, paid tool, pricing or hiring pitch. The residual incentive is the ordinary one of a personal post on a community platform benefiting from a contrarian headline, which is why the score is not near zero.
Moderate: strong internal artifacts, single source and single host
Confidence is held down by structure rather than quality. Every claim traces to one publisher and one machine, and adoption is unmeasurable, so corroboration is absent; but the artifacts inside the source (raw counters, complete script, verified workload, within-reading inversion) make the narrow technical claims about schedstat and the wait fraction reliable enough to act on.
build
The balance check that runs before the debit is CWE-367, not a guardrail1 distinct publisher
build
Force the tool call, then hand Lightsail a long-lived key1 distinct publisher
build
AI-written code fails the same four ways, and every gate you own reports green1 distinct publisher
build
CSA's 2026 threat list is a flat line, so ask which threats a config snapshot can prove1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 15, 2026