Method for creating and deleting namespace and solid-state storage device

By introducing namespace identifiers and logical address mapping mechanisms in solid-state storage devices, combined with the management of FTL tables and NS unit mapping tables, the problem of low namespace management efficiency in the existing technology is solved, and efficient use of multiple namespaces is achieved Creation, deletion, and IO processing improves the performance and scalability of storage devices.

CN113515469BActive Publication Date: 2025-02-11MEMBLAZE TECH BEIJING
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110485960.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2017-03-22
Publication Date
2025-02-11
Estimated Expiration
2037-03-22

AI Technical Summary

Technical Problem

Existing solid-state storage devices have efficiency and management difficulties in implementing namespace creation, deletion and access of NVMe protocol, especially in the multi-namespace environment how to efficiently map and manage logical addresses to physical addresses.

Method used

By introducing a mapping mechanism of namespace identifiers and namespace logical addresses, combined with the management of FTL tables and NS unit mapping tables, the creation, deletion and processing of namespaces are realized. The specific steps include mapping the namespace identifier and the namespace logical address to the physical address, and recording the corresponding mapping relationship in the NS unit mapping table and the FTL table.

Benefits of technology

It realizes efficient management and access to multiple namespaces in solid-state storage devices, improves the performance and scalability of storage devices, and ensures accurate mapping and rapid response from logical addresses to physical addresses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113515469B_ABST
    Figure CN113515469B_ABST
Patent Text Reader

Abstract

A method for creating and deleting a namespace and a solid-state storage device are provided. The provided namespace creation method includes: receiving a command for creating a namespace, the command indicating the size of the namespace to be created; allocating a namespace identifier for the namespace to be created; and adding an entry in an NS unit mapping table to record the namespace identifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a solid-state storage device, and in particular, to providing multiple namespaces in a solid-state storage device. Background Art

[0002] Take the solid state storage device (SSD) as an example. Figure 1As shown, a block diagram of a storage device is shown. The solid-state storage device 102 is coupled to the host to provide storage capacity for the host. The host and the solid-state storage device 102 can be coupled in a variety of ways, including but not limited to connecting the host and the solid-state storage device 102 through, for example, SATA (Serial Advanced Technology Attachment), SCSI (Small Computer System Interface), SAS (Serial Attached SCSI), IDE (Integrated Drive Electronics), USB (Universal Serial Bus), PCIE (Peripheral Component Interconnect Express, PCIe), NVMe (NVM Express), Ethernet, Fiber Channel, wireless communication network, etc. The host can be an information processing device that can communicate with the storage device in the above manner, such as a personal computer, a tablet computer, a server, a portable computer, a network switch, a router, a cellular phone, a personal digital assistant, etc. The storage device 102 includes an interface 103, a control component 104, one or more NVM (non-volatile memory) chips 105 and a DRAM (Dynamic Random Access Memory) 110. NAND flash memory, phase change memory, FeRAM, MRAM, etc. are common NVMs. The interface 103 can be adapted to exchange data with the host through methods such as SATA, IDE, USB, PCIE, NVMe, SAS, Ethernet, Fiber Channel, etc. The control component 104 is used to control data transmission between the interface 103, the NVM chip 105 and the DRAM 110, and is also used for storage management, host logical address to flash physical address mapping, erase leveling, bad block management, etc. The control component 104 can be implemented in a variety of ways such as software, hardware, firmware or a combination thereof. The control component 104 can be in the form of an FPGA (Field-programmable gate array), an ASIC (Application Specific Integrated Circuit) or a combination thereof. The control component 104 may also include a processor or a controller in which software is executed to manipulate the hardware of the control component 104 to process IO commands.The control unit 104 is also coupled to the DRAM 110 and can access data of the DRAM 110. The DRAM can store data of the FTL table and / or cached IO commands.

[0003] The control unit 104 includes a flash memory interface controller (or flash memory channel controller). The flash memory interface controller is coupled to the NVM chip 105, and issues commands to the NVM chip 105 in a manner that complies with the interface protocol of the NVM chip 105 to operate the NVM chip 105, and receives command execution results output from the NVM chip 105. The interface protocol of the NVM chip 105 includes well-known interface protocols or standards such as "Toggle" and "ONFI".

[0004] A memory target is one or more logic units (Logic Unit) within a NAND flash memory package that share a chip enable (CE) signal. Each logic unit has a logic unit number (LUN). A NAND flash memory package may include one or more dies. Typically, a logic unit corresponds to a single die. A logic unit may include multiple planes. Multiple planes within a logic unit can be accessed in parallel, and multiple logic units within a NAND flash memory chip can execute commands and report status independently of each other. In the "Open NAND Flash Interface Specification (Revision 3.0)" available from http: / / www.micron.com / ~ / media / Documents / Products / Other%20Documents / ON FI3_0Gold.ashx, the meanings of target, logic unit, LUN, and plane are provided, which is part of the prior art.

[0005] Data is usually stored and read on a storage medium in pages. Data is erased in blocks. A block contains multiple pages. A page on a storage medium (called a physical page) has a fixed size, such as 17664 bytes. A physical page can also have other sizes.

[0006] In a solid-state storage device, a Flash Translation Layer (FTL) is used to maintain mapping information from logical addresses to physical addresses. The logical address constitutes the storage space of the solid-state storage device perceived by upper-layer software such as the operating system. The physical address is the address used to access the physical storage unit of the solid-state storage device. In the prior art, address mapping can also be implemented using an intermediate address form. For example, the logical address is mapped to an intermediate address, and the intermediate address is further mapped to a physical address.

[0007] The table structure that stores the mapping information from logical addresses to physical addresses is called an FTL table. The FTL table is an important metadata in a solid-state storage device. Usually, the data items of the FTL table record the address mapping relationship in units of data pages in the solid-state storage device.

[0008] The FTL table includes multiple FTL table entries (or table items). In one embodiment, each FTL table entry records the correspondence between a logical page address and a physical page. In another example, each FTL table entry records the correspondence between multiple consecutive logical page addresses and multiple consecutive physical pages. In yet another embodiment, each FTL table entry records the correspondence between a logical block address and a physical block address. In still yet another embodiment, the FTL table records the mapping relationship between the logical block address and the physical block address, and / or the mapping relationship between the logical page address and the physical page address.

[0009] The NVMe protocol also defines a namespace (NS). A namespace of size n is a set of logical blocks with logical block addresses from 0 to n-1. A namespace can be uniquely identified by a namespace ID (NSID).

[0010] / shared between NVMe controllers. A host can access different namespaces through a single NVMe controller. Different hosts can also access the same namespace through multiple NVMe controllers. Logical blocks can be addressed and accessed. Each FTL table entry can correspond to one or more logical blocks, or multiple FTL table entries can correspond to one logical block. Summary of the invention

[0011] The solid-state storage device needs to implement the namespace of the NVMe protocol and support the creation and deletion of namespaces and access to the solid-state storage device by namespace.

[0012] According to the first aspect of the present application, a first method for processing IO commands according to the first aspect of the present application is provided, wherein a namespace identifier and a namespace logical address are indicated in the IO command, and the method comprises: mapping the namespace identifier and the namespace logical address to a physical address; and accessing the physical address to respond to the IO command.

[0013] According to the first method for processing IO commands in the first aspect of the present application, a second method for processing IO commands in the first aspect of the present application is provided, which also includes: obtaining one or more namespace units corresponding to the namespace identifier, wherein the namespace unit indicates a continuous global logical address space; selecting a first namespace unit from the one or more namespace units based on the namespace logical address, wherein the global logical address space indicated by the first namespace unit provides the global logical address accessed by the IO command; obtaining the global logical address accessed by the IO command based on the offset of the namespace logical address within the global logical address space indicated by the first namespace unit; and converting the global logical address accessed by the IO command into the physical address.

[0014] According to the second method for processing IO commands according to the first aspect of the present application, a third method for processing IO commands according to the first aspect of the present application is provided, which also includes: selecting a second namespace unit from the one or more namespace units based on the namespace logical address length of the IO command, wherein the global logical address space indicated by the second namespace unit provides the global logical address accessed by the IO command; and obtaining the second global logical address accessed by the IO command based on the part of the namespace logical address length of the IO command within the global logical address space indicated by the second namespace unit.

[0015] According to the first method for processing IO commands of the first aspect of the present application, a fourth method for processing IO commands according to the first aspect of the present application is provided, which also includes: obtaining the base address of the NS unit mapping table entry based on the namespace identifier, wherein the NS unit mapping table entry is indexed by the namespace identifier and has the first address of the FTL table entry of the global logical address space indicated by one or more namespace units corresponding to the namespace identifier as the content; calculating the offset value in the obtained NS unit mapping table entry based on the namespace logical address, and obtaining the first address of the FTL table entry at the offset value in the obtained NS unit mapping table entry; obtaining the FTL table entry based on the first address of the FTL table entry and the FTL table entry offset value calculated based on the namespace logical address; and obtaining the physical address from the FTL table entry.

[0016] According to the fourth method for processing IO commands of the first aspect of the present application, there is provided a fifth method for processing IO commands according to the first aspect of the present application, which also includes: according to the namespace logical address and the namespace logical address length of the IO command, according to the offset value in the obtained NS unit mapping table entry, obtaining the first address of the next FTL table entry after the first address of the obtained FTL table entry in the obtained NS unit mapping table entry; obtaining a second FTL table entry according to the first address of the next FTL table entry and the FTL table entry offset value calculated according to the namespace logical address length; and obtaining the physical address from the second FTL table entry.

[0017] According to the second aspect of the present application, a first device for processing IO commands according to the second aspect of the present application is provided, wherein the IO command indicates a namespace identifier and a namespace logical address, and the device includes: an address mapping module for mapping the namespace identifier and the namespace logical address to a physical address; and an access module for accessing the physical address to respond to the IO command.

[0018] According to the third aspect of the present application, a first namespace creation method according to the third aspect of the present application is provided, including: receiving a command to create a namespace, the command indicating the size of the namespace to be created; allocating one or more namespace units based on the size of the namespace to be created, wherein the namespace unit indicates a continuous global logical address space; allocating a namespace identifier for the namespace to be created; and adding an entry in the NS unit mapping table to record the namespace identifier and the allocated one or more namespace units.

[0019] According to the first namespace creation method of the third aspect of the present application, a second namespace creation method according to the third aspect of the present application is provided, wherein available namespace units are obtained from the NS unit allocation table and assigned to the namespace to be created, wherein the entries in the NS unit allocation table record whether the namespace unit is assigned to the namespace.

[0020] According to the first or second namespace creation method of the third aspect of the present application, a third namespace creation method according to the third aspect of the present application is provided, which also includes: recording the NS unit mapping table or the update of the NS unit mapping table to the NVM chip.

[0021] According to the second namespace creation method of the third aspect of the present application, a fourth namespace creation method according to the third aspect of the present application is provided, which also includes: recording the NS unit allocation table or an update of the NS unit allocation table to the NVM chip.

[0022] According to one of the first to fourth processing namespace creation methods of the third aspect of the present application, a fifth namespace creation method according to the third aspect of the present application is provided, wherein one or more namespace units in the NS unit mapping table entry are sorted, and the position of the NS unit in the NS unit mapping table entry indicates the position of the NS unit in the global logical address space.

[0023] According to the fourth aspect of the present application, a first namespace creation device according to the fourth aspect of the present application is provided, including: a command receiving module, used to receive a command for creating a namespace, the command indicating the size of the namespace to be created; a namespace unit allocation module, used to allocate one or more namespace units according to the size of the namespace to be created, wherein the namespace unit indicates a continuous global logical address space; an identifier allocation module, used to allocate a namespace identifier for the namespace to be created; an NS unit mapping table module, used to add an entry in the NS unit mapping table to record the namespace identifier and the allocated one or more namespace units.

[0024] According to the fifth aspect of the present application, a first namespace deletion method according to the fifth aspect of the present application is provided, including: receiving a command to delete a namespace, the command indicating a namespace identifier of the namespace to be deleted; deleting an entry indexed by the namespace identifier from an NS unit mapping table, wherein the NS unit mapping table entry is indexed by the namespace identifier and has as its content the first address of an FTL table entry of a continuous global logical address space indicated by a namespace unit corresponding to the namespace identifier; and recycling the namespace identifier.

[0025] According to the first namespace deletion method of the fifth aspect of the present application, a second namespace deletion method according to the fifth aspect of the present application is provided, which also includes: marking the namespace unit recorded in the entry of the NS unit mapping table deleted in the NS unit allocation table as unallocated, wherein the entry of the NS unit allocation table records whether the namespace unit is allocated to the namespace.

[0026] According to the first or second namespace deletion method of the fifth aspect of the present application, a third namespace deletion method according to the fifth aspect of the present application is provided, which also includes: moving all entries after the deleted entry in the NS unit mapping table to fill the storage space occupied by the deleted entry.

[0027] According to one of the first to third namespace deletion methods of the fifth aspect of the present application, a fourth namespace deletion method according to the fifth aspect of the present application is provided, which also includes: recording the NS unit mapping table or the update of the NS unit mapping table to the NVM chip.

[0028] According to the second namespace deletion method of the fifth aspect of the present application, a fifth namespace deletion method according to the fifth aspect of the present application is provided, which also includes: recording the NS unit allocation table or an update of the NS unit allocation table to the NVM chip.

[0029] According to one of the first to fifth namespace deletion methods of the fifth aspect of the present application, a sixth namespace deletion method according to the fifth aspect of the present application is provided, wherein the recycled namespace identifier can be assigned to a new namespace.

[0030] According to the sixth aspect of the present application, a first namespace deletion device according to the sixth aspect of the present application is provided, including: a command receiving module, used to receive a command to delete a namespace, the command indicating a namespace identifier of the namespace to be deleted; an NS unit mapping table module, used to delete entries indexed by the namespace identifier from the NS unit mapping table, wherein the NS unit mapping table entries are indexed by the namespace identifier and have as content the first address of an FTL table entry of a continuous global logical address space indicated by the namespace unit corresponding to the namespace identifier; and an identifier recovery module, used to recover the namespace identifier.

[0031] According to the seventh aspect of the present application, a first namespace creation method according to the seventh aspect of the present application is provided, including: receiving a command to create a namespace, the command indicating the size of the namespace to be created; allocating a namespace identifier for the namespace to be created; adding an entry in the NS unit mapping table to record the namespace identifier.

[0032] According to the first namespace creation method of the seventh aspect of the present application, a second namespace creation method according to the seventh aspect of the present application is provided, which also includes: receiving an IO command, wherein the IO command indicates a namespace identifier and a namespace logical address; allocating a namespace unit to the namespace logical address, wherein the namespace unit indicates a continuous global logical address space; recording the allocated namespace unit in the entry indexed by the namespace identifier in the NS unit mapping table; obtaining a physical address based on the allocated namespace unit and the namespace logical address mapping indicated by the IO command; and accessing the physical address to respond to the IO command.

[0033] According to the first or second namespace creation method of the seventh aspect of the present application, a third namespace creation method according to the seventh aspect of the present application is provided, which also includes: if a namespace unit has been allocated for the namespace logical address, then the physical address is obtained based on the allocated namespace unit and the namespace logical address mapping indicated by the IO command without the need to allocate the namespace unit again, wherein the namespace unit indicates a continuous global logical address space.

[0034] According to one of the first to third namespace creation methods of the seventh aspect of the present application, a fourth namespace creation method according to the seventh aspect of the present application is provided, wherein one or more namespace units are allocated based on the namespace logical address and the namespace logical address length of the IO command.

[0035] According to one of the second to fourth namespace creation methods of the seventh aspect of the present application, a fifth namespace creation method according to the seventh aspect of the present application is provided, which also includes: obtaining the global logical address accessed by the IO command based on the offset of the namespace logical address within the global logical address space indicated by the namespace unit; and converting the global logical address accessed by the IO command into the physical address.

[0036] According to one of the second to fourth namespace creation methods of the seventh aspect of the present application, a sixth namespace creation method according to the seventh aspect of the present application is provided, which also includes: obtaining the starting address of the FTL table entry based on the namespace unit; obtaining the FTL table entry based on the starting address of the FTL table entry and the offset of the namespace logical address within the global logical address space indicated by the namespace unit; and obtaining the physical address from the FTL table entry.

[0037] According to one of the second to sixth namespace creation methods of the seventh aspect of the present application, a seventh namespace creation method according to the seventh aspect of the present application is provided, wherein: the allocated namespace unit is recorded at the first position in the entry indexed by the namespace identifier in the NS unit mapping table, wherein the first position corresponds to the position of the namespace logical address of the IO command in the namespace logical address space accessed by the IO command.

[0038] According to one of the second to seventh namespace creation methods of the seventh aspect of the present application, an eighth namespace creation method according to the seventh aspect of the present application is provided, wherein the allocated namespace unit is obtained from an available namespace unit from an NS unit allocation table, wherein the entry of the NS unit allocation table records whether the namespace unit is allocated to the namespace.

[0039] According to one of the second to eighth namespace creation methods of the seventh aspect of the present application, a ninth namespace creation method according to the seventh aspect of the present application is provided, which also includes: recording the NS unit mapping table or the update of the NS unit mapping table to the NVM chip.

[0040] According to the ninth namespace creation method of the seventh aspect of the present application, a tenth namespace creation method according to the seventh aspect of the present application is provided, which also includes: recording the NS unit allocation table or an update of the NS unit allocation table to the NVM chip.

[0041] According to the eighth aspect of the present application, a first namespace creation device according to the eighth aspect of the present application is provided, including: a command receiving module, used to receive a command for creating a namespace, the command indicating the size of the namespace to be created; an identifier allocation module, used to allocate a namespace identifier for the namespace to be created; an NS unit mapping table module, used to add an entry in the NS unit mapping table to record the namespace identifier.

[0042] According to the ninth aspect of the present application, a first IO command processing method according to the ninth aspect of the present application is provided, including: receiving an IO command, wherein the IO command indicates a namespace identifier and a namespace logical address; allocating a namespace unit to the namespace logical address, wherein the namespace unit indicates a continuous global logical address space; recording the allocated namespace unit in the entry indexed by the namespace identifier in the NS unit mapping table; obtaining a physical address based on the allocated namespace unit and the namespace logical address mapping indicated by the IO command; and accessing the physical address to respond to the IO command.

[0043] According to the first IO command processing method of the ninth aspect of the present application, a second IO command processing method according to the ninth aspect of the present application is provided, which also includes: if a namespace unit has been allocated for the namespace logical address, then the physical address is obtained based on the allocated namespace unit and the namespace logical address mapping indicated by the IO command without the need to allocate the namespace unit again, wherein the namespace unit indicates a continuous global logical address space.

[0044] According to the first or second IO command processing method of the ninth aspect of the present application, a third IO command processing method according to the ninth aspect of the present application is provided, wherein one or more namespace units are allocated based on the namespace logical address and the namespace logical address length of the IO command.

[0045] According to one of the first to third IO command processing methods of the ninth aspect of the present application, a fourth IO command processing method according to the ninth aspect of the present application is provided, wherein the global logical address accessed by the IO command is obtained based on the offset of the namespace logical address within the global logical address space indicated by the namespace unit; and the global logical address accessed by the IO command is converted into the physical address.

[0046] According to one of the first to fourth IO command processing methods of the ninth aspect of the present application, a fifth IO command processing method according to the ninth aspect of the present application is provided, wherein the first address of the FTL table entry is obtained based on the namespace unit; the FTL table entry is obtained based on the first address of the FTL table entry and the offset of the namespace logical address within the global logical address space indicated by the namespace unit; and the physical address is obtained from the FTL table entry.

[0047] According to one of the first to fifth IO command processing methods of the ninth aspect of the present application, a sixth IO command processing method according to the ninth aspect of the present application is provided, wherein the allocated namespace unit is recorded at the first position in the entry indexed by the namespace identifier in the NS unit mapping table, wherein the first position corresponds to the position of the namespace logical address of the IO command in the namespace logical address space accessed by the IO command.

[0048] According to one of the first to sixth IO command processing methods of the ninth aspect of the present application, a seventh IO command processing method according to the ninth aspect of the present application is provided, wherein the allocation of the namespace unit is to obtain an available namespace unit from an NS unit allocation table, wherein the entry of the NS unit allocation table records whether the namespace unit is allocated to the namespace.

[0049] According to the tenth aspect of the present application, a first IO command processing device according to the tenth aspect of the present application is provided, including: a command receiving module, used to receive an IO command, wherein the IO command indicates a namespace identifier and a namespace logical address; a namespace unit allocation module, used to allocate a namespace unit to the namespace logical address, wherein the namespace unit indicates a continuous global logical address space; an NS unit mapping table module, used to record the allocated namespace unit in the entry indexed by the namespace identifier in the NS unit mapping table; an address mapping module, used to obtain a physical address based on the allocated namespace unit and the namespace logical address indicated by the IO command; and an access module, used to access the physical address to respond to the IO command.

[0050] According to the eleventh aspect of the present application, a first solid-state storage device according to the eleventh aspect of the present application is provided, including a controller and a non-volatile memory; the processor in the controller executes the method described in any one of the technical solutions in the first aspect, the third aspect, the fifth aspect, the seventh aspect and the ninth aspect of the present application by running a program. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The invention, together with the preferred mode of use and further objects and advantages thereof, will be best understood by reference to the following detailed description of illustrative embodiments when read in conjunction with the accompanying drawings, in which:

[0052] Figure 1 shows a block diagram of a solid-state storage device;

[0053] Figure 2 is a schematic diagram of an FTL table and an NS unit according to an embodiment of the present application;

[0054] Figure 3A is a NS unit mapping table according to an embodiment of the present application;

[0055] Figure 3B is an NS unit allocation table according to an embodiment of the present application;

[0056] Figure 4 A flowchart showing the mapping of namespace logical addresses to global logical addresses is shown;

[0057] Figure 5 is a flowchart of creating a namespace according to an embodiment of the present application;

[0058] Fig. 6A is an NS unit mapping table before creating a namespace according to an embodiment of the present application;

[0059] Figure 6B is an NS unit allocation table before creating a namespace according to an embodiment of the present application;

[0060] Fig. 7A is a NS unit mapping table after the namespace is created according to an embodiment of the present application;

[0061] Figure 7B is an NS unit allocation table after the namespace is created according to an embodiment of the present application;

[0062] Figure 8 is a flowchart of deleting a namespace according to an embodiment of the present application;

[0063] Fig.9A is an NS unit mapping table before deleting the namespace according to an embodiment of the present application;

[0064] Fig. 9B is an NS unit allocation table before deleting the namespace according to an embodiment of the present application;

[0065] Fig. 10A is the NS unit mapping table after deleting the namespace according to an embodiment of the present application;

[0066] Fig. 10B is an NS unit allocation table after deleting the namespace according to an embodiment of the present application; and

[0067] Fig.11A and Fig. 11BThis is a flowchart of creating a namespace and processing IO commands according to another embodiment of the present application. DETAILED DESCRIPTION

[0068] Figure 2 It is a schematic diagram of an FTL table and an NS unit (namespace unit) according to an embodiment of the present application.

[0069] The FTL table 21 includes FTL table entries (e.g., FTL table entries 210 and 212). The FTL table entries record the mapping relationship between the logical address and the physical address. The FTL table 21 is stored in the memory. It can be understood that the logical address of the FTL table entry does not need to be stored in the memory, but the address of the memory is used to indicate the logical address, and the stored value is used to indicate the physical address. The FTL table can also be recorded in other ways known to those skilled in the art.

[0070] According to an embodiment of the present application, a NS unit ( Figure 2 In the example, each of NSUN1, NSUN2, and NSUN3 indicates an NS unit. Each NS unit indicates a continuous logical address space. For example, NSUN1 indicates a logical address space of 0 to M-1, while NSUN2 indicates a logical address space of M to 2M-1, and NSUN3 indicates a logical address space of 2M to 3M-1.

[0071] 1~3M, NSUN k indicates the logical address space (k-1)M~(kM-1). The logical address space of each NS unit is much larger than the logical address space indicated by the FTL table entry. For example, the logical address space of a NS unit is indicated by 1000 consecutive logical address FTL table entries.

[0072] The logical address space indicated by the FTL table 21 is called the global logical address space, and the logical address therein is called the global logical address. The NS units are ordered, and the sequence number k of the NS unit indicates the position of the NS unit in the global logical address space. Optionally, the first address of the FTL table entry corresponding to the NS unit is used to indicate the NS unit. For example, see Figure 2 , using the first address of FTL table entry 210 to identify NSUN 1.

[0073] Figure 3A is a NS unit mapping table according to an embodiment of the present application, Figure 3B This is an NS unit allocation table according to an embodiment of the present application.

[0074] See also Figure 3A ,Each entry in the NS unit mapping table records one of the namespaces identified by NSID and one or more NS units assigned to the namespace. NSID is also called namespace identifier, which is used to identify a namespace. Figure 3A In the example, entry 310 of the NS unit mapping table records that the namespace with NSID 1 (abbreviated as NS1) is assigned three NS units (NSUN 1, NSUN 9 and NSUN 12). The one or more NS units recorded in the entry of the NS unit mapping table are sorted. The three NS units assigned to NS1 provide logical address space for NS1 in sequence. For example, the logical address space of NS1 is 0~(3M-1), where NSUN1 provides NS1's logical address space 0~M-1, NSUN9 provides NS1's logical address space M~2M-1, and NSUN12 provides NS1's logical address space 2M~3M-1.

[0075] As another example, the logical address space of NS1 is 0~(3M-n) (where M is an integer and n is an integer less than M), wherein NSUN1 provides the logical address space 0~M-1 of NS1, NSUN9 provides the logical address space M~2M-1 of NS1, and NSUN12 provides the logical address space 2M~3M-n of NS1. In this example, the logical address space provided by NSUN12 to NS1 is only a part of the logical address space of NSUN 12. Even if the namespace NS1 only needs 1 logical block, 1 complete N-unit is allocated to it.

[0076] For the purpose of clarity, the logical address space belonging to a namespace is referred to as the namespace logical address space, and the logical address therein is referred to as the namespace logical address. It can be understood that in the logical address space of NS1, NSUN9 provides a range of M to 2M-1 of the namespace logical address space, and in the solid-state storage device, NSUN9 provides a range of 8M to 9M-1 of the global logical address space. It is still understandable that the global logical address space and the namespace logical address space can be converted through the NS unit (its sequence number or the first address of the FTL table entry). Thus, the multiple NS units recorded in the entries of the NS unit mapping table provide a continuous address space (namespace logical address space) for each namespace, and for any address of the namespace logical address space, it can be mapped to the global logical address space by providing the NS unit of the address.

[0077] See also Figure 3B The NS unit allocation table records whether the NS unit of the solid-state storage device is allocated to the namespace. Figure 3A NSUN1, NSUN9 and NSUN12 are assigned to NS1. Figure 3B In the NS unit allocation table, the entries corresponding to NSUN1, NSUN9 and NSUN12 record that these NS units have been allocated. Figure 3BOther NS units that are not allocated to the namespace are also recorded in the NS unit allocation table. Optionally, only NS units that are not allocated to the namespace are recorded in the NS unit allocation table, so that the NS unit allocation table becomes an NS unit resource pool that provides all available NS units.

[0078] exist Figure 3B In the example, the entries of the NS unit allocation table record the serial numbers of the NS units (e.g., NSUN 1, NSUN 2) and the allocation of the NS units. In another embodiment, since the entries of the NS unit allocation table record the allocation of NS units with consecutive serial numbers, the serial numbers of the NS units can be omitted in the NS unit allocation table, and the serial numbers of the corresponding NS units can be determined according to the addresses of the entries of the NS unit allocation table. As another example, the NS unit is identified by replacing the serial number of the NS unit with the first address of the FTL table entry corresponding to the global logical address space indicated by the NS unit.

[0079] Figure 4 A flowchart showing the mapping of namespace logical addresses to global logical addresses.

[0080] The IO command received by the solid-state storage device indicates the NSID and the namespace logical address. In order to access the solid-state storage device according to the IO command, the namespace logical address of the IO command needs to be converted into a global logical address of the solid-state storage device.

[0081] In response to receiving the IO command, the NSID indicated by the IO command is obtained, and the NS unit mapping table is accessed according to the NSID (see Figure 3A ), obtain the NS unit assigned to the namespace with the NSID (410). And divide the namespace logical address indicated by the IO command by the size of the NS unit to obtain the quotient and remainder (420). Use the quotient as the ordinal number to obtain the NS unit from the NS unit assigned to the namespace with the NSID, and use the remainder as the offset value within the obtained NS unit. Based on the ordinal number of the obtained NS unit, obtain the position of the NS unit in the global logical address space, and add the offset value to obtain the global logical address accessed by the IO command (430). Based on the conversion of the global logical address into a physical address through the FTL table, access the physical address to respond to the IO command.

[0082] For example, the IO command indicates access to four consecutive logical blocks starting from the logical address 2358 of the namespace NS1. Query the NS unit mapping table based on NS1 ( Figure 3A) obtains NS units NSUN1, NSUN9 and NSUN12. And divides the namespace logical address 2358 by the size M of the logical address space of the NS unit (for example, M is equal to 2000) to obtain the quotient (q) and the remainder (r). Using the quotient (q) as the ordinal number, select the q+1th (numbered from 1) NS unit (for example, NSUN9) belonging to NS1 obtained from the NS unit mapping table, and obtain the global logical address M*(9-1) of NSUN9 through the ordinal number "9" of NSUN9, and add the remainder (r) as the offset value. Then the global logical address of the logical address 2358 of NS1 is M*(9-1)+r. And the IO command is to access the 4 logical blocks starting from the logical address M*(9-1)+r in the global logical address space.

[0083] As another example, if the IO command indicates to access 4 consecutive logical blocks starting from the logical address 2358 of the namespace NS1, and the length from the offset value (r) to the end of the logical address space in the logical address space of NSUN9 is less than 4 logical blocks, it means that the logical address space accessed by the IO command is provided by two NS units. Then the first part of the logical address space accessed by the IO command (referred to as r1) is provided from the logical address space of NSUN 9 from the offset value (r) to the end of the logical address space, and the second part of the logical address space accessed by the IO command (referred to as r2) is provided from the starting position of the logical address space of the q+2 NS unit (NSUN12) belonging to NS1, and r1+r2=4 (the length of the logical address accessed by the IO command).

[0084] As still another example, the IO command indicates access to four consecutive logical blocks starting from the logical address 2358 of the namespace NS1. And the namespace logical address 2358 is divided by the size M of the logical address space of the NS unit to obtain the quotient (q) and the remainder (r). In the entries of the NS unit mapping table, the address of the first FTL table entry indicating the global logical address space corresponding to each NS unit is recorded sequentially. The entry of the NS unit mapping table is obtained according to NS1, and the address of the starting FTL table entry corresponding to the global logical address space of the q+1th NS unit (for example, NSUN9) belonging to NS1 is obtained at the position where the offset value of the mapping table entry is the quotient (q). According to the address of the starting FTL table entry, the remainder (r) is added as the offset value (optionally, appropriate adjustments are made according to the size of the logical block and the size of the logical address space corresponding to the FTL table entry, for example, the logical address space indicated by each FTL table entry accommodates 4 logical blocks), and the FTL table entry address of the global logical address corresponding to the logical address 2358 of NS1 is obtained.

[0085] Other methods can be used to obtain the global logical address of the NS unit. For example, an NS unit address mapping table is provided to record the starting address of each NS unit in the global logical address space. In this way, each NS unit can have a logical address space of different sizes, thereby improving the utilization of the NS unit. As another example, the remainder (r) is used as the ordinal number to select the NS unit, and the quotient (q) is used as the offset value in the logical address space corresponding to the NS unit.

[0086] To process the IO command, the NSID and the namespace logical address are indicated by the IO command to obtain the global logical address, and the global logical address FTL table is used to obtain the physical address, and the physical address is accessed to obtain the data to be accessed by the IO command.

[0087] Figure 5 This is a flowchart of creating a namespace according to an embodiment of the present application.

[0088] To create a namespace in the solid-state storage device, the host sends a command for creating a namespace to the solid-state storage device, where the command indicates the size of the namespace that is desired to be created.

[0089] In response to receiving a command to create a namespace (510), NS units are allocated according to the size of the namespace to be created (520). The result of dividing the size of the namespace to be created by the size of the NS unit is rounded up to obtain the number of NS units to be allocated. For example, to create a namespace of 100GB, each NS unit is 10GB in size, and 10 NS units are allocated. To create a namespace of 101GB, each NS unit is 10GB in size, and 11 NS units are allocated to accommodate the created namespace.

[0090] An unused NSID is allocated to the newly created namespace (530). For example, two namespaces, NS1 and NS2, already exist in the solid-state storage device, and NS3 can be allocated to the newly created namespace as its NSID.

[0091] The mapping of the newly allocated NSID to the NS unit is recorded in the NS unit mapping table (550), and the NS unit is also recorded in the NS unit allocation table that the NS unit has been allocated.

[0092] Optionally, metadata indexed by NSID is also created for the namespace (570), and the size of the namespace, the logical block size, and / or the starting address of the NS unit mapping table entry corresponding to the NSID are recorded in the metadata. Thus, when an IO command to access the namespace with the NSID is received, the metadata is obtained using the NSID as an index, and the NS unit for responding to the IO command (the sequence number of the NS unit, or the first address of the FTL table indicating the global logical address space corresponding to the NS unit) is obtained from the starting address of the NS unit mapping table entry corresponding to the NSID at the offset value position obtained by dividing the namespace logical address of the IO command by the size of the NS unit.

[0093] Still optionally, the NS unit mapping table, NS unit allocation table and / or namespace metadata or updates thereof are also recorded to the NVM chip of the solid-state storage device. To record updates of the NS unit mapping table and the NS unit allocation table, each assigned NS unit serial number and the corresponding NSID can be recorded in pairs. Thus, based on the initial values ​​and all updates of the NS unit mapping table and the NS unit allocation table, the updated unit mapping table and the NS unit allocation table can be reconstructed. When the solid-state storage device is powered on, the unit mapping table and the NS unit allocation table are reconstructed.

[0094] And the solid state storage provides a response to the host to indicate that the namespace creation is complete. The NSID of the created namespace is also indicated in the response.

[0095] Fig. 6A is the NS unit mapping table before creating the namespace according to the embodiment of the present application, and Figure 6B is an NS unit allocation table before creating a namespace according to an embodiment of the present application, Fig. 7A is the NS unit mapping table after the namespace is created according to an embodiment of the present application, and Figure 7B This is the NS unit allocation table after the namespace is created according to the embodiment of the present application.

[0096] See also Fig. 6A ,Each entry of the NS unit mapping table records one of the namespaces identified by NSID and one or more NS units assigned to the namespace. Fig. 6A In the example, entry 610 of the NS unit mapping table records that the namespace with NSID NS1 (abbreviated as NS1) is allocated with three NS units (NSUN1, NSUN9 and NSUN12). Entry 620 of the NS unit mapping table records that the namespace with NSID NS2 (abbreviated as NS2) is allocated with four NS units (NSUN 4-7).

[0097] See also Figure 6BThe NS unit allocation table records whether the NS unit of the solid-state storage device is allocated to the namespace. Fig. 6A NSUN1, NSUN4-7, NSUN9, and NSUN12 are assigned to the namespace. Figure 6B In the NS unit allocation table, the entries corresponding to NSUN1, NSUN4-7, NSUN9 and NSUN12 record that these NS units have been allocated. Figure 6B Other NS units are also recorded in that are not assigned to the namespace.

[0098] For example, a command to create a namespace of 15GB is received from the host. The total size of the allocated NS units should not be less than the size of the namespace to be created. For example, the size of each NS unit is 10GB, and two NS units need to be allocated. Figure 6B Get two unassigned NS units from the NS unit allocation table shown in the figure (for example, NS units numbered 2 and 8, respectively denoted as NSUN2 and NSUN8). Assign NSID NS3 to the namespace to be created. Add an entry to the NS unit mapping table and record that NS3 corresponds to NSUN2 and NSUN8 (see Fig. 7A ). Record in the NS unit allocation table that NSUN2 and NSUN8 have been allocated (see Figure 7B ). Optionally, metadata is also created for NS3 to record that the size of namespace NS3 is 15 GB and / or the starting address of the NS unit mapping table entry corresponding to NS3.

[0099] After the created namespace NS3 is attached to the NVMe controller, NS3 can respond to the host's IO commands. After receiving an IO command to access NS3, the NS unit belonging to NS3 is obtained from the NS unit mapping table or (if present) the namespace metadata indexed by NS3 according to the NSID (NS3) of the IO command, and the namespace logical address accessed by the IO command is converted to a global logical address, and the global logical address is accessed to respond to the IO command.

[0100] Figure 8 This is a flowchart of deleting a namespace according to an embodiment of the present application.

[0101] To delete a namespace in the solid-state storage device, the host sends a command to delete the namespace to the solid-state storage device, where the command indicates the NSID of the namespace to be deleted.

[0102] In response to receiving a command to delete a namespace (810), the NSID of the namespace to be deleted is obtained. The NS unit mapping table is accessed and the entry corresponding to the NSID is deleted (820). Optionally, all entries in the NS unit mapping table after the entry corresponding to the NSID are also moved to fill the space occupied by the deleted entries, so that the size of the NS unit mapping table does not become too large due to holes in the table. And based on the address of the moved entry, the starting address of the NS unit mapping table entry corresponding to the NSID in the metadata of the namespace indexed by the NSID is updated. When the entry corresponding to the NSID is deleted from the NS unit mapping table, or the starting address of the NS unit mapping table entry corresponding to the NSID is deleted in the metadata of the namespace indexed by the NSID (if any), the namespace can no longer be accessed because the mapping of the namespace logical address to the global logical address cannot be completed.

[0103] The NS units indicated in the deleted NS unit mapping table entries are also returned to the NS unit allocation table, and the NS units are recorded in the NS unit allocation table as being in an unallocated state (830). The NS units in an unallocated state can be allocated to other namespaces again.

[0104] Optionally, updates to the NS unit mapping table, NS unit allocation table and / or namespace metadata are also recorded to the NVM chip of the solid-state storage device.

[0105] And the solid-state storage provides a response to the host to indicate the namespace deletion is complete.

[0106] Fig.9A is the NS unit mapping table before deleting the namespace according to an embodiment of the present application, and Fig. 9B is an NS unit allocation table before deleting the namespace according to an embodiment of the present application, Fig. 10A is the NS unit mapping table after deleting the namespace according to an embodiment of the present application, and Fig. 10B This is the NS unit allocation table after deleting the namespace according to an embodiment of the present application.

[0107] See also Fig.9A ,Each entry of the NS unit mapping table records one of the namespaces identified by NSID and one or more NS units assigned to the namespace. Fig.9AIn the example, entry 910 of the NS unit mapping table records that the namespace with NSID NS1 (abbreviated as NS1) is assigned 3 NS units (NSUN1, NSUN9 and NSUN12). Entry 920 of the NS unit mapping table records that the namespace with NSID NS2 (abbreviated as NS2) is assigned 4 NS units (NSUN4-7). Entry 930 of the NS unit mapping table records that the namespace with NSID NS 3 (abbreviated as NS2) is assigned 2 NS units (NSUN2 and NSUN8).

[0108] See also Fig. 9B The NS unit allocation table records whether the NS unit of the solid-state storage device is allocated to the namespace. Fig.9A NSUN1, NSUN2, NSUN4-9, and NSUN12 are assigned to the namespace. Fig. 9B In the NS unit allocation table, the entries corresponding to NSUN1, NSUN2, NSUN4-9 and NSUN12 record that these NS units have been allocated. Fig. 9B Other NS units are also recorded in that are not assigned to the namespace.

[0109] As an example, a command is received from the host to delete the namespace with NSID NS2. The NS unit mapping table is accessed according to the NSID, and the entry with NSID NS2 is deleted. Optionally, all entries after the entry with NSID NS2 in the NS unit mapping table are moved to fill the storage space left after the entry with NSID NS2 is deleted. Fig. 10A , the entry with NSID NS3 is moved forward. It is understandable that, due to the different number of NS units occupied by the namespace, the size of each entry in the NS unit mapping table may be different. Optionally, the solid-state storage device also maintains metadata of the namespace indexed by NSID, and when the namespace with NSID NS2 is deleted, its metadata is deleted together. The NS units (NSUN 4-7) originally assigned to the namespace with NSID NS2 recorded in the NS unit mapping table are also moved to the NS unit allocation table ( Fig. 10B ) is marked as unallocated. Thus, these NS units (NSUN4-7) can be reallocated to other namespaces, and NSID "NS 2" can also be reallocated to other namespaces. Optionally, updates to the NS unit mapping table, NS unit allocation table, and / or namespace metadata are also recorded to the NVM chip of the solid-state storage device. And the solid-state storage provides a response to the host to indicate that the namespace deletion is complete.

[0110] Fig.11A and Fig. 11B This is a flowchart of creating a namespace according to another embodiment of the present application.

[0111] In response to receiving the command to create a namespace (1110), an unused NSID is allocated to the newly created namespace (1130). For example, if two namespaces NS1 and NS2 already exist in the solid-state storage device, NS3 can be allocated to the newly created namespace as its NSID.

[0112] The newly allocated NSID is recorded in the NS unit mapping table entry (1150). At this time, the NS unit has not been allocated for the namespace NS3, so only the newly allocated NSID is recorded in the NS unit mapping table entry without including the NS unit. And there is no need to update the NS unit allocation table. Sufficient space is reserved in the NS unit mapping table entry to accommodate one or more NS units required for the namespace. For example, if the namespace requires 3 NS units, storage space for accommodating 3 NSIDs or corresponding 3 FTL table entry first addresses is reserved in the NS unit allocation table.

[0113] Optionally, metadata indexed by NSID is also created for the namespace, and the size of the namespace, the logical block size, and / or the starting address of the NS unit mapping table entry corresponding to the NSID (and marking that the NS unit has not been allocated) are recorded in the metadata. Optionally, the update of the NS unit mapping table, the NS unit allocation table and / or the namespace metadata is also recorded to the NVM chip of the solid-state storage device. Still optionally, the NS units required for the created namespace are recorded, although these NS units may not have been allocated to the namespace. In one embodiment, the difference between the total number of NS units of the solid-state storage device and the NS units required for the created namespace is the number of NS units that can be used to create other namespaces. In another embodiment, since the host (user) will not use all the storage capacity of the namespace in most cases, the NS units that have not been allocated in the solid-state storage device can be used to create other namespaces, so that the number of NS units required for the created namespace may be greater than the number of all NS units of the solid-state storage device to improve the utilization rate of the NS units.

[0114] And the solid state storage provides a response to the host to indicate that the namespace creation is complete. The NSID of the created namespace is also indicated in the response.

[0115] In accordance with Fig. 11B In the embodiment of the present invention, when an IO command for accessing the namespace is received, the NS unit is actually allocated to the namespace. Fig. 11BIn response to receiving an IO command (1160), the IO command indicates the NSID of the namespace to be accessed and the namespace logical address. Check whether an NS unit has been allocated for the namespace logical address to be accessed through the NS unit mapping table or the namespace metadata (1170). If an NS unit has been allocated for the namespace logical address to be accessed by the IO command, obtain the global logical address and / or the corresponding physical address based on the NS unit, and access the physical address to respond to the IO command (1175). If an NS unit has not been allocated for the namespace logical address to be accessed by the IO command, obtain an unallocated NS unit (for example, by accessing the NS unit allocation table), and fill the obtained NS unit sequence number or the starting address of the FTL table entry corresponding to the NS unit (the starting address is in a linear relationship with the NS unit sequence number) into the entry in the NS unit mapping table corresponding to the NSID accessed by the IO command (1180).

[0116] Furthermore, the position of the allocated NS unit in the NS unit mapping table entry is determined according to the namespace logical address of the IO command. For example, if the namespace occupies 3 NS units, and the namespace logical address of the IO command indicates access to the second NS unit, the NS unit allocated in step 1180 is placed in the second storage position of the NS unit mapping table entry. As another example, if the namespace logical address of the IO command indicates access to the second and third NS units, the two NS units allocated in step 1180 are placed in the second and third storage positions of the NS unit mapping table entry. Furthermore, for the allocated NS units, the NS unit allocation table is updated to record the allocated NS units.

[0117] The global logical address and / or physical address corresponding to the namespace logical address is obtained according to the allocated NS unit, and the physical address is accessed to respond to the IO command (1190).

[0118] exist Fig.11A and 11B In the illustrated embodiment, NS units are allocated to the namespace only when it is used, thereby improving the utilization of the NS units.

[0119] As an example, to create a namespace of 100GB, each NS unit is 10GB in size, and the number of NS units allocated to the namespace by the solid-state storage device is recorded to increase by 10, but the NS units are not actually allocated to the created namespace. NSID (NS4) is assigned to the namespace. The NS4 is recorded in the entry of the NS unit mapping table, but there is no NS unit in the namespace, and 10 storage locations are reserved in the NS unit mapping table entry indexed by NS4 to accommodate the sequence number of the NS unit or the starting address of the FTL table entry corresponding to the NS unit. The namespace creation is indicated to the host successfully.

[0120] In response to receiving an IO command issued by the host, for example, accessing the namespace logical address A of NS4. Check whether an NS unit has been allocated for the namespace logical address A of NS4. For example, if an NS unit has been allocated, the accessed NS unit should be the A / M+1th NS unit allocated to NS4, where M is the size of the logical address space of the NS unit. By accessing the NS unit mapping table entry with NS4 as the index, it can be known whether its A / M+1th NS unit has been allocated. If the NS unit has been allocated, the global logical address corresponding to the namespace logical address A of NS4 (or the FTL table entry address corresponding to the global logical address, or the physical address corresponding to the global logical address) is obtained according to the sequence number of the NS unit or the starting address of the corresponding FTL table entry. If the NS unit has not been allocated, access the NS unit allocation table to obtain the unallocated NS unit, fill in the A / M+1th position of the NS unit mapping table entry indexed by NS4, and record in the NS unit allocation table that the NS unit has been allocated. And according to the serial number of the NS unit or the starting address of the corresponding FTL table entry, the global logical address corresponding to the namespace logical address A of NS4 (or the FTL table entry address corresponding to the global logical address, or the physical address corresponding to the global logical address) is obtained, and the physical address is accessed to respond to the IO command.

[0121] The embodiment of the present invention also provides a program including program codes. When the program is loaded into a host CPU and executed in the CPU, the program codes enable the CPU to execute the above method executed by the host.

[0122] An embodiment of the present invention also provides a program including program code, which, when loaded into a storage device and executed on the storage device, causes a processor of the storage device to execute one of the above methods performed by the device.

[0123] It should be understood that each block of the block diagram and the flow chart and the combination of blocks of the block diagram and the flow chart can be implemented by various means including computer program instructions, respectively. These computer program instructions can be loaded onto a general-purpose computer, a special-purpose computer or other programmable data control device to produce a machine, so that the instructions executed on the computer or other programmable data control device create a device for implementing the functions specified in one or more flow chart blocks.

[0124] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data control device to function in a particular manner, so that the instructions stored in the computer readable memory can be used to manufacture an article of manufacture including computer readable instructions for implementing the functions specified in one or more flowchart blocks. The computer program instructions may also be loaded onto a computer or other programmable data control device to cause a series of operations to be performed on the computer or other programmable data control device, thereby producing a computer-implemented process, and the instructions executed on the computer or other programmable data control device provide operations for implementing the functions specified in one or more flowchart blocks.

[0125] Thus, the blocks of the block diagrams and flow charts support a combination of means for performing a specified function, a combination of operations for performing a specified function, and a combination of program instruction means for performing a specified function. It should also be understood that each block of the block diagrams and flow charts and the combination of blocks of the block diagrams and flow charts can be implemented by a hardware-based special-purpose computer system that performs the specified function or operation, or by a combination of special-purpose hardware and computer instructions.

[0126] Although the present invention has been described with reference to examples, this is for illustrative purposes only and is not intended to limit the present invention, and changes, additions and / or deletions to the embodiments may be made without departing from the scope of the present invention.

[0127] Those skilled in the art to which these embodiments relate and who benefit from the teachings presented in the above description and associated drawings will recognize many modifications and other embodiments of the invention described herein. Therefore, it should be understood that the invention is not limited to the specific embodiments disclosed, and modifications and other embodiments are intended to be included within the scope of the appended claims. Although specific terms are employed herein, they are used only in a general and descriptive sense and not for the purpose of limitation.

Claims

1. A method for creating a namespace, characterized in that: include: Receiving a command to create a namespace, the command indicating a size of the namespace to be created; Allocate one or more NS units according to the size of the namespace to be created, where the NS unit indicates a continuous global logical address space; Assign a namespace identifier to the namespace to be created; Adding an entry in the NS unit mapping table to record the namespace identifier and the allocated one or more NS units; The logical address space belonging to a namespace is called the namespace logical address space, and the logical address therein is called the namespace logical address; any address in the namespace logical address space can be mapped to the global logical address space by providing the NS unit of the address; Allocating the NS unit includes: obtaining an available NS unit from an NS unit allocation table and allocating the NS unit to the namespace to be created, wherein an entry in the NS unit allocation table records whether the NS unit is allocated to the namespace; Obtain one or more NS units corresponding to the namespace identifier, and select a first NS unit from one or more namespaces based on the namespace logical address, wherein the global logical address space indicated by the first NS unit provides the global logical address accessed by the IO command, and each NS unit has a logical address space of different sizes.

2. The method according to claim 1, characterized in that Also includes: The NS cell mapping table or updates to the NS cell mapping table are recorded to the NVM chip.

3. The method according to claim 1, characterized in that Also includes: The NS unit allocation table or updates to the NS unit allocation table are recorded to the NVM chip.

4. The method according to claim 2, characterized in that: in One or more NS units in the NS unit mapping table entry are ordered, and the position of the NS unit in the NS unit mapping table entry indicates the position of the NS unit in the global logical address space.

5. The method according to claim 4, characterized in that Also includes: Receiving an IO command, wherein the IO command indicates a namespace identifier and a namespace logical address; Allocating an NS unit to the namespace logical address, wherein the NS unit indicates a continuous global logical address space; Record the allocated NS unit in the entry indexed by the namespace identifier in the NS unit mapping table; The physical address is obtained according to the allocated NS unit and the namespace logical address mapping indicated by the IO command; The physical address is accessed in response to the IO command.

6. The method according to claim 5, characterized in that Also includes: If an NS unit has been allocated for the namespace logical address, the physical address is obtained based on the allocated NS unit and the namespace logical address mapping indicated by the IO command without allocating NS units again, wherein the NS unit indicates a continuous global logical address space.

7. The method according to claim 6, characterized in that One or more NS units are allocated according to the namespace logical address and the namespace logical address length of the IO command.

8. The method according to claim 7, characterized in that Also includes: Obtaining the global logical address accessed by the IO command according to the offset of the namespace logical address in the global logical address space indicated by the NS unit; And converting the global logical address accessed by the IO command into the physical address.

9. The method according to claim 8, characterized in that Also includes: Obtaining the first address of the FTL table entry according to the NS unit; obtaining the FTL table entry according to the first address of the FTL table entry and the offset of the namespace logical address in the global logical address space indicated by the NS unit; and obtaining the physical address from the FTL table entry.

10. The method according to claim 5, characterized in that in: The allocated NS unit is recorded at the first position in the entry indexed by the namespace identifier in the NS unit mapping table, wherein the first position corresponds to the position of the namespace logical address of the IO command in the namespace logical address space accessed by the IO command.

11. The method according to claim 10, characterized in that in, Any address in the namespace logical address space can be mapped into the global logical address space by providing the NS unit of the address.

12. A method for deleting a namespace, characterized in that: include: receiving a command for deleting a namespace, the command indicating a namespace identifier of the namespace to be deleted; Deleting an entry indexed by the namespace identifier from the NS unit mapping table, wherein the NS unit mapping table entry is indexed by the namespace identifier and has as its content the first address of the FTL table entry of the continuous global logical address space indicated by the NS unit corresponding to the namespace identifier; as well as Reclaiming the namespace identifier; The entry in the NS unit mapping table records the namespace identifier and the allocated one or more NS units; Allocating the NS unit includes: obtaining an available NS unit from an NS unit allocation table, wherein an entry of the NS unit allocation table records whether the NS unit is allocated to the namespace; Obtain one or more NS units corresponding to the namespace identifier, wherein the NS unit indicates a continuous global logical address space; select a first NS unit from the one or more namespaces according to the namespace logical address, wherein the global logical address space indicated by the first NS unit provides a global logical address accessed by the IO command; The logical address space belonging to a namespace is called the namespace logical address space. Any address in the namespace logical address space can be mapped to the global logical address space by providing an NS unit of the address. Each NS unit has a logical address space of a different size.

13. The method according to claim 12, characterized in that Also includes: The NS unit recorded in the entry of the NS unit mapping table that is deleted is marked as unallocated in the NS unit allocation table, wherein the entry of the NS unit allocation table records whether the NS unit is allocated to the namespace.

14. The method according to claim 12, characterized in that Also includes: All entries after the deleted entry in the NS unit mapping table are moved to fill the storage space occupied by the deleted entry.

15. The method according to claim 12, characterized in that Also includes: The NS cell mapping table or updates to the NS cell mapping table are recorded to the NVM chip.

16. The method according to claim 12, characterized in that Also includes: The NS unit allocation table or updates to the NS unit allocation table are recorded to the NVM chip.

17. The method according to claim 12, characterized in that The recycled namespace identifier may be assigned to a new namespace.

18. A solid-state storage device, characterized in that: Including, controller and non-volatile storage Device; The processor in the controller executes the method according to any one of claims 1-17 by running a program.

Citation Information

Patent Citations

  • Apparatus, system, and method for allocating storage

    US20110060887A1

  • Namespace Access Control in NVM Express PCIe NVM with SR-IOV

    US20140281040A1

  • Data protection in a namespace

    US20160342463A1

  • Memory system for controlling nonvolatile memory

    US20170024137A1