Repository navigation
Conversation
SchedPass::begin drains the mailbox before the pass knows its disposition, so a fair wake posted on the poster's own CPU was judged behind the running task in the very pass that parks or ends that task, and was forwarded to an idle CPU: an IPI and a cold cache where a local switch a moment later was free. osbench's same-CPU pingpong rows held their placement in none of 53 T14 boots, which is what this forward predicts; a thread started and then joined meets it at the join. The opening drain now holds what it finds behind the running task, and each disposition places it against the CPU as it leaves it: after a park, a stop or an exit it runs here; before a yield or with the task kept it is forwarded as before. Only the opening drain holds, so the CPU's own later drains are unchanged. WakeCause gains `parker`, the CPU whose task posted the wake and parks next in the same call. The home CPU hands such a fair wake to that CPU inside one LLC, where the poster's park runs it and the pair's later wakes are local. No caller sets it yet: it is the placement input the whole-message IPC's combined call drives in its phase 2. The simulator's turn_taking_pair holds the first half across seeds: both threads start on cpu0 beside an idle cpu1 with balancing off, and no turn is forwarded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b24b37a added CpuSched::held and ::holding without entries in tripwire_field, so a shadow mismatch inside either was reported as the nearest field below it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SchedPass::begindrains the mailbox before the pass knows its disposition. A fair wake posted on the poster's own CPU was judged against the running task in the very pass that parks or ends that task, and was forwarded to an idle CPU: an IPI and a cold cache where a local switch a moment later was free. The same forward moves communicating pairs apart. In fs-rtt's r2 sweep on the AMD bench, a client that landed on the server's CPU had the server forwarded away (10→14, 14→8), and a pair split across the two CCXs pays about 1.9 µs per round trip (read_4k_at 16.1–16.4 µs in one LLC against 19.9–20.4 µs across).Behaviour
Step 1: the opening drain holds any wake that would queue behind the running task. Each disposition then places it against the CPU as it leaves it:
Only the opening drain holds.
Step 2:
WakeCause::parks_next(cpu)names the CPU of a poster that parks next. The home CPU hands such a fair wake there inside one LLC, and the poster's park runs it. No caller sets it yet; it is the placement input for the IPC phase-2 combined call.Checks
cargo run -- --ci host161fc1e1cwas dropped from this branchcargo test -p kernel --lib,cargo test -p kernel-sim, kernel clippyb24b37a56turn_taking_pairover 40 seeds: no turn forwarded off its CPU.The rebase changed nothing these checks cover, so the host CI result carries over.
Evidence and what is still owed
370d7d9f6; rows: osbench's pingpongsame_cpu, ipc,wake.onto_busy,spawn_costand fs-rtt'sfsrtt.*from osbench: files reads read_4k_at's parts, fstat, and the file server's client alone #1103. This PR's effect is read from the ipc and fsrtt rows.Risks
🤖 Generated with Claude Code