Cache provided by FTL, its optimization method and storage device

By introducing a cache management mechanism into FTL, the problem of unifying address mapping and cache management of solid-state storage devices is solved, performance is improved, read and write operations are accelerated through the cache mechanism, and address mapping and data management are optimized.

CN110968525BActive Publication Date: 2024-10-01MEMBLAZE TECH BEIJING
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN201811154294.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-09-30
Publication Date
2024-10-01
Estimated Expiration
2038-09-30

AI Technical Summary

Technical Problem

In the existing technology, it is difficult for the FTL (Flash Translation Layer) of solid-state storage devices to effectively and uniformly manage the address mapping and cache of the storage device, resulting in limited performance improvement.

Method used

By introducing a cache management mechanism in FTL, we obtain the logical address and query the cache entry. If there is a hit, access the cache unit. If there is a miss, query the FTL table to obtain the NVM data frame address, and update the validity bitmap and cache container index when writing commands. , to achieve mapping and cache management of logical addresses to physical addresses.

Benefits of technology

It improves the performance of solid-state storage devices, accelerates read and write operations through the cache mechanism, optimizes address mapping and data management, and improves overall storage performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110968525B_ABST
    Figure CN110968525B_ABST
Patent Text Reader

Abstract

The present application provides a cache provided by FTL, an optimization method thereof, and a storage device. The method provided for a storage device includes: obtaining a logical address for accessing a storage device; querying an FTL cache entry, and if the FTL cache entry records the obtained logical address, accessing the cache unit of the corresponding cache container using the cache container index corresponding to the logical address obtained from the FTL cache entry. The present application is intended to improve the FTL, and the FTL uniformly manages the address mapping and cache of the storage device, thereby improving the performance of the storage device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to storage technology, and more particularly to cache provided by FTL (Flash Translation Layer). Background Art

[0002] Figure 1 The block diagram of the solid-state 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 chips 105 , and a DRAM (Dynamic Random Access Memory) 110 .

[0003] NAND flash memory, phase change memory, FeRAM (Ferroelectric RAM), MRAM (Magnetic Random Access Memory), RRAM (Resistive Random Access Memory), XPoint memory, etc. are common NVMs.

[0004] The interface 103 may be adapted to exchange data with the host via, for example, SATA, IDE, USB, PCIE, NVMe, SAS, Ethernet, Fibre Channel, etc.

[0005] 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, mapping of host logical addresses to flash physical addresses, 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. For example, 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 can also include a processor or a controller, in which software is executed to manipulate the hardware of the control component 104 to process IO (Input / Output) commands. The control component 104 can also be coupled to the DRAM 110 and can access the data of the DRAM 110. The data of the FTL table and / or cached IO commands can be stored in the DRAM.

[0006] The control component 104 includes a flash memory interface controller (or medium interface controller, flash memory channel controller), which 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. Known NVM chip interface protocols include "Toggle", "ONFI" and the like.

[0007] A memory target is one or more logic units (LUNs) within a NAND flash package that share a CE (Chip Enable) signal. A NAND flash 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 chip can execute commands and report status independently of each other.

[0008] Data is usually stored and read on a storage medium in pages. Data is erased in blocks. A block (also called a physical 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.

[0009] In the storage device, the FTL (Flash Translation Layer) is used to maintain the mapping information from the logical address to the physical address. The logical address constitutes the storage space of the solid-state storage device perceived by the 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 related art, the address mapping can also be implemented using the intermediate address form. For example, the logical address is mapped to the intermediate address, and then the intermediate address is further mapped to the physical address.

[0010] 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.

[0011] The FTL of some storage devices is provided by the host coupled to the storage device, the host's memory stores the FTL table, and the host's CPU executes software to provide the FTL. Some storage management devices arranged between the host and the storage device provide the FTL.

[0012] Providing a cache for a storage device to improve the performance of the storage device. For example, Chinese patent applications 201710219077.1, 201710219096.4, and 201710219112.X provide a distributed cache for a solid-state storage device. The cache may also be provided by a host or a storage management device. Summary of the invention

[0013] This application aims to improve the FTL, which uniformly manages the address mapping and cache of the storage device, thereby improving the performance of the storage device.

[0014] According to the first aspect of the present application, a first method for a storage device according to the first aspect of the present application is provided, comprising: obtaining a logical address for accessing a storage device; querying an FTL cache entry, and if the FTL cache entry records the obtained logical address, accessing a cache unit of a corresponding cache container using a cache container index corresponding to the logical address obtained from the FTL cache entry.

[0015] According to a first method for a storage device according to the first aspect of the present application, data indicated by the cache unit is read out from the cache unit according to a read command.

[0016] According to the first or second method for a storage device of the first aspect of the present application, data indicated by a write command is written to the cache unit.

[0017] According to the third method for a storage device of the first aspect of the present application, in response to data indicated by a write command that writes an access logical address, a validity bitmap in an FTL entry that identifies inconsistencies between data in a cache unit and data in an NVM data frame is updated.

[0018] According to the third or fourth method for a storage device of the first aspect of the present application, after the data is written into the cache unit, the completion of the write command processing is indicated to the device that issued the write command.

[0019] According to one of the first to fifth methods for a storage device of the first aspect of the present application, if the FTL cache entry does not record the obtained logical address, the FTL table is queried to obtain the NVM data frame address corresponding to the logical address, and the NVM data frame is accessed using the NVM data frame address.

[0020] According to a sixth method for a storage device according to the first aspect of the present application, if the access to the logical address is a read command, data indicated by the read command is read out from the NVM data frame address.

[0021] According to the second or seventh method for a storage device of the first aspect of the present application, if the FTL cache entry records a partial logical address obtained, the FTL table is queried to obtain the NVM data frame address corresponding to the logical address, and the NVM data frame address stored in the cache container is obtained based on the logical address recorded in the FTL cache entry and the logical address not recorded in the FTL cache entry, the NVM data frame address obtained by querying the FTL table and the NVM data frame address stored in the cache container are used to access the NVM data frame of the corresponding NVM chip, and read out the data indicated by the read command.

[0022] According to one of the sixth to eighth methods for a storage device of the first aspect of the present application, if the logical address is accessed by a write command, a new cache container is allocated for the logical address, and the data indicated by the write command is written into the cache unit of the newly allocated cache container.

[0023] According to one of the first to fifth methods for a storage device of the first aspect of the present application, if the FTL cache entry does not record the obtained logical address, a new cache container is allocated for the logical address, and the data indicated by the write command is written into the cache unit of the newly allocated cache container.

[0024] According to a tenth method for a storage device according to the first aspect of the present application, in response to writing data indicated by a write command into a cache unit of a newly allocated cache container, a validity bitmap in an FTL entry is updated.

[0025] According to the tenth or eleventh method for a storage device of the first aspect of the present application, an FTL cache entry is added in response to writing data into a cache unit of a newly allocated cache container, and an index of the newly allocated cache container is recorded in the added FTL cache entry.

[0026] According to one of the tenth to twelfth methods for a storage device according to the first aspect of the present application, after identifying the physical address indicating the NVM data frame address corresponding to the logical address, it is identified whether the data to be written by the write command occupies a complete cache unit.

[0027] According to the thirteenth method for a storage device of the first aspect of the present application, if it is identified that the data to be written by a write command does not occupy the entire first cache unit, data of a portion of the logical address space not occupied by the data to be written by the write command in a small block is read from the NVM chip according to the physical address of the logical address accessed by the same write command provided by the FTL, and filled into the first cache unit.

[0028] According to the fourteenth method for a storage device of the first aspect of the present application, a cache unit, a validity bitmap and an NVM data frame address are recorded in a cache container, and the NVM data frame address of the cache container is the NVM data frame address of the cache unit filled with the read data.

[0029] According to one of the first to fifteenth methods for a storage device of the first aspect of the present application, data stored in the cache unit is written into the NVM chip, and the cache container index recorded in the FTL entry is replaced with the NVM data frame address of the NVM chip.

[0030] According to one of the first to sixteenth methods for a storage device according to the first aspect of the present application, the FTL cache entry records the logical address and the cache container index in association with each other.

[0031] According to one of the first to seventeenth methods for a storage device according to the first aspect of the present application, the FTL cache entry corresponds to one of the FTL entries.

[0032] According to one of the first to eighteenth methods for a storage device according to the first aspect of the present application, the value of the FTL entry corresponding to the FTL cache entry records the cache container index.

[0033] According to one of the first to nineteenth methods for a storage device according to the first aspect of the present application, the values ​​of the FTL table are FTL entries indexed by the cache container, and each has a corresponding cache entry.

[0034] According to one of the first to twentieth methods for a storage device according to the first aspect of the present application, the FTL cache entry records the logical address and the NVM data frame address in association with each other.

[0035] According to a second aspect of the present application, a first storage device according to the second aspect of the present application is provided, wherein the first storage device includes: a control component, wherein the control component executes any of the above methods to complete FTL management. According to the first storage device according to the second aspect of the present application, wherein the control component FTL manages parts of the NVM chip and the DRAM or SRAM. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

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

[0038] Figure 2 is a schematic diagram of a storage space managed by an FTL according to an embodiment of the present application;

[0039] Figure 3 is a schematic diagram of a logical address (LBA) space of an embodiment of the present application;

[0040] Figure 4 The FTL table of the embodiment of the present application is shown;

[0041] Figure 5 A schematic diagram showing a cache provided by FTL in an embodiment of the present application is shown;

[0042] Fig. 6A A flowchart of writing data to a storage device according to an embodiment of the present application is shown;

[0043] Figure 6B A flowchart of writing data to a storage device according to another embodiment of the present application is shown;

[0044] Figure 6C A flowchart of reading data from a storage device according to another embodiment of the present application is shown;

[0045] Figure 7 A schematic diagram of an FTL entry cache according to an embodiment of the present application is shown;

[0046] Fig. 8A Demonstrated according to this application Figure 7 A flowchart of reading data from a storage device according to an embodiment of the present invention;

[0047] Figure 8B Demonstrated according to this application Figure 7A flowchart of writing data to a storage device according to an embodiment of the present invention;

[0048] Fig. 9 An FTL table according to another embodiment of the present application is shown;

[0049] Fig. 10A Demonstrated according to this application Fig. 9 A flowchart of an embodiment of writing data to a storage device;

[0050] Fig. 10B Demonstrated according to this application Fig. 9 Another flow chart of writing data to a storage device according to an embodiment of the present invention;

[0051] Fig. 10C Demonstrated according to this application Fig. 9 Another flow chart of writing data to a storage device according to an embodiment of the present invention;

[0052] Fig.11 A flow chart of writing data to a storage device according to still another embodiment of the present application is shown;

[0053] Fig. 12A A flowchart showing a method of reading data from a storage device according to yet another embodiment of the present application; and

[0054] Fig. 12B Another flow chart of reading data from a storage device according to still another embodiment of the present application is shown. DETAILED DESCRIPTION

[0055] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0056] Figure 2 It is a schematic diagram of the storage space managed by the FTL according to an embodiment of the present application.

[0057] According to an embodiment of the present application, the control unit 204 of the storage device 102 provides an FTL. The storage device provides a logical address (called LBA) space to the host. The host uses the logical address to access the storage device. The FTL maps the logical address provided by the host to a physical address.

[0058] According to an embodiment of the present application, the physical address obtained by FTL mapping is partially a physical address for accessing NVM chip 105, and partially a physical address for accessing DRAM 110. Figure 2, the NVM chip 105 and part of the DRAM 110 provide a storage space 200 managed by the FTL.

[0059] Optionally, in addition to DRAM 110, other types of memory such as SRAM are also used to provide storage space managed by the FTL.

[0060] It can be understood that the FTL according to another embodiment of the present application is provided by a host coupled to the storage device, or by a storage management apparatus arranged between the host and the storage device.

[0061] The FTL is implemented by, for example, software running in the CPU of the control component 204, firmware, and / or hardware as part of an ASIC.

[0062] Figure 3 FIG. 1 is a schematic diagram of a logical address (LBA) space of an embodiment of the present application. As an example, the logical address space is a continuous address space. The FTL maintains the logical address space.

[0063] Figure 3 The direction from top to bottom is the increasing direction of the logical address space. The logical address space includes multiple areas of the same size, each of which is called a small block. Each entry in the FTL table (called an FTL entry) records the mapping of a small block of the logical address space to a physical address. Figure 3 , multiple entries of the FTL table are shown, including FTL entry 0, FTL entry 1, ..., FTL entry 5. For example, the size of the logical address space corresponding to each FTL entry may be, for example, 512 bytes, 1KB, or 4KB. The FTL entry is indexed according to the address of the logical address space. For example, the address of the logical address space is divided by the size of the logical address space corresponding to the FTL entry, and the quotient obtained is the index of the FTL entry.

[0064] Figure 4 The FTL table of the embodiment of the present application is shown.

[0065] The FTL table includes a plurality of FTL entries, each of which corresponds to one of the small blocks, and the value of the FTL entry records the NVM data frame address or cache container index that provides storage space for the small block. Optionally, according to the value of the FTL entry, it is identified whether the value indicates the NVM data frame address or the cache container index. For example, the FTL entry value greater than the threshold is mapped to the NVM data frame address, and the FTL entry value not greater than the threshold is mapped to the cache container index. As another example, a flag is recorded in the FTL entry to indicate whether the value of the FTL entry indicates the NVM data frame address or the cache container index.

[0066] The FTL table is stored in, for example, DRAM 110 (see also Figure 2) or SRAM. The FTL calculates the index of the corresponding FTL entry according to the accessed logical address, and obtains the NVM data frame or cache container that provides storage space for the small block from the FTL entry.

[0067] The NVM data frame address is, for example, a physical address for accessing a physical page of an NVM chip, a physical address for accessing a plurality of combined physical pages of an NVM chip (a combined physical page is, for example, a physical page with the same physical page number on a plurality of planes of the same logical unit (LUN)), or a physical address for accessing a portion of a data unit within a physical page of an NVM chip. The cache container index is, for example, an address of a cache unit in a DRAM or an address of a descriptor of a cache unit. A cache unit is, for example, a section of storage space in a DRAM or SRAM. A cache unit descriptor is used to describe a cache unit. A cache container is used to record a cache unit descriptor.

[0068] Figure 5 The schematic diagram of the FTL providing cache according to the embodiment of the present application is shown. As an example, the FTL maps the logical address space to a portion of one or more NVM chips 105 (referred to as NVM chips 510) and a portion of the DRAM 110 (referred to as DRAM 520).

[0069] The storage space of NVM chip 510 includes multiple physical blocks. The storage space of NVM chip 510 is organized into NVM data frames (see block 512). Large block 512 includes multiple NVM data frames. The size of the NVM data frame is the same as the size of the small block, so that the data stored in the logical address space corresponding to a small block can be recorded in one NVM data frame.

[0070] Continue to view Figure 5 , the storage space of DRAM 520 is organized into cache units. A cache unit is, for example, a section of storage space of DRAM 520. The size of a cache unit is the same as the size of a small block, so that data stored in a logical address space corresponding to a small block can be recorded in one cache unit.

[0071] Return to view Figure 4 The index of the cache container recorded by the value of the FTL entry indicates the cache container. According to the cache container, the cache unit associated with the cache container can be accessed.

[0072] A cache container describes one or more cache units associated with it. A cache unit can be assigned to a cache container, or a cache unit has a specified association with a cache container. For example, a cache container records the cache unit descriptors of one or more cache units associated with the cache container, and the cache unit descriptors record the addresses of the cache units and the working status of the cache units.

[0073] Continue to view Figure 5 The values ​​of FTL entry 0, FTL entry 2, FTL entry 3 and FTL entry 4 indicate the NVM data frame address located in NVM chip 510, and the values ​​of FTL entry 1 and FTL entry 5 indicate the index of the cache container located in DRAM 520. Thus, FTL obtains the FTL entry according to the logical address, and provides the physical address of the storage space for the small block of the logical address space according to the value of the FTL entry.

[0074] Fig. 6A A flow chart of writing data to a storage device according to an embodiment of the present application is shown.

[0075] The storage device obtains a write command provided by the host, the write command indicating a logical address (610). The control component of the storage device queries the FTL table (612) according to the logical address to obtain a physical address corresponding to the logical address.

[0076] Optionally, the write command indicates multiple small blocks of the logical address space, and accordingly, the FTL table is queried according to the logical address of each small block to obtain the corresponding physical address. For the purpose of clarity, in one or more examples below, an embodiment according to the present application is described by taking a write command accessing a single small block as an example.

[0077] Identify whether the obtained physical address corresponding to the logical address indicates a cache container index (614). If the physical address provided by the FTL and the logical address accessed by the write command is a cache container index, then use the cache container index to access the cache unit of the corresponding cache container to carry the data to be written by the write command (616). Optionally, after the data to be written by the write command is written into the cache unit, indicate to the host that issued the write command that the write command has been processed.

[0078] If the physical address corresponding to the logical address accessed by the write command provided by the FTL is not a cache container index (614) (for example, it is an NVM data frame address, or other content), a new cache container is allocated for the logical address (618), and the data to be written by the write command is written into the cache unit of the newly allocated cache container (620). The index of the newly allocated cache container is also recorded in the FTL entry corresponding to the logical address (622).

[0079] According to an embodiment of the present application, optionally, when necessary or periodically, the data stored in the cache unit of the cache container indicated by one or more FTL entries is written to the NVM chip. In response to the data stored in the cache unit being written to the NVM chip, the cache container index in the FTL entry is replaced with the NVM data frame address of the NVM chip. Thus, until the cache container index recorded in the FTL table entry is modified to indicate the physical address of the data unit of the NVM chip, the FTL table entry always records the cache container index, which means that during this period, if a read command or write command accessing these FTL table entries is received, the unified cache will be hit, and the cache unit recorded with the cache container index will be used to respond to the read command or write command.

[0080] Figure 6B A flowchart of writing data to a storage device according to another embodiment of the present application is shown.

[0081] The storage device obtains a write command provided by the host, the write command indicating a logical address (630). The control component of the storage device queries the FTL table (632) according to the logical address to obtain a physical address corresponding to the logical address.

[0082] Identify whether the obtained physical address corresponding to the logical address indicates a cache container index (634). If the physical address of the logical address accessed by the write command provided by the FTL is a cache container index, further identify whether the cache unit of the cache container corresponding to the cache container index is being used (636). The cache unit is being used, for example, data is being written to the cache unit according to other write commands, data is being read from the cache unit, or the control component is writing data of the cache unit to the NVM chip. If the cache unit is not currently in use, use the cache unit to carry the data to be written by the write command (638). If the cache unit is currently in use, allocate a new cache unit for the cache container (640), and use the new cache unit to carry the data to be written by the write command (642).

[0083] If the physical address of the logical address accessed by the write command provided by the FTL is not a cache container index (634) (for example, it is an NVM data frame address, or other content), a new cache container is allocated for the logical address (644), and the data to be written by the write command is written into the cache unit of the newly allocated cache container (646). The index of the newly allocated cache container is also recorded in the FTL entry corresponding to the logical address (648).

[0084] Figure 6C A flow chart of reading data from a storage device according to another embodiment of the present application is shown.

[0085] The storage device obtains a read command provided by the host, the read command indicating a logical address (650). The control component of the storage device queries the FTL table (652) according to the logical address to obtain a physical address corresponding to the logical address.

[0086] Identify whether the obtained physical address corresponding to the logical address indicates a cache container index, an NVM data frame address, or another type of physical address (654). If the physical address provided by the FTL and the logical address accessed by the read command is a cache container index, then access the cache unit of the cache container and obtain data from the cache unit as a response to the read command (656). If the physical address provided by the FTL is an NVM data frame address, then send a read command to the NVM chip to read out the data (658). Optionally, other types of addresses are recorded in the FTL entry, such as indicating that the read logical address has not been written to data, indicating to the host that the read command processing error occurs, or using a specified value (e.g., all 0s) as a response to the read command.

[0087] Figure 7 A schematic diagram of an FTL entry cache according to an embodiment of the present application is shown.

[0088] according to Figure 7 In an embodiment, the FTL table includes a plurality of FTL entries. The number of FTL entries is large, for example, 100 million, so it takes a long time to access the FTL entries. An FTL entry cache is provided to speed up the query of the FTL table.

[0089] The FTL entry cache includes multiple entries (referred to as "cache entries"), each of which records a logical address (LBA) and a cache container index in association. The cache entry corresponds to one of the FTL entries. The value of the FTL entry corresponding to the cache entry records the cache container index. Each FTL entry whose value is a cache container index in the FTL table has a corresponding cache entry. For example, see Figure 7 , cache entry 710 records the logical address (LBA) and cache container index of FTL entry 1, cache entry 712 records the logical address (LBA) and cache container index of FTL entry 2, and cache entry 714 records the logical address (LBA) and cache container index of FTL entry 4. The value of the FTL table is an FTL entry with a non-cache container index, and there is no corresponding cache entry.

[0090] In response to allocating a cache container for a small block corresponding to the FTL entry, a cache entry is created, and the allocated cache container index is recorded in the created cache entry, and the allocated cache container index is also recorded in the FTL entry.

[0091] Optionally, since the cache entry records the cache container index, the NVM data frame address or other type of value is recorded in the FTL entry corresponding to the cache entry instead of recording the cache container index. In response to allocating a cache container for the small block corresponding to the FTL entry, a cache entry is created, and the allocated cache container index is recorded in the created cache entry instead of recording the allocated cache container index in the FTL entry.

[0092] Fig. 8A Demonstrated according to this application Figure 7 A flowchart of an embodiment of reading data from a storage device.

[0093] The storage device obtains a read command provided by the host, the read command indicating a logical address (810). The control component of the storage device queries the FTL entry cache according to the logical address (815) to try to obtain the physical address corresponding to the logical address as soon as possible.

[0094] If the logical address (or part thereof) indicated by the read command is recorded in the entry of the FTL entry cache (815), the logical address of the read command hits the FTL entry cache. The cache container index is obtained from the cache entry where the FTL entry is hit. The cache unit corresponding to the cache container is accessed, and data is read from the cache unit as a response to the read command (820).

[0095] If the logical address indicated by the read command is not recorded in the entry of the FTL entry cache, it means that the logical address of the read command does not hit the FTL entry cache (815). In this case, the FTL table (825) is further queried to obtain the physical address indicating the address of the NVM data frame recorded in the FTL entry corresponding to the logical address of the read command, and data is read from the NVM data frame according to the physical address to respond to the read hit (830).

[0096] Figure 8B Demonstrated according to this application Figure 7 A flowchart of writing data to a storage device according to an embodiment of the present invention.

[0097] The storage device obtains a write command provided by the host, the write command indicating a logical address (840). The control component of the storage device queries the FTL entry cache according to the logical address (845) to identify whether the logical address indicated by the write command hits the FTL entry cache.

[0098] If the logical address indicated by the write hit hits the FTL entry cache (845), the cache container index is obtained from the cache entry where the FTL entry is hit. The cache unit corresponding to the cache container is accessed, and the data corresponding to the write command is written to the cache unit (850). Optionally, in response to the data being written to the cache unit, the completion of the write command processing is indicated to the host.

[0099] If the logical address of the write command does not hit the FTL entry cache (845). In this case, a new cache container is allocated for the logical address (855), and the data to be written by the write command is written into the cache unit of the newly allocated cache container (860). And the FTL entry cache is updated (865), an entry is added to the FTL entry cache, and the association relationship between the logical address indicated by the write command and the index of the newly allocated cache container is recorded in the added entry. Optionally, the index of the newly allocated cache container is also recorded in the FTL entry corresponding to the logical address (870).

[0100] According to an embodiment of the present application, optionally, when necessary or periodically, the data stored in the cache unit of the cache container indicated by one or more FTL entries is written to the NVM chip. In response to the data of the cache unit being written to the NVM chip, the cache container index in the FTL entry is replaced with the NVM data frame address of the NVM chip, and the corresponding entry in the FTL entry cache is deleted.

[0101] Fig. 9 An FTL table according to yet another embodiment of the present application is shown.

[0102] The FTL table includes a plurality of FTL entries, each of which corresponds to one of the small blocks, and the FTL entry records an NVM data frame address or a cache container index that provides storage space for the small block.

[0103] Some FTL entries also record a validity bitmap.

[0104] The logical address space corresponding to the small block is further divided into multiple areas. Each bit of the validity bitmap of the FTL entry indicates whether the data stored in the cache unit of one of the areas of the small block is consistent with the data recorded in the NVM chip. For example, the size of the logical address space of the small block is 4KB, and the logical address space is divided into 8 areas, each of which has a size of 512 bytes. Still as an example, in response to writing data to a small block for the first time, the cache unit of the cache container accommodates the written data, which has not been written to the NVM chip, so the data of one or more areas of the logical address space corresponding to the cache unit is inconsistent with the data stored in the NVM chip, and in the validity bitmap, this inconsistency of one or more areas of the cache unit is marked. As another example, the data corresponding to the small block is read out from the NVM chip and stored in the cache unit. At this time, the data of one or more areas of the logical address space corresponding to the cache unit is consistent with the data stored in the NVM chip. Through one or more bits of the validity bitmap, it is marked that the data stored in one or more areas of the cache unit is consistent with the data stored in the NVM chip.

[0105] Optionally, the values ​​of some FTL entries record the NVM data frame addresses instead of the cache container indexes, and these FTL entries do not include a validity bitmap.

[0106] according to Fig. 9 Embodiment, using according to Figure 6C or Fig. 8A The same or similar process as the embodiment shown is to read data from the storage device.

[0107] Fig. 10A Demonstrated according to this application Fig. 9 A flowchart of an embodiment of writing data to a storage device.

[0108] The storage device obtains a write command provided by the host, the write command indicating a logical address (1010). The control component of the storage device queries the FTL table (1012) according to the logical address to obtain a physical address corresponding to the logical address.

[0109] Identify whether the obtained physical address corresponding to the logical address indicates a cache container index (1014). If the physical address provided by the FTL and the logical address accessed by the write command is a cache container index (1014), access the cache unit corresponding to the cache container index, and use the cache unit to carry the data to be written by the write command (1016).

[0110] Furthermore, since the data to be written by the write command is only written into the cache unit but not into the NVM data frame, the data in the cache unit is inconsistent with the data in the NVM data frame. According to the write command accessing one or more regions of the small block, the validity bitmap in the FTL entry is updated (1018).

[0111] If the physical address provided by the FTL and corresponding to the logical address accessed by the write command is not a cache container index (for example, an NVM data frame address, or other content) (1014), a new cache container is allocated for the logical address (1020), and the data to be written by the write command is written into the cache unit of the newly allocated cache container (1022). According to the one or more regions of the small block accessed by the write command, the validity bitmap in the FTL entry is updated (1024).

[0112] Furthermore, in response to the physical address corresponding to the logical address accessed by the write command not being a cache container index, it is also identified whether the data to be written by the write command occupies a complete cache unit (or small block) (1026). For example, if the size of the logical address space corresponding to the small block is 4KB, and the write command writes 4KB of data to the logical address space, the data to be written by the write command occupies a complete cache unit; if the write command writes, for example, 2KB of data to the logical address space, the data to be written by the write command does not occupy a complete cache unit.

[0113] If the data to be written by the write command does not occupy a complete cache unit (1026), data of a portion of the logical address space in the small block not occupied by the data to be written by the write command is also read from the NVM chip according to the physical address of the logical address accessed by the write command provided by the FTL (for example, the NVM data frame address), and filled into the cache unit (1028) to which the write command writes data, so that the cache unit is filled with data corresponding to the complete logical address space of the small block (part of which comes from the write command and part of which comes from the NVM data frame).

[0114] At this time, the cache unit of the cache container has accommodated the data corresponding to the complete logical address space of the small block, and the cache unit can be used to respond to the access to the small block without retaining the NVM data frame address of the data just read in the FTL entry. Therefore, the index of the newly allocated cache container is also recorded in the FTL entry corresponding to the logical address of the write command (1030).

[0115] If the data to be written by the write command occupies the entire cache unit (1026), go to step 1024 to update the validity bitmap in the FTL entry.

[0116] Fig. 10B Demonstrated according to this application Fig. 9 Another flowchart of an embodiment of writing data to a storage device.

[0117] The storage device obtains a write command provided by the host, and the write command indicates a logical address (1040). The control component of the storage device queries the FTL table (1042) according to the logical address to obtain a physical address corresponding to the logical address.

[0118] Identify whether the obtained physical address corresponding to the logical address indicates a cache container index (1044). If the physical address of the logical address accessed by the write command provided by the FTL is a cache container index (1044), further identify whether the cache unit of the cache container corresponding to the cache container index is being used (1046). If the cache unit is not currently in use, use the cache unit to carry the data to be written by the write command (1048). If the cache unit is currently in use, allocate a new cache unit for the cache container (1050), and use the new cache unit to carry the data to be written by the write command (1052).

[0119] And based on the write command accessing one or more regions of the small block, updating the validity bitmap in the FTL entry (1054).

[0120] If the physical address of the logical address accessed by the write command provided by the FTL is not a cache container index (for example, an NVM data frame address, or other content) (1044), a new cache container is allocated for the logical address (1056), and the data to be written by the write command is written into the cache unit of the newly allocated cache container (1058).

[0121] Furthermore, it is also identified whether the data to be written by the write command occupies a complete cache unit (or small block) (1060). If the data to be written by the write command does not occupy a complete cache unit (1060), the data of the portion of the logical address space not occupied by the data to be written by the write command in the small block is read from the NVM chip according to the physical address of the logical address accessed by the write command provided by the FTL (for example, the NVM data frame address), and filled into the cache unit to which the write command writes data (1062), so that the cache unit is filled with data corresponding to the complete logical address space of the small block (partly from the write command and partly from the NVM data frame). If the data to be written by the write command occupies a complete cache unit (1060), directly go to step 1064.

[0122] According to the write command accessing one or more regions of the small block, the validity bitmap in the FTL entry is updated (1064). The index of the newly allocated cache container is also recorded in the FTL entry corresponding to the logical address of the write command (1066).

[0123] Optionally, the step of identifying whether the data to be written by the write command occupies a complete cache unit (or small block) is performed earlier. For example, after identifying that the physical address of the logical address accessed by the write command provided by the FTL is the NVM data frame address, the step of identifying whether the data to be written by the write command occupies a complete cache unit (or small block) is performed, and the step of reading the data of the part of the logical address space not occupied by the data to be written by the write command in the small block from the NVM chip is performed, and filling the data into the cache unit to which the write command writes data.

[0124] according to Fig. 9 Shows an FTL table and, optionally, also provides an FTL entry cache for it.

[0125] The FTL entry cache includes multiple entries (referred to as "cache entries"), each of which records the logical address (LBA), cache container index, and validity bitmap in association. The cache entry corresponds to one of the FTL entries. Each value of the FTL table is an FTL entry indexed by a cache container, and there is a corresponding cache entry. However, the value of the FTL table is an FTL entry indexed by a non-cache container, and there is no corresponding cache entry.

[0126] Fig. 10C Demonstrated according to this application Fig. 9Still another flow chart of writing data to a storage device according to an embodiment of the present invention.

[0127] The storage device obtains a write command provided by the host, the write command indicating a logical address (1070). The control component of the storage device queries the FTL entry cache according to the logical address (1072) to identify whether the logical address indicated by the write command hits the FTL entry cache.

[0128] If the logical address indicated by the write hit hits the FTL entry cache (1072), the cache container index is obtained from the cache entry where the FTL entry is hit. The cache unit corresponding to the cache container is accessed, and the data corresponding to the write command is written to the cache unit (1074). And according to the write command, one or more regions of the small block are accessed, and the validity bitmap in the FTL entry is updated (1076).

[0129] If the logical address of the write command does not hit the FTL entry cache (1072), in this case, a new cache container is allocated for the logical address (1078), and the data to be written by the write command is written into the cache unit of the newly allocated cache container (1080).

[0130] After identifying that the physical address of the logical address accessed by the write command provided by the FTL is the NVM data frame address, in addition to allocating a new cache container, it is also identified whether the data to be written by the write command occupies a complete cache unit (or small block) (1082). If the data to be written by the write command does not occupy a complete cache unit (1082), the FTL table (1084) is also queried according to the logical address of the write command, and the data of the part of the logical address space not occupied by the data to be written by the write command in the small block is read from the NVM chip according to the physical address of the logical address accessed by the write command provided by the FTL (for example, the NVM data frame address), and filled into the cache unit to which the write command writes data (1086), so that the cache unit is filled with data corresponding to the complete logical address space of the small block (part from the write command, and part from the NVM data frame). If the data to be written by the write command occupies a complete cache unit (1082), go directly to step 1088.

[0131] And according to the write command accessing one or more regions of the small block, updating the validity bitmap in the FTL entry (1088). Updating the FTL entry cache (1090), adding a cache entry in the FTL entry cache to record the association relationship between the logical address indicated by the write command and the index of the newly allocated cache container. Optionally, the index of the newly allocated cache container is also recorded in the FTL entry corresponding to the logical address of the write command (1092).

[0132] According to still another embodiment of the present application, in addition to recording the cache units it owns, the cache container also records the validity bitmap and the NVM data frame address. The NVM data frame address of the cache container is the address of the NVM data frame from which data is read to fill the cache unit. Since the NVM data frame address is recorded in the cache container, when writing data from a write command to the cache container, even if the data to be written by the write command does not occupy a complete cache unit, it is not necessary to immediately read data from the NVM data frame to fill the cache unit.

[0133] Fig.11 A flow chart of writing data to a storage device according to yet another embodiment of the present application is shown.

[0134] The storage device obtains a write command provided by the host, the write command indicating a logical address (1110). The control component of the storage device queries the FTL table (1120) according to the logical address to obtain a physical address corresponding to the logical address.

[0135] Identify whether the obtained physical address corresponding to the logical address indicates a cache container index (1130). If the physical address corresponding to the logical address accessed by the write command provided by the FTL is a cache container index (1130), access the cache unit corresponding to the cache container index, and use the cache unit to carry the data to be written by the write command (1140). And, according to the one or more regions of the small block accessed by the write command, update the validity bitmap in the FTL entry (1150).

[0136] If the physical address corresponding to the logical address accessed by the write command provided by the FTL is not a cache container index (for example, an NVM data frame address, or other content) (1130), a new cache container is allocated for the logical address, and the data to be written by the write command is written into the cache unit of the newly allocated cache container (1160). And the NVM data frame address corresponding to the logical address obtained from the FTL table is recorded in the newly allocated cache container (1170). According to the one or more regions of the small block accessed by the write command, the validity bitmap in the FTL entry is updated (1180). The index of the newly allocated cache container is also recorded in the FTL entry corresponding to the logical address of the write command (1190).

[0137] Optionally, the step of updating the validity bitmap in the FTL entry according to one or more areas of the small block accessed by the write command can be implemented after obtaining the logical address indicated by the write command, and does not depend on whether the physical address corresponding to the logical address indicated by the write command indicates a cache container index.

[0138] Fig. 12A A flow chart of reading data from a storage device according to yet another embodiment of the present application is shown.

[0139] The storage device obtains a read command provided by the host, the read command indicating a logical address (1210). The control component of the storage device queries the FTL table (1215) according to the logical address to obtain a physical address corresponding to the logical address.

[0140] Identify whether the obtained physical address corresponding to the logical address indicates a cache container index, an NVM data frame address, or another type of physical address (1220). If the physical address corresponding to the logical address accessed by the read command provided by the FTL is a cache container index (1220), further identify whether the cache container can provide the complete data to be read by the read command (1225). For example, if the size of the logical address space corresponding to the data written to the cache container is 4KB, and the read command reads 4KB of data from the logical address space, the cache container can provide the complete data to be read by the read command; if the read command reads, for example, 2KB of data from the logical address space, and the size of the logical address space corresponding to the data written to the cache container is 1KB, the cache container cannot provide the complete data to be read by the read command.

[0141] If the cache container cannot provide the complete data to be read by the read command (1225), the NVM data frame address (1230) corresponding to the logical address accessed by the read command obtained from the cache container is also read from the NVM chip to respond to the read command (1235). And optionally, for the partial data that the cache container can provide, the data is obtained from the cache container to respond to the read command.

[0142] If the cache container can provide the complete data to be read by the read command (1225), the data is obtained from the cache container to respond to the read command (1240).

[0143] If the physical address corresponding to the logical address accessed by the read command provided by the FTL is the NVM data frame address (1220), a read command is sent to the NVM chip to read out the data (1245).

[0144] Fig. 12B Another flow chart of reading data from a storage device according to still another embodiment of the present application is shown.

[0145] The storage device obtains a read command provided by the host, the read command indicating a logical address (1240). The control component of the storage device queries the FTL entry cache according to the logical address (1245) to try to obtain the physical address corresponding to the logical address as soon as possible.

[0146] If the logical address indicated by the read hit hits the FTL entry cache (1245), the cache container index is obtained from the cache entry hit in the FTL entry cache. It is also identified whether the cache container can provide the complete data to be read by the read command. If the cache container can provide the complete data to be read by the read command (for example, through the validity bitmap recorded in the cache entry) (complete hit), the cache unit corresponding to the cache container is accessed, and the data is read out from the cache unit as a response to the read command (1250).

[0147] If the cache container cannot provide the complete data to be read by the read command (not a complete hit), the part of the logical address space (small block) that the cache container can provide for the read command and the part of the logical address space that the cache container cannot provide for the read command are identified according to the validity bitmap recorded in the cache entry (1255). The partial data of the logical address space that the cache container can provide for the read command is obtained from the cache unit of the cache container (1250). And the FTL table is queried (1265) to obtain the physical address of the NVM data frame corresponding to the logical address of the read command, and the data of the part of the logical address space that the cache container cannot provide for the read command is read from the NVM data frame according to the physical address (1270).

[0148] Optionally, for the portion of the logical address space that the cache container cannot provide for the read command, the FTL table is not queried, but the physical address indicating the NVM data frame corresponding to the logical address of the read command is obtained from the cache container (1260), and data of the portion of the logical address space that the cache container cannot provide for the read command is read from the NVM data frame according to the physical address (1270).

[0149] If the FTL entry cache does not have a cache entry that does not record the logical address indicated by the read command, it means that the logical address of the read command does not hit the FTL entry cache (1245). In this case, the FTL table is further queried to obtain the physical address indicating the NVM data frame address recorded in the FTL entry corresponding to the logical address of the read command, and data is read from the NVM data frame according to the physical address to respond to the read hit.

[0150] According to an embodiment of the present application, a storage device is also provided, including a control component and a non-volatile memory chip, wherein the controller executes any one of the processing methods provided in the embodiment of the present application.

[0151] According to an embodiment of the present application, there is also provided a program stored on a readable medium, which, when executed by a controller of a storage device, enables the storage device to execute any one of the processing methods provided according to the embodiment of the present application.

[0152] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application. Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for storing a device, characterized in that: include: Obtaining a logical address for accessing a storage device; Query the FTL cache entry. The FTL entry cache includes multiple cache entries. Each cache entry records the logical address and the cache container index in association. The FTL table includes multiple FTL entries. The value of the FTL entry records the NVM data frame address or the cache container index. Each value of the FTL table is an FTL entry with a cache container index, and has a corresponding cache entry. The value of the FTL table is an FTL entry with a non-cache container index, and has no corresponding cache entry. If the FTL cache entry records the obtained logical address, the cache unit of the corresponding cache container is accessed using the cache container index corresponding to the logical address obtained from the FTL cache entry; If the FTL cache entry does not record the obtained logical address, the FTL table is queried to obtain the NVM data frame address corresponding to the logical address, and the NVM data frame is accessed using the NVM data frame address.

2. The method for storing a device according to claim 1, wherein: The data indicated by the read command is read from the cache unit.

3. The method for storing a device according to claim 1 or 2, characterized in that: The data indicated by the write command is written into the cache unit according to the write command.

4. The method for storing a device according to claim 1, wherein: In response to data indicated by a write command that writes the access logic address, a validity bitmap in the FTL entry that identifies inconsistency between data in the cache unit and data in the NVM data frame is updated.

5. The method for storing a device according to claim 4, wherein: After the data is written to the cache unit, the completion of the write command processing is indicated to the device that issued the write command.

6. The method for storing a device according to claim 1 or 2, characterized in that: If the command accessing the logical address is a read command, the data indicated by the read command is read out from the NVM data frame address.

7. The method for storing a device according to claim 6, wherein: If the FTL cache entry records a partial logical address obtained, the FTL table is queried to obtain the NVM data frame address corresponding to the logical address, and the NVM data frame address stored in the cache container is obtained according to the logical address recorded in the FTL cache entry and the logical address not recorded in the FTL cache entry, and the NVM data frame address obtained by querying the FTL table and the NVM data frame address stored in the cache container are used to access the NVM data frame of the corresponding NVM chip, and read out the data indicated by the read command.

8. The method for storing a device according to claim 1 or 2, characterized in that: If the access to the logical address is a write command, a new cache container is allocated for the logical address, and the data indicated by the write command is written into the cache unit of the newly allocated cache container.

9. The method for storing a device according to claim 1 or 2, characterized in that: If the FTL cache entry does not record the obtained logical address, a new cache container is allocated for the logical address, and the data indicated by the write command is written into the cache unit of the newly allocated cache container.

10. The method for storing a device according to claim 9, wherein: In response, the data indicated by the write command is written into the cache unit of the newly allocated cache container, and the validity bitmap in the FTL entry is updated.

11. The method for storing a device according to claim 9, wherein: In response to writing the data into the cache unit of the newly allocated cache container, an FTL cache entry is added, and the index of the newly allocated cache container is recorded in the added FTL cache entry.

12. The method for storing a device according to claim 9, wherein: After the physical address indicating the NVM data frame address corresponding to the logical address is identified, it is identified whether the data to be written by the write command occupies a complete cache unit.

13. The method for storing a device according to claim 12, wherein: If it is identified that the data to be written by the write command does not occupy the entire first cache unit, data of a portion of the logical address space not occupied by the data to be written by the write command in the small block is read from the NVM chip according to the physical address of the logical address accessed by the write command provided by the FTL, and filled into the first cache unit to which the write command writes data.

14. The method for storing a device according to claim 13, wherein: The cache container records the cache unit, the validity bitmap and the NVM data frame address. The NVM data frame address of the cache container is the NVM data frame address of the cache unit filled with the read data.

15. The method for storing a device according to claim 1 or 2, characterized in that: The data stored in the cache unit is written into the NVM chip, and the cache container index recorded in the FTL entry is replaced with the NVM data frame address of the NVM chip.

16. The method for storing a device according to claim 1 or 2, characterized in that: The FTL cache entry records the logical address and the cache container index in association.

17. The method for storing a device according to claim 1 or 2, characterized in that: An FTL entry cache entry corresponds to one of the FTL entries.

18. The method for storing a device according to claim 1 or 2, characterized in that: The value of the FTL entry corresponding to the FTL entry cache entry records the cache container index.

19. The method for storing a device according to claim 1 or 2, characterized in that: The value of the FTL table is the FTL entry indexed by the cache container, and each has a corresponding cache entry.

20. The method for storing a device according to claim 1 or 2, characterized in that: The FTL cache entry records the logical address and the NVM data frame address in association.

21. A storage device, characterized in that: include: A control component, wherein the control component executes the method described in any one of claims 1-20 to complete FTL management.

Citation Information

Cited By

  • Message and event-based multi-task processing unit scheduling method and device

    CN111767120A

  • Scheduling Method and Device for a Multi-Task Processing Unit Based on Messages and Events

    CN111767120B

  • Lock-free access to FTL table of storage device

    CN113051187A

  • Lock-free access to ftl table of storage device

    CN113051187B

  • Enhancing parallelism of access to FTL tables by storage devices using address barriers

    CN113051190A