xiaoxiang781216 commented on code in PR #17065:
URL: https://github.com/apache/nuttx/pull/17065#discussion_r2386500375


##########
sched/sched/sched_timerexpiration.c:
##########
@@ -424,16 +427,22 @@ static clock_t nxsched_timer_start(clock_t ticks, clock_t 
interval)
       interval = interval <= (CONFIG_TIMER_ADJUST_USEC / USEC_PER_TICK) ? 0 :
                  interval - (CONFIG_TIMER_ADJUST_USEC / USEC_PER_TICK);
 
-#ifdef CONFIG_SCHED_TICKLESS_ALARM
+#ifdef CONFIG_HRTIMER
+    ret = hrtimer_start(&g_hrtimer_systick_timer,
+                        NSEC_PER_TICK * (ticks + interval),

Review Comment:
   > Nuttx was originally designed as a tick-based framework with a simple and 
efficient architecture, making it suitable for use on lower-frequency CPUs like 
the Cortex-M. HRtimers are merely an alternative.
   > 
   
   if hrtimer still uses the tick unit, I would suggest you improve wdog 
implementation directly instead adding a new similar interface.
   
   > Also, we cannot switch all timer systems to HRtimers, as this would 
degrade overall system performance. HRtimers are only suitable for 
high-frequency CPUs with real-time requirements.
   
   hrtimer is bound to the tickless mode natively to support the accuracy lower 
than 1tick. So, here is my suggestion:
   
   1. Improve the performance of wdog(timer wheel or RB-tree) directly
   2. Implement hrtimer to get more accuracy timer(ns unit)
   3. decouple hrtimer from the tickless mode(make hrtimer work in the tick 
mode)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to