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

Resource Container Data Structures

Figure 2: Resource container structure
\begin{figure}\epsfig{file=FIGURES/rcds.eps,height=6cm,width=8cm}\end{figure}

Resource containers are first-class kernel objects. They have various attributes that are required for scheduling and resource accounting along with functions for various operations on containers (figure 2). Some of the important attributes are:

1. Mechanism Data: This contains the necessary data of the container mechanism. This includes reference count, the list of runnable threads and next thread to run in the scheduler binding of the container, the list of child containers and next container to run in the fixed share children list and shared children list, and the parent container. The resource container hierarchy is implemented using a left-child, right/left sibling data structure, with each container having a pointer to its parent. The reference count keeps track of the number of references to the resource container. A reference to a resource container can be from a child container, from a task as its resource binding or from the global file table.

2. Scheduler Data: This contains data necessary for the scheduler. This includes the weight or CPU reservation that this container is entitled to from parent, sum of the CPU reservations and weights of the child containers, CPU time allocated to this container and CPU time used by this container if this container is in the current path (i.e. the path from root to the current container in the container hierarchy), number of runnable threads in the scheduler binding of the container, and a runnable bit mask. Each bit in the runnable bit mask indicates whether the container is runnable for the scheduling class corresponding to the bit. A container is said to be runnable for a class if there is a task in its scheduler bindings which belongs to that class or if it has a child container which is runnable for that class.

3. Container specific functions: Each resource container can have its own scheduler function for each of the scheduling classes and its own update, init and delete functions. The update function is used to update the scheduler data. This is called by the scheduling routine of the child container before it gives the control of the CPU back to its parent (subsection 2.3). The init routine is called when a resource container is created or when the container specific function is changed by calling set_rc_functions() (section 2.5). This function may be used to initialise the resource container variables or to allocate space for container's private data. The delete function is called when the resource container is destroyed. This may be used to free the space allocated for private data. Each resource container has a pointer to a structure containing these function pointers.

4. Statistics: Statistics includes the total CPU usage of the container, the number of disk reads and writes, the number of network packets sent etc. Statistics will be propagated to the parent container, when the container is destroyed, if a flag RCPROPSTAT (i.e. propagate statistics flag) is set in the container.

5. Private Data: This can be used by the container specific scheduler and update routines.


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