I have read Sprunt’s paper in 1989 and Stanovich’s paper in 2010 about sporadic server.
I have a few questions when looking at the source code:
1.What are the requirements for setting a round robin type of thread, and where are round robin threads used for?
2.whats the difference between sporadic and constant band-width? I didnt see related discription in those paper,is there any explanations?
3.In the refill_budget_check function code, when the head refill is not sufficient, how to ensure the following refills is activated by current time ?
1.What are the requirements for setting a round robin type of thread, and where are round robin threads used for?
Round robin threads have budget == period. They are intended to have the same semantics as the non-MCS kernel threads. Several threads at the same priority that are round robin are allowed to execute until the end of their timeslice and are then appended to the back of the scheduler queue.
2.whats the difference between sporadic and constant-bandwidth? I didnt see related discription in those paper,is there any explanations?
The main difference is that sporadic tasks accumulate budget while they are active but preempted by a higher priority task. When the task is resumed, it can still use the budget that wasn’t spent while it was preempted. While a constant-bandwidth task doesn’t retain budget if it’s pre-empted by a higher priority task.
3.In the refill_budget_check function code, when the head refill is not sufficient, how to ensure the following refills is activated by current time ?
I’m not completely sure what you mean here. When the head refill is insufficient the task is out of budget. If the remaining budget is negative (which could happen if the timer tick is late due to platform effects) then the next activation time is moved further into the future to still charge the budget to future timeslices. (This strategy is described in Defects of the POSIX Sporadic Server and How to Correct Them | IEEE Conference Publication | IEEE Xplore I believe).
Otherwise the kernel requires that the head refill has to have sufficient budget to leave and reenter the kernel (MIN_BUDGET) for the thread to retain sufficient budget.