Skip to content

fix(ax-fs-ng): repoll IRQ-driven block waits#1313

Closed
ZR233 wants to merge 1 commit into
rcore-os:codex/rebase-serial-irq-modelfrom
ZR233:codex/pr-1265-fix-board-ci
Closed

fix(ax-fs-ng): repoll IRQ-driven block waits#1313
ZR233 wants to merge 1 commit into
rcore-os:codex/rebase-serial-irq-modelfrom
ZR233:codex/pr-1265-fix-board-ci

Conversation

@ZR233

@ZR233 ZR233 commented Jun 18, 2026

Copy link
Copy Markdown
Member

问题

PR #1265 的 OrangePi-5-Plus self-hosted board CI 在 npu-yolov8/orangepi-5-plus 用例中超时。日志显示系统已经注册 rockchip-sdhci IRQ-driven block device,但随后停在 ext4 mount 阶段的 Syncing filesystem...,没有进入 shell 和 NPU demo。

这说明失败点不是 YOLO demo 本身,而是 IRQ-driven block completion 等待路径在 ext4 sync/mount 期间可能丢失进展唤醒,导致等待任务一直睡住。

修改

  • ax-fs-ng 的 IRQ-driven block wait 路径中加入 task-side repoll 兜底:等待请求或队列进展时,会继续主动 poll pending requests,并在未完成时 yield。
  • 保留原有 IRQ/drain 快路径;该修改只是在等待侧补齐进展保障,避免单次 IRQ hint/wake 丢失后永久卡住。
  • 队列级等待在自轮询完成后主动移除 queue progress waiter,避免遗留 waiter。
  • 更新 block runtime 回归测试,覆盖 IRQ-driven 模式下没有外部 drain hint 时仍能通过 repoll 完成请求的情况。

验证

  • cargo fmt
  • cargo test -p ax-fs-ng --features ext4 block_runtime -- --nocapture
  • cargo xtask clippy --package ax-fs-ng
  • cargo xtask starry test board -c npu-yolov8 --board orangepi-5-plus
  • cargo xtask board connect -b OrangePi-5-Plus,Linux 启动时 fsck.ext4 报 rootfs clean
  • git diff --check

@mai-team-app mai-team-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review 总结

PR 内容: 在 ax-fs-ng 的 IRQ-driven block wait 路径中加入 task-side repoll 兜底机制,修复 OrangePi-5-Plus board CI 在 ext4 mount 期间因 IRQ wake 丢失导致系统永久挂起的问题。

实现逻辑: 将原先依赖 task_wait_until(被动等待 IRQ 唤醒)的 IRQ-driven 完成等待替换为主动 repoll 循环。新增 wait_with_repoll_for_any_keywait_with_repoll_for_queue_empty 两个方法,在等待期间主动调用 poll_batch 驱动 I/O 完成,未完成时 yield(普通任务)或 spin_loop(中断上下文)。这样即使单次 IRQ hint/wake 丢失,任务也能通过自轮询推进。原有 IRQ/drain 快路径保持不变。

额外 bug fix: 旧代码在 wait_for_queue_progress 的 IRQ 路径中从未调用 remove_queue_progress_waiter,会遗留 waiter。新代码在 wait_with_repoll_for_queue_empty 返回后正确移除 waiter。

本地验证结果:

  • cargo fmt --check -p ax-fs-ng ✅ 通过
  • cargo clippy -p ax-fs-ng --all-features -- -D warnings ✅ 通过
  • cargo test -p ax-fs-ng --features ext4 block_runtime -- --nocapture ✅ 37 个测试全部通过

CI 状态: 所有 CI check run 为 skipped(base 分支 codex/rebase-serial-irq-model 为特性分支,CI 工作流可能仅在 dev 等主分支触发)。PR 作者已在 body 中记录了 board 级验证(cargo xtask starry test boardcargo xtask board connect)。

重复/重叠分析: PR #1313 以 PR #1265codex/rebase-serial-irq-model)为 base,是其 CI 失败的定向修复。其他 open PR(#1315#1316#1317)均以 dev 为 base,涉及 vPLIC backend 和 VmPeak/VmHWM,与本 PR 无重叠。

测试覆盖: 修改后的测试 irq_driven_wait_repolls_without_external_drain_hint 验证了 IRQ-driven 模式下无需外部 drain hint 即可通过 repoll 完成请求,直接覆盖了修复场景。

结论: 代码修改清晰、范围小且聚焦,修复了真实的挂起 bug,同时额外修复了 waiter 泄漏问题。无 blocking issue。

Powered by mimo-v2.5-pro

@ZR233 ZR233 closed this Jun 22, 2026
@ZR233
ZR233 deleted the codex/pr-1265-fix-board-ci branch June 29, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant