Check out the new USENIX Web site. next up previous
Next: RCLinux Kernel Modifications and Up: RCLinux Resource Container APIs Previous: RCLinux Resource Container APIs

System Calls

System calls are provided for the users to make use of resource containers. Most of these system calls take the resource container descriptor as one of the arguments.

All the APIs except set_rc_functions were defined in [6]. But we have added the pid argument to get_rc and set_res_binding to make them more useful. pid was required as the argument to control the resources allocated to the processes which do not use the APIs (eg. an already existing application). This also gives the system administrator more control.

  1. int rc_create(void)

    This creates a new resource container and associates a file descriptor for the process with it. It returns the descriptor.

  2. int get_rc(int pid)

    This returns a descriptor for the resource container to which the process pid is bound. If pid is zero, the descriptor of the container of the calling process is returned. The permissions for obtaining the resource container descriptor of a process is the same as that of sending a signal to the process (ie. the calling process must either have root privileges, or the real or effective user ID of the sending process must equal the real or saved set-user-ID of the target process). This will return a new descriptor every time this function is called.

  3. int set_rc_parent(int rcd1, int rcd2)

    Sets the parent of the resource container corresponding to rcd1 to that of rcd2. It also checks whether the resources can be allocated to the child container from the new parent before changing the parent. It changes the scheduling parameters of the old parent, the new parent and the child container to reflect the change. The child container is removed from the binding list of the old parent and added to that of the new parent. This is used to add a newly created container to the resource container hierarchy, or to change the structure of the hierarchy.

  4. int set_res_binding(int rcd, int pid)

    Sets the resource binding of the process pid to the resource container corresponding to rcd. If pid is zero, the scheduler binding of the calling process is changed. Any future processing done by the process task will be charged to the new container. The task is removed from the scheduler bindings of the old container and inserted into that of the new container. Scheduling parameters of the containers are changed. The need_resched attribute of the task structure is set so that the task is preempted at the earliest safe point. The permissions to change the scheduler binding is the same as that of sending a signal.

  5. int set_fd_rc(int fd, int rcd)

    This binds the open file or socket corresponding to fd to the resource container corresponding to rcd. All the future processing for the file will be charged to the new container.

  6. int set_rc_opt(int rcd, struct rcopt *rco), int get_rc_opt(int rcd, struct rcopt *rco)

    Sets/gets the options of a resource container. Options includes scheduling parameters, statistics flags etc. rcopt is a structure that contains attribute type and attribute value as the fields.

  7. int set_rc_functions(int rcd, struct rcfunc *rcfp)

    Sets the class specific scheduler functions and update function of a resource container. rcfunc is a structure containing the function names. This allows a privileged user to load a module containing the functions and call this system call to use these functions.


next up previous
Next: RCLinux Kernel Modifications and Up: RCLinux Resource Container APIs Previous: RCLinux Resource Container APIs
Mansoor Alicherry 2001-05-01