Skip to content

test(starry): cover LoongArch timer rearm path#1360

Closed
ZR233 wants to merge 1 commit into
rcore-os:devfrom
ZR233:codex/fix-loongarch-timer-deadlock
Closed

test(starry): cover LoongArch timer rearm path#1360
ZR233 wants to merge 1 commit into
rcore-os:devfrom
ZR233:codex/fix-loongarch-timer-deadlock

Conversation

@ZR233

@ZR233 ZR233 commented Jun 24, 2026

Copy link
Copy Markdown
Member

问题

#1211 中提到 LoongArch 动态平台在 shell 后会出现 workload-independent 空转/卡住。根因是 LoongArch one-shot timer IRQ 的 ACK 顺序:如果在 dispatch_irq() / 动态平台 dispatch 之后才清当前 timer interrupt,dispatch 内部重新设置的下一次 one-shot 事件可能已经变成 pending,随后迟到的 ACK 会把这个新事件一起清掉,导致依赖 timer 的 sleep / timeout / timerfd 路径不再被唤醒。

当前 dev 已经在 LoongArch static 与 dynamic 平台路径中把 ACK 调整到了 dispatch 之前。本 PR 增加一个针对该行为的 Starry 回归用例,避免后续回退时只在长耗时 app 用例中才暴露。

修改

  • test-suit/starryos/qemu-smp1/system 增加 bugfix-bug-loongarch-timer-rearm 子用例。
  • starry_arch_filtered_executable 将真实测试限定在 loongarch64,其他架构编译为明确 skip。
  • 测试内容覆盖两条会反复重新 arm one-shot timer 的路径:
    • 多轮短 nanosleep(),验证 sleep 能持续被 timer 唤醒。
    • 多轮 one-shot timerfd_settime() + blocking read(),验证重新 arm 后每次事件都能到达。

验证

  • cargo fmt
  • cargo xtask starry test qemu --arch loongarch64 --test-case qemu-smp1/system/bugfix-bug-loongarch-timer-rearm
    • 启动日志确认 platform = loongarch64-plat-dyn
    • 新增用例输出 33 pass, 0 fail
    • 匹配 STARRY_GROUPED_TESTS_PASSED

@ZR233 ZR233 closed this Jun 24, 2026
@ZR233
ZR233 deleted the codex/fix-loongarch-timer-deadlock 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