This application claims priority from Korean Patent Application No. 10-2006-0129661, filed on Dec. 18, 2006, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein in its entirety by reference.
1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to a command scheduling method and apparatus, and more particularly, to a command scheduling method and apparatus for reducing the complexity of a virtual file system embodied in a nonvolatile data storage device, and performing efficient interleaving by setting a preparation phase of a command schedule in the virtual file system embodied in the nonvolatile data storage device.
2. Description of the Related Art
Recent multimedia devices, including mobile devices, store a very large amount of multimedia data, such as MP3 sound and moving pictures. They thus require data storage devices which provide a very large storage space and can read and write data at a high rate.
Flash memory is a nonvolatile data storage device used in various mobile devices due to its low power consumption, miniaturization, low heat, and high stability. The storage space of a single flash memory is also quickly increasing to meet users' demands.
However, flash memory typically has a slow programming (write) speed. To overcome this and perform high-speed data input/output, various hardware architectures have been suggested for flash memory storage devices.
Referring to
Read/write of flash memories includes two operations: i) reading/writing data from/to a memory cell; and ii) inputting/outputting data from/to the flash memory controller 110. Thus, a controller in a flash memory storage device is connected to a plurality of flash memory chips via a single data input/output channel, and inputs/outputs data using interleaving. According to a general flash memory standard, since a single channel makes it difficult to expect an increase of performance when 4-5 flash memory chips are used, the 4-way architecture is usually used, in which address distribution is achieved in a power of two.
As illustrated in
A large capacity flash memory storage device may use more than 5 flash memory chips, and in this case can use a bit-width extension architecture or a multi-channel architecture. The multi-channel architecture can be an extension of the 1-channel/x-way architecture described above, and the bit-width extension architecture is a method of simultaneously transmitting data by connecting more than 2 flash memory chips. In this case, connected flash memory chips must simultaneously perform read/write at the same address.
In general, for a flash memory, read/write is performed on a page basis, and in order to rewrite data for update, an erase operation must be first performed in block units, each of which include a plurality pages. This characteristic is different from that of general storage devices, and thus, in order to have compatibility with an existing file system, a flash memory storage device is managed using specific software (virtual file system) called a Flash Translation Layer (FTL). The virtual file system for compatibility with a file system can also be applied to other nonvolatile data storage devices, and thus the description below can be applied to all nonvolatile data storage devices.
The FTL generally uses various kinds of metadata, such as an address mapping table, free block information, bad block information, and the like, from the complex hardware architectures described above, and most metadata is stored in a flash memory. The metadata of the FTL is independently stored in device or plain units each corresponding to a range covered by a copyback command of a flash memory. This allows efficient garbage collection, which is an important job of the FTL. A flash memory storage device having a complex architecture using a plurality of flash memory chips has independent metadata proportional to the number of flash memory chips.
In the hardware architectures described above, the FTL transmits various commands to each flash memory in response to a read/write request of a file system. In
As described above, a flash memory storage device using a plurality of flash memory chips for a high-speed data input/output has a plurality of independent pieces of metadata on a flash memory chip device or channel basis. Thus, in this structure, the FTL transmits a different command to each metadata in response to a data read/write request of the file system. That is, each independent FTL metadata has a different metadata command set and a different processing time.
Thus, a command issue time with respect to user data differs between the FTL metadata. Since each FTL management unit has a different command schedule (job schedule), an increase of the number of FTL management units causes an increase of the complexity of the FTL, and a large capacity buffer is necessary due to the difference between issue times to the user data. The increase of complexity of the FTL causes an increase of the code size of the FTL, an increase of memory usage, and an increase of Central Processing Unit (CPU) load, resulting in an increased resource use. An increase of the FTL processing amount may cause a delay for each command issued, difficulty of burst data transmission between a host and a storage device due to congestion of user data read/write commands, and may negate the performance improvement of interleaving. These problems result in a decrease of data input/output performance of a flash memory storage device.
The present invention provides a command scheduling method and apparatus for reducing the complexity of a virtual file system embodied in a nonvolatile data storage device and performing efficient interleaving by setting a preparation phase of a command schedule in the virtual file system embodied in the nonvolatile data storage device.
According to an aspect of the present invention, there is provided a command scheduling method of a virtual file system embodied in a nonvolatile data storage device, the method comprising: setting a preparation phase in which a plurality of metadata commands for data management are executed; and if the plurality of metadata commands are completely executed in the preparation phase, executing data read/write commands.
The method may further comprise executing the plurality of metadata commands in the set preparation phase, wherein the plurality of metadata commands are executed in a unit managed by the virtual file system.
The setting of the preparation phase may further comprise: calculating execution times of preparation jobs for the data read/write commands in the unit managed by the virtual file system; and setting the preparation phase based on the longest of the calculated execution times.
The preparation jobs for the data read/write commands and the plurality of metadata commands may be preparation jobs of the virtual file system based on the types of the data read/write commands, and each of the preparation jobs of the virtual file system may comprise at least one of metadata read/update, garbage collection, map table read/update, and unit erase.
The executing of the data read/write commands may comprise executing the data read/write commands together after the set preparation phase, and the data read/write commands executed together may be executed in the data read/write order using an interleaving method.
The nonvolatile data storage device may comprise flash memories, the virtual file system may be a FTL, and a unit managed by the FTL may be a device unit of the flash memories or a channel unit using the flash memories.
According to another aspect of the present invention, there is provided an extended command scheduling method of a virtual file system embodied in a nonvolatile data storage device, the method comprising: setting a preparation phase in which a plurality of metadata commands for data management are executed; executing metadata commands of the next preparation phase during idle times in the set preparation phase; and if the plurality of metadata commands and the metadata commands of the next preparation phase are completely executed in the set preparation phase, executing data read/write commands.
The method may further comprise executing the plurality of metadata commands in the set preparation phase, wherein the plurality of metadata commands and the metadata commands of the next preparation phase are executed in a unit managed by the virtual file system.
The setting of the preparation phase may further comprise: calculating execution times of preparation jobs for the data read/write commands in a unit managed by the virtual file system; and setting the preparation phase based on the longest of the calculated execution times.
The idle times in the set preparation phase may be calculated by subtracting an execution time of each of the preparation jobs in a unit managed by the virtual file system from an execution time of the set preparation phase, and the executing of the metadata commands of the next preparation phase during the idle times in the set preparation phase may comprise calculating execution times of the metadata commands of the next preparation phase in a unit managed by the virtual file system and respectively assigning the idle times to the metadata commands of the next preparation phase.
The preparation jobs for the data read/write commands, the plurality of metadata commands, and the metadata commands of the next preparation phase may comprise at least one of metadata read/update, garbage collection, map table read/update, and unit erase based on types of the data read/write commands.
The executing of the data read/write commands may comprise executing the data read/write commands together after the set preparation phase, and the data read/write commands executed together may be executed in the data read/write order using an interleaving method.
The nonvolatile data storage device may comprise flash memories, the virtual file system may be a FTL, and a unit managed by the FTL may be a device unit of the flash memories or a channel unit using the flash memories.
According to another aspect of the present invention, there is provided a command scheduling method of a FTL embodied in flash memories, the method comprising: calculating execution times of preparation jobs for data read/write commands in a unit managed by the FTL; setting a preparation phase based on the longest execution time from among the calculated execution times; executing a plurality of metadata commands for data management in the unit managed by the FTL in the preparation phase; and executing the data read/write commands together after the set preparation phase.
The unit managed by the FTL may be a device unit of the flash memories or a channel unit using the flash memories, and the preparation jobs for the data read/write commands and the plurality of metadata commands may comprise at least one of metadata read/update, garbage collection, map table read/update, and unit erase.
The executing of the data read/write commands together may comprise may be executed in the data read/write order using an interleaving method.
The method may further comprise: calculating idle times by subtracting an execution time of each of the preparation jobs in a unit managed by the FTL from an execution time of the set preparation phase; and executing metadata commands of the next preparation phase during the calculated idle times in the unit managed by the FTL, and the executing of the metadata commands of the next preparation phase during the calculated idle times in the unit managed by the FTL may comprise calculating execution times of the metadata commands of the next preparation phase in the unit managed by the FTL and respectively assigning the idle times to the metadata commands of the next preparation phase.
According to another aspect of the present invention, there is provided a command scheduler of a virtual file system embodied in a nonvolatile data storage device, the command scheduler comprises: an execution time calculator calculating execution times of preparation jobs for data read/write commands in a unit managed by the virtual file system; a first controller controlling a plurality of metadata commands for data management to be executed by setting a preparation phase based on the longest of the calculated execution times; and a second controller controlling the data read/write commands to be executed together after the set preparation phase.
The first controller may further comprise: an idle time calculator calculating idle times by subtracting an execution time of each of the preparation jobs in a unit managed by the virtual file system from an execution time of the set preparation phase; and an extra job module executing metadata commands of the next preparation phase during the calculated idle times in the unit managed by the virtual file system.
According to another aspect of the present invention, there is provided a computer readable recording medium storing a computer readable program for executing the scheduling method.
The above and other features of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings in which:
The present invention will now be described in detail by explaining exemplary embodiments of the invention with reference to the attached drawings. Although flash memories are described hereinafter for exemplary purposes, the invention can be applied to all nonvolatile data storage devices.
Referring to
The preparation phase is set based on the longest of the calculated execution times, in operation 620. In other words, the longest calculated execution time of the preparation jobs including other devices is set as an execution time of the preparation phase. During the execution time of the preparation phase, various FTL metadata commands described above, such as map table read/update, block erase, block merge, and the like, are executed in operation 630, and the data read/write commands are not transmitted for command schedule management.
If the metadata commands of the preparation phase are completely executed in operation 640, i.e. if the preparation phase ends, the FTL executes the user data read/write commands together in operation 650. The duration in which the user data read/write commands are executed is set as a data phase, as compared to the preparation phase. Since the data read/write commands are executed together, user data divided and stored in a plurality of memory chips (devices) or channels can be processed at high speed using interleaving. In this manner, a read/write request of a host is completed by repeatedly performing at least one pair of a preparation phase and a data phase.
Referring to
In addition, each of four FTL management units performs a different preparation job and has a different execution time. If a preparation job 713 of a device 1 requiring the longest execution time is completed, i.e. if the preparation phase 710 or 730 ends, a data phase 720 or 740 starts. In the data phase 720 or 740, data read/write commands are executed in the order of user data input from a host (or stored in a buffer), and the four FTL management units can read/write with correct interleaving.
By simply dividing a command schedule into the preparation phases 710 and 730 and the data phases 720 and 740, theoretical performance of an interleaving method can be effectively shown, and since a user data input/output sequence matches a user data command sequence of a command schedule, burst data transmission between FTLs can be achieved easily.
Referring to
In this case, all the devices except for the one calculated by the management unit (e.g. a device unit) to have the longest execution time, i.e. a device continuously executing a preparation job during all the execution time of the preparation phase, secure an idle time after their metadata commands (preparation jobs) are completed. Each device's idle time can be calculated by subtracting the execution time of that device's preparation job from the execution time of the preparation phase. The FTL can use the idle times as a chance to execute another job instead of wasting the idle times as waiting time. Thus, in the extended command scheduling method, preparation jobs needed for the next preparation phase are performed in advance during the idle times.
Since the preparation jobs needed for the next preparation phase, i.e. metadata commands, are typically a map table read job, a garbage collection job for securing free blocks, a block erase job as a pre-processing job for a data write, and the like, by calculating the execution times of the preparation jobs in advance, a portion of the preparation jobs can be performed in the idle times. Since the idle times in each preparation phase can be saved through this process, the processing time of a single read/write request is reduced. Furthermore, in high-speed data transmission in which a plurality of requests are continuously received, the entire data input/output processing performance can be considerably increased.
As described above, it is determined in operation 840 whether an idle time exists in the preparation phase, and if so, the metadata commands of the next preparation phase are executed in operation 850. If all the metadata commands are completely executed in operation 860, i.e. if the preparation phase ends, user data read/write commands are executed in operation 870. In this case, since the data read/write commands are executed together (in a data phase) as illustrated in
In
Referring to
The first controller 1120 controls a plurality of metadata commands for data management to be executed by setting a preparation phase based on the longest of the execution times calculated by the execution time calculator 1110. The first controller 1120 may further include an idle time calculator 1121 calculating each idle time by subtracting the execution time of each of the preparation jobs in the unit managed by the virtual file system from the execution time of the set preparation phase, and an extra job module 1122 executing metadata commands of the next preparation phase during the idle times in the unit managed by the virtual file system.
If the metadata commands are completed by the first controller 1120, a second controller 1130 controls the data read/write commands to be executed together after the set preparation phase.
The invention can also be embodied as computer readable code on a computer readable recording medium. The computer readable recording medium is any data storage device that can store data which can be thereafter read by a computer system. Examples of the computer readable recording medium include read-only memory (ROM), random-access memory (RAM), CD-ROMs, magnetic tapes, floppy disks, and optical data storage devices. The computer readable recording medium can also be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion.
As described above, according to the present invention, when a plurality of flash memories are used for large capacity high-speed data input/output processing of a memory storage device, by simplifying the structure of a virtual file system (FTL) using a command scheduling method, code size and resource use can be reduced. In addition, since data input from a host can be sequentially recorded in a data phase, correct interleaving can be expected, and burst data transmission between the host and the memory storage device can be achieved even without using a large capacity buffer.
In addition, since jobs needed in the next preparation phase can be performed in advance as extra jobs added during idle times in a preparation phase using an extended command scheduling method, the average execution time of the total preparation phase is reduced, resulting in an increase of the data input/output performance of a storage device.
While this invention has been particularly shown and described with reference to exemplary embodiments thereof, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. The exemplary embodiments should be considered in a descriptive sense only, and not for purposes of limitation. Therefore, the scope of the invention is defined not by the detailed description of the exemplary embodiments of the invention but by the appended claims, and all differences within the scope will be construed as being included in the present invention.
Number | Date | Country | Kind |
---|---|---|---|
10-2006-0129661 | Dec 2006 | KR | national |