This application claims priority to Taiwan Application Serial Number 97114298, filed Apr. 18, 2008, which is herein incorporated by reference.
1. Field of Invention
The presented invention relates to a divided disk command processing system and method thereof. More particularly, the presented invention relates to a processing system and method for executing the multiple computing processes of a disk command separately in a computer system.
2. Description of Related Art
Context switching is an essential feature of multitasking operating systems. A multitasking operating system is one in which multiple processes execute on a single CPU seemingly simultaneously and without interfering with each other. Context switching can be described in slightly more detail as the kernel (i.e., the core of the operating system) performing the following activities with regard to processes (including threads) on the CPU: (1) suspending the progression of one process and storing the CPU's state (i.e., the context) for that process somewhere in memory, (2) retrieving the context of the next process from memory and restoring it in the CPU's registers and (3) returning to the location indicated by the program counter (i.e., returning to the line of code at which the process was interrupted) in order to resume the process.
Context switching is generally computationally intensive. That is, it requires considerable processor time, which can be on the order of nanoseconds for each of the tens or hundreds of switches per second. Thus, context switching represents a substantial cost to the system in terms of CPU time and can, in fact, be the most costly operation on an operating system.
Consequently, a major focus in the design of operating systems has been to avoid unnecessary context switching to the extent possible. However, this has not been easy to accomplish in practice. In fact, although the cost of context switching has been declining when measured in terms of the absolute amount of CPU time consumed, this appears to be due mainly to increases in CPU clock speeds rather than to improvements in the efficiency of context switching itself.
For this reason, this invention provides a divided disk command processing system and method thereof, processing the disk command by executing the multiple computing processes of the disk command separately. The invention utilizes the central processing unit (CPU) of a computer system to partition the disk command into several progressions. And in each progression stage, the CPU executes the computing processes being in one identical progression state in each of the progression stages. That is, to execute the disk command separately, to reduce frequently storing and restoring the state as context switching of the CPU. And the efficiency of the CPU 110 is fully utilized when computing in one progression stage, thus reducing the execution time of a disk command.
The primary idea of the invention is to provide a divided disk command processing system, comprising: a CPU providing a plurality of progression stages to partition a disk command into multiple computing processes and separately executing the computing processes in the progression stages to execute the disk command; a command queuing unit stringing up and queuing each computing process of the disk command respectively into the corresponding progression stage to become a processing queue in the progression stage for the CPU to execute; and a queue checking unit checking all processing queues in each of the progression stages to find the processing queue which have not been computed, and informing the CPU to compute the processing queue.
The secondary idea of the invention is to provide a divided disk command processing method, comprising following steps: (a) providing a plurality of progression stages; (b) partitioning a disk command into multiple computing processes; (c) stringing up and queuing the computing processes of the disk command respectively into the corresponding progression stage to become a processing queue in the progression stage; (d) executing the computing process of the processing queue which is queued in the progression stage; (e) checking one of the progression stages to find if all the processing queues in the progression stage have been executed; and (f) shifting from the progression stage to a next progression stage.
It is to be understood that both the foregoing general description and the following detailed description are by examples, and are intended to provide further explanation of the invention as claimed.
The invention can be more fully understood by reading the following detailed description of the embodiment, with reference made to the accompanying drawings as follows:
Reference will now be made in detail to the present embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.
Refer to
Wherein the multiple computing process 2001˜200n of the disk command 200 being executed by the CPU 110 from one computing process to next computing process, the CPU 110 has to conduct a context switch. The context switch connotes the CPU suspending progression of executing one process and resuming progression of executing other process that had previously been suspended. Therefore, by the invention, the command queuing unit 120 strings up and queues the computing process 2001˜200n of the disk command 200 respectively into the corresponding progression stage 1301˜130n to become a processing queue “q” in the progression stage 1301˜130n. For example, firstly strings up and queues the computing process, “Read Disk”, into one progression stage and strings up and queues the computing process, “Write Disk”, into another progression stage by the command queuing unit 120. And then, the CPU 110 executes all the computing processes of one identical progression state of the processing queue “q” queued in the progression stage. And when the CPU 110 shifts progression stages, the context switch is conducted only once by the CPU 110. Thus reducing frequently storing and restoring the state as context switching of the CPU 110, and the efficiency of the CPU 110 is fully utilized when computing in one progression stage to reduce the execution time of a disk command.
Although the present invention has been described in considerable detail with reference certain embodiments thereof, other embodiments are possible. Therefore, their spirit and scope of the appended claims should not be limited to the description of the embodiments contained herein.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims.
Number | Date | Country | Kind |
---|---|---|---|
97114298 | Apr 2008 | TW | national |