feat(kernel/posix-timer): 实现 POSIX interval timer,修复 gVisor timers_test#1501
Merged
fslongjin merged 1 commit intoDragonOS-Community:masterfrom Dec 18, 2025
Merged
Conversation
Member
fslongjin
commented
Dec 18, 2025
- 新增 timer_create/timer_settime/timer_gettime/timer_getoverrun/timer_delete 系统调用处理,并接入 syscall table
- 实现进程级 POSIX interval timer:基于 CLOCK_MONOTONIC 的创建/删除/设置/查询、周期性重装与到期调度
- 完整实现 SIGEV_NONE/SIGEV_SIGNAL/SIGEV_THREAD_ID(限制 THREAD_ID 只能指向当前线程)与 SI_TIMER siginfo(含 si_timerid/si_overrun/si_value)
- 修复 overrun 语义与信号合并:按线程 pending 队列合并并累积 overrun,避免重复入队导致进程被信号杀死
- 修复周期性 timer 的 gettime 剩余时间计算与回调窗口返回 0 的问题(PeriodicSilent)
- 修复定时器回调中信号锁/队列访问导致的自锁死(PeriodicGroupDirectedSignal)
- clear_child_tid/robust futex 相关用户内存访问改为异常表保护,并避免在失败时继续 futex 操作
- 新增 timer_create/timer_settime/timer_gettime/timer_getoverrun/timer_delete 系统调用处理,并接入 syscall table - 实现进程级 POSIX interval timer:基于 CLOCK_MONOTONIC 的创建/删除/设置/查询、周期性重装与到期调度 - 完整实现 SIGEV_NONE/SIGEV_SIGNAL/SIGEV_THREAD_ID(限制 THREAD_ID 只能指向当前线程)与 SI_TIMER siginfo(含 si_timerid/si_overrun/si_value) - 修复 overrun 语义与信号合并:按线程 pending 队列合并并累积 overrun,避免重复入队导致进程被信号杀死 - 修复周期性 timer 的 gettime 剩余时间计算与回调窗口返回 0 的问题(PeriodicSilent) - 修复定时器回调中信号锁/队列访问导致的自锁死(PeriodicGroupDirectedSignal) - clear_child_tid/robust futex 相关用户内存访问改为异常表保护,并避免在失败时继续 futex 操作 Signed-off-by: longjin <longjin@DragonOS.org>
Member
Author
|
@claude review this PR in Chinese |
|
Claude finished @fslongjin's task in 7m 47s —— View job PR #1501 代码审查审查任务: 审查POSIX interval timer实现PR 待办事项:
代码审查报告总体评价这是一个高质量的PR,实现了完整的POSIX interval timer功能。代码结构清晰,考虑了信号合并、overrun计数、死锁预防等复杂问题,且遵循了项目的现有模式。实现符合Linux语义,修复了gVisor timers_test测试。 主要优点
详细审查反馈1. 核心实现 (
|
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.