1. Field of the Invention
Embodiments of the present invention relate generally to the field of computer systems and more specifically to computer system architectures that implement virtual processing chains.
2. Description of the Related Art
Application programs perform application-specific tasks such as word processing, spreadsheet editing, and email browsing. Hardware and operating system security features prevent application programs from accessing memory locations or executing program instructions that directly control input/output hardware. Thus, input/output operations required by application programs, such as storing information to disk or transmitting information over a computer network, are performed by operating system programs that control the input/output hardware (referred to herein as “input/output devices”).
An operating system typically contains a collection of device driver programs that control individual input/output devices and communicate only with the operating system. Therefore, an application program that transfers data from a first input/output device to a second input/output device must initially transfer data from the device driver corresponding to the first input/output device to the application program, and then transfer the data from the application program to the second device driver corresponding to the second input/output device.
Computer system hardware distinguishes operating system software and memory locations from application program software and memory locations by a security setting in the hardware. This setting indicates whether the hardware is in “user” or “privileged” mode. Application programs run in user mode, and the operating system runs in privileged mode. Changing between user and privileged modes causes the operating system to perform a context switch, in which the operating system writes/reads the microprocessor state (i.e. the value of all microprocessor registers and status flags) to/from memory to ensure program coherency. Since each context switch takes a certain amount of time to perform, performing a large number of context switches may have a substantial impact on overall computer system performance.
To better understand the drawbacks of the current hardware/software architecture, consider a computer system configured to request and process multimedia data (e.g. audio data and video data) from the Internet. FIG. 1 is a conceptual diagram of a computer system 100 that contains the components of the current hardware/software architecture necessary to request and process multimedia data from the server 144 on Internet 124. The computer system 100 includes an application program layer 138, an operating system layer 140, and a hardware layer 142. Hardware and software components of the computer system 100 communicate through hardware/software interfaces 128, 130 and 132. As shown, any communication between the application program layer 138 and the operating system layer 140 through a software interface 126 causes a context switch.
The request portion of a request/process operation begins with an application program 102 requesting data by signaling an operating system 104 to read multimedia data from a server 144 on the Internet 124 through a network device 118. This communication between the application program layer 138 and the operating system layer 140 causes the first of a series of context switches. The operating system 104 continues the request operation by signaling a network device driver 106 to request data from a network interface card 112. The network interface card 112 subsequently requests data from the network device 118, which requests and receives data from the server 144 on the Internet 124 and then transmits the data to the network interface card 112. The network interface card 112 transmits the data to the network device driver 106, which signals the operating system 104 that data has been received. The operating system 104 either transfers the data from the network device driver 106 to the application program 102 or enables the application program 102 to access the data from the network device driver 106. The operating system 104 also signals the application program 102 that the read from the server 144 on the Internet 124 is complete, causing a second context switch. A communication path 134 represents the sequence of communications that occur within the request portion of the request/process operation.
The processing portion of a request/process operation begins with the application program 102 decoding the multimedia data received from the network device driver 106 into audio data and video data. After decoding the multimedia data, the application program 102 requests the operating system 104 to transfer the audio data to an audio interface card 114. Since this request crosses the boundary between the application program layer 138 and the operating system layer 140, the request causes a third context switch. In response, the operating system 104 transfers the audio data to an audio device driver 108. The audio device driver 108 transfers the audio data to the audio interface card 114, which communicates with an audio device 120 to produce sound. When the data transfer has been completed, the audio device driver 108 signals the operating system 104 that data has been transmitted to the audio interface card 114. Likewise, the operating system 104 signals the application program 102 that the audio data has been properly transferred, causing a fourth context switch. The application program 102 also requests the operating system 104 to transfer the video data from the application program 102 to a video interface card 116. Again, since this request crosses the boundary between the application program layer 138 and the operating system layer 140, the request causes a fifth context switch. In response, the operating system 104 transfers the video data from the application program 102 to a video device driver 110. The video device driver 110 transfers the video data to the video interface card 116, which communicates with a video device 122 to produce a video display on the video device 122. When the data transfer is complete, the video device driver 110 signals the operating system 104 that data has been transferred to the video interface card 116. Similarly, the operating system 104 signals the application program 102 that the video data has been properly transferred, causing a sixth context switch. A communication path 136 represents the sequence of communications that occur within the processing portion of the request/process operation.
As the foregoing illustrates, a relatively simple request/process operation results in six context switches. Large request/process operations are often divided into multiple, smaller request/process operations, thereby multiplying the number of context switches performed by the computer system 100 and further degrading overall performance.
Another drawback of the architecture of the computer system 100 is that the data transfers involving software components require the software components to buffer any data they receive. Since the computer system 100 has three device drivers and an application program that receive data, four software buffers are required to perform routine request/process operations. As is well-known, creating, operating and managing software buffers generates software overhead, which also degrades overall system performance.
An alternative configuration of the computer system 100 exchanges a buffer handle rather than passing buffers between software components. In this version of the computer system 100, a single software buffer exists, either in the network device driver 106 or in the operating system 104, and a handle to that buffer is passed between software components as the data is processed by successive device drivers. For example, a data buffer containing multimedia data in the network device driver 106 has a handle that is initially transferred to the application program 102, causing a context switch. The application program 102 transfers the handle to the audio device driver 108 to allow the audio device driver to process the audio data in the buffer, causing a second context switch. The audio device driver 108 then transfers the handle back to the application program 102 after processing the audio data in the buffer, causing a third context switch. Next, the application program 102 transfers the data buffer handle to the video device driver 110 to allow the video device driver to process the video data in the buffer, causing a fourth context switch. Again, the video device driver 110 then transfers the handle back to the application program 102 after processing the video data in the buffer, causing a fifth context switch. The processing operation concludes when the application program 102 transfers the handle to the network device driver 106 to allow additional multimedia data to be added to the buffer, causing a sixth context switch. Thus, as with the previous configuration of the computer system 100, six context switches are performed during the process operation,
As the foregoing illustrates, what is needed in the art is a computer system architecture that reduces context switching as well as the number of buffers in the computer system.