mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
One is related to the time distribution when a new child is created. If the parent has one tick left, then both child and parent received zero tick. When combined with current_irq_nest_count = 1 voluntary_preempt = 0 values, this caused the scheduler from being invoked. Second is related to the overall time distribution. When a thread runs out of time, its new time slice is calculated by the below formula: new_timeslice = (thread_prio * SCHED_TICKS) / total_prio If we consider total_prio is equal to the sum of the priorities of all the threads in the system, it imposes a problem of getting zero tick. In the new scenario, total_prio is equal to the priority types in the system so it is fixed. Every thread gets a timeslice in proportion of their priorities. Thus, there is no risk of taking zero tick.