Skip to content

sched/sched: Replace nxsched_alarm_tick_expiration() with nxsched_tick_expiration()#17199

Merged
xiaoxiang781216 merged 5 commits into
apache:masterfrom
wangchdo:tick_less_improve
Oct 18, 2025
Merged

sched/sched: Replace nxsched_alarm_tick_expiration() with nxsched_tick_expiration()#17199
xiaoxiang781216 merged 5 commits into
apache:masterfrom
wangchdo:tick_less_improve

Conversation

@wangchdo
Copy link
Copy Markdown
Contributor

Introduce a new function nxsched_tick_expiration() to replace
nxsched_alarm_tick_expiration(). The new function provides a
common implementation that can be shared by both the alarm
and timer architectures.

This change reduces code duplication and provides a unified
function that can be directly reused.

Note: Please adhere to Contributing Guidelines.

Summary

Improve nuttx kernel tickless implementation,

Impact

Improve nuttx kernel tickless implementation,
No impact to user interface
No impact to other nuttx functions

Testing

ostest passed on board a2g-tc397-5v-tft

image

…ks()

    In the current NuttX kernel implementation, there is no function
    to represent pure scheduler ticks.
    The existing clock_systime_ticks() cannot serve this purpose,
    because it keeps increasing even when the scheduler is not running.
    This happens since the returned value reflects real hardware time:
    as long as the timer or alarm hardware is active,
    clock_systime_ticks() will continuously increase.

    This patch introduces two new functions that provide access to
    scheduler ticks — a counter that only increases when the scheduler
    itself is running.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
   Replace direct usage of g_system_ticks with clock_increase_sched_ticks()
   and clock_get_sched_ticks()

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
   Improve nxclock_gettime(), to get the system time excluding
   the time that the system is suspended, when the clockid is
   CLOCK_MONOTONIC

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
    Enlarge kflash memory size for the sam3u-ek board
    to resolve the build error.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
@github-actions github-actions Bot added Area: Drivers Drivers issues Area: OS Components OS Components issues Size: S The size of the change in this PR is small labels Oct 15, 2025
Comment thread sched/sched/sched_timerexpiration.c Outdated
@github-actions github-actions Bot added the Size: M The size of the change in this PR is medium label Oct 17, 2025
    Introduce a new function nxsched_tick_expiration() to replace
    nxsched_alarm_tick_expiration(). The new function provides a
    common implementation that can be shared by both the alarm
    and timer architectures.

    This change reduces code duplication and provides a unified
    function that can be directly reused.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
@wangchdo
Copy link
Copy Markdown
Contributor Author

fixed a CI build error, please check again @xiaoxiang781216

@xiaoxiang781216 xiaoxiang781216 merged commit 519ffe6 into apache:master Oct 18, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Drivers Drivers issues Area: OS Components OS Components issues Board: arm Size: M The size of the change in this PR is medium Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants