notes: Patch C Phase 4 plan (item 1 only — collapse sdio_rx_work into BH) #9

Merged
marfrit merged 1 commits from claude-noether-7 into main 2026-05-07 17:21:37 +00:00
Collaborator

Phase 4 plan for Patch C, scoped to item 1 only per merged PR #8 inline review ("sequential, not on the clock"). Item 2 splits to Patch C2 (Task #23, gated on Task #19 kerneldoc contract verification).

Summary

  • Approach: Option A — sdio_rx_work delivers directly into wsm_handle_rx, removing self->rx_queue and its two spin_lock(&rx_queue_lock) sites per frame. Smaller diff than subsuming into bh thread (Option B); cleaner Phase-7 attribution.
  • Predicted delta: §4.5 — _raw_spin_unlock_irqrestore 20% → 12-15% (medium confidence; rx_queue lock is one of several contributors), observed receive 75-725 KB/s → ≥ 1.0 MB/s sustained @ 4 MB/s (medium; rep 3's link death has multiple causes).
  • Risks: §4.6 — 6 listed, of which two require Phase 6 contract citations (wsm_handle_rx callability from sdio_wq, wsm_release_tx_buffer's bh-wake invariant).
  • Phase 7: stress ramp 1→2→4→8 MB/s with N=3 reps post-patch, per feedback_phase7_stress_ramp. Pre-patch baseline must capture two metrics not currently on file: bes_sdio workqueue dispatch rate and mac80211:drv_rx_irqsafe count. Phase 6 cannot start until those are filled in.
  • Out of scope (deferred): symptom-shaped findings (asm volatile("nop"), commented-out __bes2600_irq_enable(1), BUG_ON in hot path) — Task #24 observation after Patch E lands, per feedback_dont_patch_downstream_artifacts.

Phase 5 handover

Goal/Situation/Measurements/Plan are in §0–§4 verbatim. Markus initiates the DokuWiki paste-in for second-model review when ready. Do not curate — including the medium-confidence predictions and the §4.6 risk list.

What's NOT in this PR

  • No code yet. Phase 6 is contingent on Phase 5 passing.
  • No Patch C2 plan. That's blocked on Task #19 + Patch C completion (per user split-for-bisection directive).
Phase 4 plan for Patch C, scoped to **item 1 only** per merged PR #8 inline review ("sequential, not on the clock"). Item 2 splits to **Patch C2** (Task #23, gated on Task #19 kerneldoc contract verification). ## Summary - **Approach:** Option A — `sdio_rx_work` delivers directly into `wsm_handle_rx`, removing `self->rx_queue` and its two `spin_lock(&rx_queue_lock)` sites per frame. Smaller diff than subsuming into bh thread (Option B); cleaner Phase-7 attribution. - **Predicted delta:** §4.5 — `_raw_spin_unlock_irqrestore` 20% → 12-15% (medium confidence; rx_queue lock is one of several contributors), observed receive 75-725 KB/s → ≥ 1.0 MB/s sustained @ 4 MB/s (medium; rep 3's link death has multiple causes). - **Risks:** §4.6 — 6 listed, of which two require Phase 6 contract citations (wsm_handle_rx callability from sdio_wq, wsm_release_tx_buffer's bh-wake invariant). - **Phase 7:** stress ramp 1→2→4→8 MB/s with N=3 reps post-patch, per `feedback_phase7_stress_ramp`. Pre-patch baseline must capture two metrics not currently on file: `bes_sdio` workqueue dispatch rate and `mac80211:drv_rx_irqsafe` count. Phase 6 cannot start until those are filled in. - **Out of scope (deferred):** symptom-shaped findings (`asm volatile("nop")`, commented-out `__bes2600_irq_enable(1)`, BUG_ON in hot path) — Task #24 observation after Patch E lands, per `feedback_dont_patch_downstream_artifacts`. ## Phase 5 handover Goal/Situation/Measurements/Plan are in §0–§4 verbatim. Markus initiates the DokuWiki paste-in for second-model review when ready. **Do not curate** — including the medium-confidence predictions and the §4.6 risk list. ## What's NOT in this PR - No code yet. Phase 6 is contingent on Phase 5 passing. - No Patch C2 plan. That's blocked on Task #19 + Patch C completion (per user split-for-bisection directive).
claude-noether added 1 commit 2026-05-07 17:05:23 +00:00
Per merged PR #8 inline review: items 1 and 2 split, sequential. Patch C
is item-1-only (collapse the sdio_rx_work → rx_queue → bh_work
indirection). Patch C2 (ieee80211_rx_list batch delivery) is split out
and gated on Task #19 kerneldoc contract verification.

Approach choice: Option A (sdio_rx_work delivers directly into
wsm_handle_rx, removing rx_queue and its two synchronization points per
frame) over Option B (subsume into bh thread). Option A has a smaller
diff and clearer bisection story; the residual per-IRQ workqueue
dispatch is preserved as a measurable Phase 7 data point that motivates
or doesn't motivate a follow-on Option-B patch.

Predicted delta in Phase 3 units, with confidence levels stated
explicitly. §4.6 lists 6 risks, of which 2 require Phase 6 contract
citations (wsm_handle_rx callability from sdio_wq context;
wsm_release_tx_buffer's bh-wake invariant). §4.8 mandates a stress
ramp in Phase 7, not a steady cap, per feedback_phase7_stress_ramp.

Symptom-shaped findings (asm nop, commented-out IRQ re-enable, BUG_ON
in hot path) explicitly deferred to Task #24 per
feedback_dont_patch_downstream_artifacts.

Awaiting Phase 5 second-model review on DokuWiki.
marfrit merged commit 4666e03254 into main 2026-05-07 17:21:37 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marfrit/besser#9