mirror of
https://github.com/apache/nuttx.git
synced 2026-09-09 02:16:35 +00:00
In tickless mode, the scheduler timer is stopped whenever the currently running task requires no time slicing (CLOCK_MAX). When a SCHED_RR task was later switched in, nothing re-armed the timer, so the task could run indefinitely without round-robin rotation. Also, when a SCHED_RR task was preempted, its timeslice counter was not decremented for the time already consumed, effectively giving the task "bonus" CPU time when resumed. Solve both by performing RR accounting on context switches: - nxsched_suspend_roundrobin() charges the elapsed execution time against the timeslice of the RR task being switched out - nxsched_resume_roundrobin() restarts the scheduler timer for the remaining timeslice of the RR task being switched in, so the timer is always armed while an RR task is running This also removes the previous workaround in nxsched_process_timer that triggered the scheduler on every timer tick. Assisted-by: Zhipu GLM-5.3 Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com> |
||
|---|---|---|
| .. | ||
| addrenv | ||
| clock | ||
| environ | ||
| event | ||
| group | ||
| hrtimer | ||
| init | ||
| instrument | ||
| irq | ||
| misc | ||
| module | ||
| mqueue | ||
| paging | ||
| pthread | ||
| sched | ||
| semaphore | ||
| signal | ||
| task | ||
| timer | ||
| tls | ||
| wdog | ||
| wqueue | ||
| CMakeLists.txt | ||
| Kconfig | ||
| Makefile | ||