Check out the new USENIX Web site. next up previous
Next: rc_schedule() routine Up: The RCLinux Resource Container Previous: Global Data Structures

Resource Container Scheduler Framework

Each resource container has its own scheduling function (rc_scheduler) for each scheduling class. This can be in a loadable module and can be set on the fly using the set_rc_functions() system call (see section 2.5). The rc_scheduler function is passed the resource container and the class as the arguments. It returns the task that is to be scheduled next. The class is passed as an argument since it can use the same scheduling function for each of the classes. Similar is the reason for passing the resource container.

When rc_scheduler is called, the resource container structure will have two of its variables cpu_allotted and cpu_used set. This invocation of the scheduler is allowed to allocate (cpu_allotted - cpu_used) amount of CPU time to its child containers which are marked runnable for that particular class or to tasks in its scheduler binding belonging to that class. When it is allocating a CPU for a child container, it sets the cpu_allotted value of that container to the required amount and returns by calling the class specific scheduler routine of child container. If it is allocating CPU for a task, then it sets cpu_allotted in the task structure of that process and returns the process. When cpu_used is greater than cpu_allotted it first calls the update function of parent, with this container as the argument, and then returns by calling the class specific scheduler function of the parent. The update routine updates the cpu_used of the parent by adding to it cpu_used of the child and sets cpu_allotted and cpu_used of the child to 0. Any priority re-computation that has to be done is also done in the update routine.


next up previous
Next: rc_schedule() routine Up: The RCLinux Resource Container Previous: Global Data Structures
Mansoor Alicherry 2001-05-01