Check out the new USENIX Web site. next up previous
Next: Integrating network processing with Up: Shortcomings of current resource Previous: Shortcomings of current resource

The distinction between scheduling entities and activities


  
Figure 4: A classical application.
\begin{figure}
\centering
\centerline{\psfig{figure=classical-appl.ps}}
\end{figure}

A classical application uses a single process to perform an independent activity. For such applications, the desired units of isolation and resource consumption are identical, and the process abstraction suffices. Figure 4 shows a mostly user-mode application, using one process to perform a single independent activity.


  
Figure 5: A classical network-intensive application.
\begin{figure}
\centerline{\psfig{figure=classical-network.ps}}
\end{figure}


  
Figure 6: A multi-process application.
\begin{figure}
\centerline{\psfig{figure=2-proc-appl.ps}}
\end{figure}

In a network-intensive application, however, much of the processing is done in the kernel. The process is the correct unit for protection isolation, but it does not encompass all of the associated resource consumption; in most operating systems, the kernel generally does not control or properly account for resources consumed during the processing of network traffic. Most systems do protocol processing in the context of software interrupts, whose execution is either charged to the unlucky process running at the time of the interrupt, or to no process at all. Figure 5 shows the relationship between the application, process, resource principal and independent activity entities for a network-intensive application.

Some applications are split into multiple protection domains (for example, to provide fault isolation between different components of the application). Such applications may still perform a single independent activity, so the desired unit of protection (the process) is different from the desired unit of resource management (all the processes of the application). A mostly user-mode multi-process application trying to perform a single independent activity is shown in Figure 6.


  
Figure 7: A single-process multi-threaded server.
\begin{figure}
\centerline{\psfig{figure=server-appl.ps}}
\end{figure}

In yet another scenario, an application consists of a single process performing multiple independent activities. Such applications use a single protection domain, to reduce context-switching and IPC overheads. For these applications, the correct unit of resource management is smaller than a process: it is the set of all resources being used by the application to accomplish a single independent activity. Figure 7 shows, as an example, a single-process multi-threaded Internet server.

Real-world single-process Internet servers typically combine the last two scenarios: a single process usually manages all of server's connections, but additional processes are employed when modularity or fault isolation is necessary (see section 2). In this case, the desired unit of resource management includes part of the activity of the main server process, and also the entire activity of, for example, a CGI process.

In some operating systems, e.g., Solaris, threads assume some of the role of a resource principal. In these systems, CPU usage is charged to individual threads rather than to their parent processes. This allows threads to be scheduled either independently, or based on the combined CPU usage of the parent process's threads. The process is still the resource principal for the allocation of memory and other kernel resources, such as sockets and protocol buffers.

We stress that it is not sufficient to simply treat threads as the resource principals. For example, the processing for a particular connection (activity) may involve multiple threads, not always in the same protection domain (process). Or, a single thread may be multiplexed between several connections.


next up previous
Next: Integrating network processing with Up: Shortcomings of current resource Previous: Shortcomings of current resource
Gaurav Banga
1998-12-17