METHODS FOR CONTROLLING SSD (SOLID STATE DISK) AND APPARATUSES USING THE SAME
A method for controlling an SSD (Solid State Disk), performed by a processing unit when loading and executing a driver, including: obtaining a data access command including information indicating a namespace, a command type, and a logical storage address; determining one of a plurality of storage mapping tables according to the namespace; reading a physical location corresponding to the logical storage address from the determined storage mapping table; generating a data access request including information indicating a request type and the physical location; and issuing the data access request to a SSD.
This application claims priority of China Patent Application No. 201710384048.0, filed on May 26, 2017, the entirety of which is incorporated by reference herein.
BACKGROUND Technical FieldThe present invention relates to storage devices, and in particular to methods for controlling an SSD (Solid State Disk) and apparatuses using the same.
Description of the Related ArtAn SSD is typically equipped with NAND flash devices. NAND flash devices are not random access but serial access. It is not possible for NOR to access any random address. Instead, the host has to write into the NAND flash devices a sequence of bytes which identify both the type of command requested (e.g. read, write, erase, etc.) and the address to be used for that command. The address identifies a page (the smallest chunk of flash memory that can be written in a single operation) or a block (the smallest chunk of flash memory that can be erased in a single operation), and not a single byte or word. In practice, to improve the write speed, data of continuous logic addresses may be dispersed into physical storage units, and a storage mapping table is used to point to where the data is written in physical storage units. Accordingly, what is needed are methods for controlling an SSD to improve the access performance to reflect the characteristics of the NAND flash devices, and apparatuses that use these methods.
BRIEF SUMMARYAn embodiment of a method for controlling an SSD (Solid State Disk), performed by a processing unit when loading and executing a driver, comprises: obtaining a data access command comprising information indicating a namespace, a command type, and a logical storage address; determining one of a plurality of storage mapping tables according to the namespace; reading a physical location corresponding to the logical storage address from the determined storage mapping table; and generating, and then issuing a data access request to the SSD, where the data access request comprises information indicating the request type and the physical location.
An embodiment of an apparatus for controlling an SSD comprises a memory and a processing unit coupled to the memory. The memory stores a plurality of storage mapping tables. The processing unit, when loading and executing a driver, obtains a data access command comprising information indicating a namespace, a command type, and a logical storage address; determines one of the storage mapping tables according to the namespace; reads a physical location corresponding to the logical storage address from the determined storage mapping table; and generates a data access request comprising information indicating a request type and the physical location, and issues the data access request to the SSD.
A detailed description is given in the following embodiments with reference to the accompanying drawings.
The present invention can be fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:
The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims.
The present invention will be described with respect to particular embodiments and with reference to certain drawings, but the invention is not limited thereto and is only limited by the claims. Furthermore, It should be understood that the terms “comprises,” “comprising,” “includes” and/or “including,” when used herein, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Use of ordinal terms such as “first”, “second”, “third”, etc., in the claims to modify a claim element does not by itself connote any priority, precedence, or order of one claim element over another or the temporal order in which acts of a method are performed, but are used merely as labels to distinguish one claim element having a certain name from another element having the same name (but for use of the ordinal term) to distinguish the claim elements.
The storage unit 280 may contain multiple storage sub-units and each storage sub-unit may be practiced in a single die and use a respective access sub-interface to communicate with the processing unit 210.
In some implementations, the host 110 may provide an LBA (Logical Block Address) to the processing unit 210 through the access interface 250 to indicate a particular region for data to be read from or written into. In order to optimize the data write efficiency, the access interface 270 distributes data with continuous LBAs across different physical regions of the storage unit 280. Thus, the SSD 140 needs to store a storage mapping table, also referred to as an H2F (Host-to-Flash) table, in a DRAM (Dynamic Random Access Memory) 220 to indicate which location in the storage unit 280 data of each LBA is physically stored in. However, since the SSD 140 has no knowledge about application executions of the host 110, the physical-data placement optimized by the access interface 270 may not satisfy the requirements of the host 110.
Through the methods for controlling an SSD introduced by embodiments of the invention, it can realize the purpose of including the optimization logics of physical-data placement in the host 110. The host 110 may store multiple H2F tables in the memory 150 and each H2F table is associated with a namespace. The host 110 defines different visible scopes of the SSD 140 for different namespaces. The namespace may be an ID (Identifier) in 64 or 128 bits, such as an UUID (Universally Unique Identifier), a GUID (Globally Unique Identifier) etc., or a user ID in a specific length. The host 110 may provide different QoS (Quality of Service) for different namespaces and schedule data access commands for the namespaces according to QoS for the namespaces. The QoS describes requirements for accessing data of the corresponding namespace, such as a throughput, a waiting time, etc. The host 110 may record execution logs corresponding to different namespaces, for example, the data access commands of the namespaces were executed at specific moments, etc. The QoS and execution logs for the namespaces may be realized in a wide range of data structures, such as data arrays, database tables, file records, etc., and stored in the memory 150. The memory 150 stores a namespace mapping table including information about an address of the memory 150 for storing a H2F table for each namespace. An exemplary namespace mapping table may be illustrated in Table 1 as follows:
The namespace mapping table contains three records to describe that the H2F table for the namespace “123e4567-e89b-12d3-a456-426655440000” is stored from the address 0x10000 of the memory 150, the H2F table for the namespace “123e4567-e89b-12d3-a456-665544000042” is stored from the address 0x20000 of the memory 150 and the H2F table for the namespace “123e4567-e89b-12d3-a456-554400004266” is stored from the address 0x30000 of the memory 150.
The driver 630 may receive data access commands from an upper layer and push the data access commands into one or more FIFO (First-In-First-Out) queues successively according to the reception times. The upper layer may be the application 610 or the OS 620. For example, the memory 150 may allocate space for three FIFO queues associated with the namespaces “123e4567-e89b-12d3-a456-426655440000”, “123e4567-e89b-12d3-a456-665544000042” and “123e4567-e89b-12d3-a456-554400004266”.
Although the embodiment has been described as having specific elements in
While the invention has been described by way of example and in terms of the preferred embodiments, it should be understood that the invention is not limited to the disclosed embodiments. On the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.
Claims
1. A method for controlling an SSD (Solid State Disk), performed by a processing unit when loading and executing a driver, comprising:
- obtaining a data access command comprising information indicating a namespace, a command type, and a logical storage address;
- determining one of a plurality of storage mapping tables according to the namespace;
- reading a physical location corresponding to the logical storage address from the determined storage mapping table;
- generating a data access request comprising information indicating a request type and the physical location; and
- issuing the data access request to an SSD.
2. The method of claim 1, wherein the determined storage mapping table stores information regarding which location in a storage unit of the SSD data of each logical storage address associated with the namespace is physically stored in, and the information is placed in order of logical storage addresses.
3. The method of claim 1, wherein the step of determining one of a plurality of storage mapping tables according to the namespace comprises:
- determining the storage mapping tables associated with the namespace by searching a namespace mapping table.
4. The method of claim 3, wherein the namespace mapping table comprises information about an address for storing the storage mapping table associated with the namespace.
5. The method of claim 4, wherein the namespace mapping table comprises information about a start address of a memory for storing the storage mapping table associated with each namespace.
6. The method of claim 1, wherein the data access command is received from an upper layer.
7. The method of claim 6, wherein the upper layer is an application or an OS (Operating System).
8. The method of claim 1, wherein the processing unit is disposed physically outside of the SSD.
9. The method of claim 1, comprising:
- selecting the namespace from a plurality of namespaces according to QoSs (Quality of Services) and execution logs,
- wherein the data access command is obtained from a queue corresponding to the selected namespace.
10. An apparatus for controlling an SSD (Solid State Disk), comprising:
- a memory, storing a plurality of storage mapping tables; and
- a processing unit, coupled to the memory, when loading and executing a driver, obtaining a data access command comprising information indicating a namespace, a command type, and a logical storage address; determining one of the storage mapping tables according to the namespace; reading a physical location corresponding to the logical storage address from the determined storage mapping table; generating a data access request comprising information indicating a request type and the physical location; and issuing the data access request to the SSD.
11. The apparatus of claim 10, wherein the determined storage mapping table stores information regarding which location in a storage unit of the SSD data of each logical storage address associated with the namespace is physically stored in, and the information is placed in order of logical storage addresses.
12. The apparatus of claim 10, wherein the memory stores a namespace mapping table and the processing unit searches the namespace mapping table to determine the storage mapping table associated with the namespace.
13. The apparatus of claim 12, wherein the namespace mapping table comprises information about an address for storing the storage mapping table associated with the namespace.
14. The apparatus of claim 13, wherein the namespace mapping table comprises information about a start address of the memory for storing the storage mapping table associated with each namespace.
15. The apparatus of claim 10, wherein the data access command is received from an upper layer.
16. The apparatus of claim 15, wherein the upper layer is an application or an OS (Operating System).
17. The apparatus of claim 10, wherein the processing unit is disposed physically outside of the SSD.
18. The apparatus of claim 10, wherein the processing unit selects the namespace from a plurality of namespaces according to QoSs (Quality of Services) and execution logs and the data access command is obtained from a queue corresponding to the selected namespace.
Type: Application
Filed: Jan 9, 2018
Publication Date: Nov 29, 2018
Patent Grant number: 10936482
Inventor: Ningzhong MIAO (Shanghai)
Application Number: 15/865,469