test(starry): cover LoongArch timer rearm path#1360
Closed
ZR233 wants to merge 1 commit into
Closed
Conversation
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.
问题
#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。nanosleep(),验证 sleep 能持续被 timer 唤醒。timerfd_settime()+ blockingread(),验证重新 arm 后每次事件都能到达。验证
cargo fmtcargo xtask starry test qemu --arch loongarch64 --test-case qemu-smp1/system/bugfix-bug-loongarch-timer-rearmplatform = loongarch64-plat-dyn33 pass, 0 failSTARRY_GROUPED_TESTS_PASSED