1. Field of the Invention
The present invention presents a method for scheduling operations of a solid state disk, and more particularly, a method for scheduling operations of a solid state disk by processing accessing operations from a host and rearranging a sequence of the accessing operations in each flash memory.
2. Description of the Prior Art
A solid state drive (SSD) conventionally has a number of NAND flash memories combined to form a storage device. The solid state drive has a fixed structure making it suitable to be carried around making transfer of data fast. Thus, the solid state drive is a popular product for transferring large amounts of data.
But, when performing of an accessing operation generates a delay due to the limitation of the first in first out pipeline, accessing operations yet to be performed need to wait and the processing in the host is also delayed. Furthermore, the solid state disk of the prior art randomly allocates data to different flash memories. Although some of the flash memories have already transmitted the processed data to the host, the host still needs to wait for the processed data of the flash memories delayed for the host to perform processing. A decrease in the efficiency of the host occurs and the solid state disk loses the ability to transfer data at high speed. Thus, there are problems with the method for scheduling operation of the solid state disk that needs to be solved.
An objective of the present invention is to present a method for scheduling operations of a solid state disk. According to type, a higher priority is set to accessing operations having a shorter operation time and sequence of the accessing operations is rearranged to increase efficiency of the accessing operations.
To achieve the objective of the present invention, the method for scheduling operations of a solid state disk includes receiving accessing operations from a host, temporarily storing the accessing operations, setting a higher priority to the accessing operations having a shorter operation time, rearranging sequence of the accessing operations, distributing the accessing operations to corresponding flash memories to process data according to the accessing operations, and transmitting processed data of to the host.
Another objective of the present invention is to present a method for scheduling operations of a solid state disk. Each of the flash memories concurrently performs similar accessing operations to decrease waiting time of a host and increase operation speed of the host.
To achieve the objective of the present invention, the method for scheduling operations of the solid state disk includes receiving accessing operations from a host. The accessing operations are temporarily stored in a cache memory of the solid state disk. According to sequence of the accessing operations including a read operation, a modify operation, a write operation, and an erase operation going from shortest operation time to longest operation time, sequence of the accessing operations are rearranged. The accessing operations are distributed to corresponding flash memories using first in first out pipelines. Each of the flash memories concurrently performs similar accessing operations. The processed data are transmitted to the host using first in first out pipelines.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
To achieve the objective of the present invention, preferred embodiments of the present invention are described in the following paragraphs together with some illustrations.
The controller 31 of the solid state disk 30 may receive accessing operations from the host 20 and temporarily store the accessing operations in the cache memory 32. The accessing operations may each be assigned to a corresponding flash memory 34 for processing. The accessing operations may be distributed to corresponding flash memories 34 through the plurality of first in first out pipelines 33. Each of the flash memories 34 may perform the accessing operations according to the sequence of the accessing operations. A flash memory 34 may have a data area and a spare area. Each of the data area and the spare area may comprise of a plurality of blocks. Each of the plurality of blocks may comprise a plurality of physical pages. The data may be deleted from the flash memory 34 by block. When the flash memory 34 is performing an accessing operation, the block of the data area may be used to read (R) data of the physical page. A first in first out pipeline 33 may be used to send the data to the dynamic random-access memory 22 and reserved for the use of the host 20. After the host 20 has modified (M) the data, the solid state disk 30 may select a block of the spare area and write (W) the modified data to a physical page of the block of the spare area to form new block of the data area and a mapping table may be updated. The original data stored in a physical page of a block of the data area may be erased (E) from the block of the data area and recycled to form a new block of the spare area. Therefore, the host 20 may transmit accessing operations to the solid state disk 30 and, according to a command, the solid state disk 30 performs a read (R) operation, a modify (M) operation, a write (W) operation, and an erase (E) operation in the plurality of flash memories 34.
For example, the solid state disk may receive accessing operations corresponding to a flash memory from the host in a sequence A in an order of an erase (E) operation, a modify (M) operation, a write (W) operation, and a read (R) operation. The sequence A of the present invention may be rearranged to have accessing operations with shortest operation time performed first to form sequence B in an order of a read (R) operation, a write (W) operation, a modify (M) operation, and an erase (E) operation. The waiting time of the host for the two sequences may be calculated and compared. When performing the accessing operations in the sequence A, the accessing operations in the sequence A may be delivered to a flash memory 34 through a first in first out pipeline 33a of the plurality of first in first out pipelines 33. According to the sequence A, the flash memory 34 may first perform the erase operation. A first in first out pipeline 33b of the plurality of first in first out pipelines 33 may be used to deliver a notification to the host of finishing the erase operation after an operation time of 3000 us. The waiting time for the host to receive processed data after performing the erase operation may be 3000 us. The modify operation may be performed next. Aside from the 1390 us needed to perform the modify operation, due to the limitation of the plurality of first in first out pipelines 33, the operation time of 3000 us of the erase operation may be added to the waiting time of the host. As shown in
When performing the accessing operations in the sequence B, the accessing operations in the sequence B maybe delivered to a flash memory 34. According to the sequence B, the flash memory 34 may first perform the read operation. A first in first out pipeline 33b of the plurality of first in first out pipelines 33 may be used to deliver a notification to the host of finishing the read operation after an operation time of 75 us. The waiting time for the host to receive processed data after performing the read operation may be 75 us. The same for the write operation, aside from the 1300 us needed to perform the write operation, the operation time of 75 us of the read operation may be added to the waiting time of the host. The waiting time of the host maybe 75 us+1300 us=1375 us before the host receives processed data after performing the write operation. When performing the modify operation, aside from the 1390 us needed to perform the modify operation, the operation time of the read operation and the write operation may be added to the waiting time of the host. The waiting time of the host may be 75 us+1300 us+1390 us=2765 us before the host receives processed data after performing the modify operation. When performing the erase operation, aside from the 3000 us needed to perform the erase operation, the operation time of the read operation, the write operation, and the erase operation may be added to the waiting time of the host. The waiting time of the host may be 75 us+1300 us+1390 us+3000=5765 us before the host receives processed data after performing the erase operation. To finish the performing of the accessing operations in the sequence B, the operation time of the solid state disk 30 may be 3000 us+1390 us+1300 us+75 us=5765 us and the total waiting time of the host may be 75 us+1375 us+2765 us+5765 us=9780 us. Although the operation time of the solid state disk 30 for sequence A and sequence B maybe 5765 us, but, by rearranging the sequence of accessing operations in sequence B, the waiting time of the host may be 9780. As compared to the waiting time of 18845 of the host in sequence A, the waiting time of the host may be reduced to at least half and, thus, greatly increasing the efficiency of the host.
After rearranging the accessing operations in sequence C to have accessing operations with shortest operation time performed first to form sequence C′ in an order of a read (R) operation, a modify (M) operation, a write (W) operation, and an erase (E) operation. The sequence C′ may be R0-R1-R2-R3-W0-W1-W2-M0-M2-E0-E1-E2. The accessing operations may be sent to the flash memories FLASH0 to FLASH3 by the solid state disk in the sequence enclosed in solid outline as shown in
Step S1: receive accessing operations from a host;
Step S2: temporarily store the accessing operations in a cache memory;
Step S3: set a higher priority to the accessing operations having a shorter operation time; according to the order of operation time of a read (R) operation, a modify (M) operation, a write (W) operation, and an erase (E) operation, rearranging sequence of the accessing operations;
Step S4: distribute the accessing operations to corresponding flash memories using a plurality of first in first out pipelines;
Step S5: each of the flash memories concurrently perform similar accessing operations;
Step S6: transmit the processed data to the host using a plurality of first in first out pipelines.
According to the disclosed steps, the method of arranging the sequence of the accessing operations of the solid state disk of the present invention may rearrange the sequence of the accessing operations in the flash memory according to the operation time of the accessing operation. Accessing operations having a shorter operation time may be set to have higher priority. The plurality of first in first out pipelines may be used to distribute the accessing operations to corresponding flash memory. The flash memories concurrently perform similar accessing operations. Thus, the waiting time of the host is reduced and the efficiency of executing accessing operations is increased.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
201410365857.3 | Jul 2014 | CN | national |