decisions DECIDED

138. How a saturated workload is made to hand threads across cores

Answered by calef on 2026-09-02, on the one question that was blocking. Written by a research lane on 2026-09-01, after milestone 219 (the boot tour ends and the kernel halts, so there is nothing to soak) measured that it never happens today.

calef approved option D, the --features soak hook that signals a routed rendezvous from sched::on_tick, so soak workers block on it through the Irq::WAIT that already exists. It adds no system call and nothing of it exists in a production build. That unblocks the second half of fatal risk 5's decisive experiment, which had never been runnable.

Two things stay open on purpose and neither is blocking.

Option A, thread affinity, is not refused; it is not yet asked. It is system call surface, so this section gives options rather than a recommendation, and it should be taken on its own merits rather than carried in on the back of an experiment D can run without it. What the prior art narrowed: the core belongs in a capability rather than in a message, and DECISIONS §28 already chose the shape at ratification. What is still calef's: singleton per core or narrowable set, and whether it is a new object or a field of one that exists.

Option B, a periodic rebalancer, is declined rather than dismissed, and the Linux sourcing weakened the case against it. nife already has counterparts for three of Linux v6.12's four balancing moments, all event-driven, and a saturated rendezvous workload starves all three of their triggers, which is why the crossing count freezes. B is the fourth moment, the only one that fires on a clock and the only one that workload cannot starve, so calling it "importing Linux's answer" overstated what it is. The refusal now rests on DECISIONS §28's own reopening trigger, a real workload where fairness visibly fails, which has not fired. A reader who believes it has should reopen B, and that sentence is here so nobody has to relitigate the whole section to do it.

The number is provisional. This lane cannot see the other lanes running beside it, so the integrator mints the real section number at merge, the same as every other name global to the tree.

What is being decided

design/fatal-risks.md's fifth entry, it cannot be made reliable on multicore, and the bugs appear only on silicon, names its decisive experiment as sustained multi-core stress on the boards. Milestone 219 built that stress and found the experiment is two experiments, of which it delivers one:

So: what mechanism gets threads crossing cores under load, and what does the tree pay for it permanently?

The premise, verified by this lane rather than taken from the milestone

The premise run and the code behind it are in premise.md.

What this tree already does in the analogous case

The other precedents are in premise.md. The one that stays here:

A feature-gated kernel affordance built only to make an experiment possible is established practice. kernel/Cargo.toml carries fastpath_pad, which adds a large reachable-but-never-taken function to the IPC fast path so milestone 134 (the register of measures)'s footprint experiment has something to compare. It also carries watchdog_probe, which adds a test that deliberately livelocks and is expected to fail the run. Neither ships. soak itself is the third. So an affordance that exists only under --features soak crosses no line this tree has not already crossed on purpose. Milestone 219 established the hygiene that goes with it: script/lint clippies the feature, and script/fastpath-footprint proves the production binary is byte-identical.

The prior art, read rather than recalled

prior-art.md holds seL4, L4Re, Barrelfish and QNX. linux.md holds Linux v6.12's load balancing.

The maintainer's three-moment summary was substantively right, and this is a re-cut rather than a correction. It folded the tickless case into the idle one, where the source puts it beside the periodic one, since a NOHZ kick makes a busy CPU run the balancer for idle neighbors. sched_setaffinity is not on this list because it is a request from userspace rather than a moment the kernel chooses.

What this is evidence of, and it is not that Linux is careless. Linux has to guess continuously because almost nothing ever tells it anything. It schedules unknown binaries for users who never declare a placement. The interface that would let them exists (sched_setaffinity), but the kernel cannot assume it was called, so its working inputs are load, topology and history. Four sampling points plus a push is what it takes to keep an arbitrary workload spread without being told. That is a harder scheduling problem than nife has, and the machinery is proportionate to it rather than excessive. The contrast with seL4 and Barrelfish is about the premise, not about the quality of either answer. They assume the application knows where its threads belong and make that a right it holds, so there is nothing left for the kernel to infer. nife's §28 (SMP placement) sits on the second premise, and milestone 219's frozen counter is what the second premise looks like from a bench.

What the prior art decides, and what it leaves open

The options

A. Thread affinity: a program says where a thread runs

What it is. A placement request a program can make. §28's own deferred wording puts it in the spawn manifest, where it is a property of a thread being created rather than a method on one that exists.

Option A's working is in options.md.

Reversibility. Low. A manifest field is a wire format two programs agree on, which is the move fast on what can be undone tenet's first irreversible category. Nobody has acted on it yet, which is the one thing in its favor.

B. A periodic rebalancer in the scheduler

What it is. Kernel policy: on some tick boundary, move a thread from a loaded queue to a lighter one.

Reversibility. High, and it is the only option here that is. §28's own changeability note says so: "this is scheduler-internal policy. No ABI, no capability semantics, no baseline movement".

What the prior art says about it, and it is the strongest single argument in this document. No capability microkernel read for this proposal rebalances threads at all. seL4 does not, on the record and in the source, and its authors' stated reason is "seL4's general philosophy of having all resource management under user control (and also helps reasoning about real-time properties)". Barrelfish does not, structurally. Linux does, and offers turning it off as a first-class control (cpuset.cpus.partition set to "isolated", "Partition root without load balancing"). So the behavior milestone 219 measured and read as a gap is the design position of the kernel this project measures itself against. B would be the one option that moves nife away from it in order to run a test.

Option B's working is in options.md.

C. A userspace-drivable interrupt source

Option C is in options.md.

D. A soak-only, kernel-side interrupt raiser (this lane's finding, and it was measured)

What it is. Under --features soak and nowhere else, the kernel signals a routed rendezvous from inside a real interrupt handler, and soak workers block on it through the existing Irq::WAIT. No system call is added. Nothing exists in a production build.

How option D was read, run and costed is in options.md.

What it does not reach, said precisely because a claim of "the real path" is worth nothing without it: the interrupt controller's own claim, mask and complete sequence (the PLIC on riscv64, the GIC on aarch64) is not exercised. That is because the timer is not a controller-routed source. The experiment is about the wake protocol, and that is what this runs.

refused, mismatch and stalled stayed at zero throughout both runs. The spike is not committed to this branch and this document is the only thing that survives it. The patch is a scratch file, deliberately, because shipping it is the decision being asked for rather than a thing a research lane may do.

Reversibility. Highest of the four. A feature-gated affordance is deleted by deleting it, nobody outside the tree can act on it, and no program is written against it.

Recommendation

On the reversible part, this lane recommends D, and recommends building it before deciding A.

The reason is not that D is cheaper, which would be an argument from implementation convenience and this tree refuses those. It is that D tests the path the defect was on and A tests the path beside it. Milestone 219's whole lesson was that an instrument near the question is not an instrument that answers it, and choosing A here would repeat that mistake at the level of the experiment rather than the counter. D also leaves the machine unchanged when nobody is testing, which was the property the maintainer's provisional pick of A was reaching for. D has it more completely: A is inert only if no program uses it, and a mechanism that is only inert by convention is rung four.

On the irreversible part, this lane gives options and does not recommend. A is system call surface and its capability question is genuinely open. This document's contribution to it is to narrow what must be decided rather than to decide it:

B is declined, and the refusal is the valuable half. Not because it would not work, but for two reasons that compound. It changes what the scheduler promises in every boot forever to make one experiment possible, and §28 named the trigger for reopening scheduling policy as a real workload where fairness visibly fails; there is no such workload. And the prior art says the thing it would add is the thing seL4 and Barrelfish deliberately do not have, for reasons this project shares. If one appears, B comes back on its own merits with something to tune against, which it does not have today.

The Linux reading weakened that refusal without overturning it, and the weakening is stated here rather than buried. B is the fourth of four balancing moments, three of which nife already has, so "importing Linux's answer" overstates it; and it is the only moment a saturated workload cannot starve, which is a real argument that nothing in this tree had made. What survives is the second reason and not the first. The cost is not the mechanism, it is the tuning surface, and Linux is the evidence for how large that surface gets and for the fact that it is only tunable against workloads. The refusal now rests on §28's trigger alone. A reader who thinks that trigger has been met should reopen B, and this paragraph is the invitation.

C is declined in favor of D, having established that its userspace half already exists and its kernel half does not need a system call.

What is blocked until this is answered

Answered 2026-09-02: D approved. The list below is what was blocked, kept because it records what the decision bought rather than what remains.

What was considered and refused