Skip to content

Conversation

@Fix-Point
Copy link
Contributor

Summary

This main changes of this PR include:

  1. Removed nxsched_tick_expiration() function: The tick expiration logic has been integrated into nxsched_process_timer() to simplify the scheduler architecture. Previously, nxsched_tick_expiration() was called from platform-specific code when the tickless timer expired, but now this functionality is handled directly within nxsched_process_timer().

  2. Simplified hrtimer API:

    • Changed hrtimer_start() to accept the callback function as a parameter instead of storing it during initialization. The hrtimer is designed to replace the wdog timer in future, so it should have the callback function in its API. The evaluation results showed there is no any performance degradation since the CPU pipeline can hide the latency.
    • Simplified type declarations by using typedef for hrtimer_t and hrtimer_node_t
    • Modified timer armed state checking to use the callback function pointer instead of RB-tree parent pointer
  3. Updated documentation: All references to nxsched_tick_expiration() in documentation have been updated to nxsched_process_timer(). Additionally, outdated documentation for watchdog timer functions (wd_restart() and wd_restart_next()) has been removed, and high-resolution timer (hrtimer) documentation has been updated to reflect API changes.

Impact

Documentation:

  • Documentation has been updated to reflect the new function names and API changes.
  • Outdated wdog timer documentation has been removed.

Performance:

  • The hrtimer changes aim to improve code clarity without performance degradation.
  • The consolidated timer handling may reduce function call overhead in tickless mode.

Testing

Tested on rv-virt:smp, ostest passed

The hrtimer is designed to replace the wdog timer in future, so it
should have the callback function in its API. The evaluation results showed there is no any
performance degradation since the CPU pipeline can hide the latency.
This commit also decoupled the rb-tree implementation with the pending
state checking.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit simplifed the type declaration.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit updated the documentation.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit updated the documentation.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit removed nxsched_tick_expiration to simplify the scheduler.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit updated the comments and docs after removing the
nxsched_tick_expiration.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
@github-actions github-actions bot added Area: Documentation Improvements or additions to documentation Area: Drivers Drivers issues Area: OS Components OS Components issues Size: M The size of the change in this PR is medium labels Jan 13, 2026
Copy link
Contributor

@GUIDINGLI GUIDINGLI left a comment

Choose a reason for hiding this comment

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

LGTM

@GUIDINGLI GUIDINGLI merged commit 4514a11 into apache:master Jan 13, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Area: Drivers Drivers issues Area: OS Components OS Components issues Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants