next up previous contents
Next: Handler in Kernel Up: Restricted Access to Network Interface Previous: Restricted Access to Network Interface

Handler at User Level

 

Figure 2.2 shows the events that take place. We are interested in reducing the total time the user application is delayed: tex2html_wrap_inline1847. Also of interest is the response time (tex2html_wrap_inline1849); the time from message arrival until the handler begins to run.

  figure89
Figure 2.2: Execution Flow on a Node with Restricted Access to the Network Interface: An arriving message interrupts the currently running user application. The kernel, in supervisor mode, receives the message and deposits it into a buffer. A context switch to the appropriate handler occurs. To send messages, the handler has to trap into the kernel. A final trap into the kernel is necessary to resume the interrupted user application.

Table 2.1 summarizes the time intervals that characterize the events on a given node. A message arrives at a node and causes an interrupt. The CPU switches into supervisor mode, saves the current context, and sets up the context for the kernel to run. This time interval is symbolized by tex2html_wrap_inline1851. The kernel then proceeds to read the message from the network interface into a buffer in main memory. We represent this time interval with tex2html_wrap_inline1853. The value for tex2html_wrap_inline1853 varies with the length of the message. Furthermore, for longer messages it is possible to engage the DMA unit and continue processing while the message is being received. For our analysis we ignore this optimization and assume the CPU remains busy during the receipt of the message.

  table98
Table 2.1: Time Intervals of Interest

After determining which handler to invoke, it takes tex2html_wrap_inline1875 time to switch context and start running the handler. In the example of Figure 2.2 the handler does some processing and then sends two messages. For each message the handler has to trap into the kernel, tex2html_wrap_inline1877. The kernel will send the message (with the same assumption about staying busy as for message reception). This takes tex2html_wrap_inline1879 time, which increases with larger messages. The time to return from the kernel trap back to the handler is tex2html_wrap_inline1881.

When the handler finishes, it traps into the kernel one more time to re-establish the original context. The time it takes to return from an interrupt to the user level process is tex2html_wrap_inline1883.


next up previous contents
Next: Handler in Kernel Up: Restricted Access to Network Interface Previous: Restricted Access to Network Interface

Rolf Riesen
Wed Jan 22 22:24:20 MST 1997