Method and device for low-latency access to FTL
Optimizing the access method of FTL table entries through the FTL acceleration circuit solves the problem of FTL access delay in the storage device controller, improves processing performance, and achieves more efficient storage device operation.
Patent Information
- Application Number
- CN202010915810.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2016-05-24
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2036-05-24
AI Technical Summary
In the prior art, when the storage device controller accesses the Flash Translation Layer (FTL), the processing performance is affected due to the access delay of the DRAM and the need for high-speed processing of the CPU. Due to the randomness of the FTL table and the large-capacity access requirements, the traditional The cache scheme cannot significantly improve access capabilities.
Using FTL acceleration circuit, the FTL table entry address and data are stored separately through the FTL table entry address and data storage components. The CPU interface and main memory interface are used to realize asynchronous and synchronous preloading, reading, updating and flushing operations, and optimize The access method of FTL table entries reduces direct access delay to main memory.
It effectively reduces FTL access latency, improves the processing performance of storage devices, and improves the performance of flash controllers, especially when large-capacity data access and frequent mapping relationship updates.
Smart Images

Figure CN112035382B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a storage device controller, in particular to a method and a device for accessing FTL (Flash Translation Layer) in a storage device controller. Background Art
[0002] 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.
[0003] 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. The FTL table of a solid-state storage device has a large size, such as several GB.
[0004] The FTL table includes multiple FTL table entries (or table items). An example of the FTL table structure is provided in the Chinese patent application with application number 201510430174.6. In one example, 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 a logical block address and a physical block address. In still another example, 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 is recorded in the FTL table. The FTL table entry can also record the mapping relationship between the logical address and one or more physical addresses.
[0005] In yet another example, the FTL table is stored in a continuous memory address space, each FTL table entry records a physical address, and the memory address of each FTL table entry itself represents a logical address corresponding to the physical address. The number of FTL table entries corresponds to the size of the solid-state storage device logical address space.
[0006] The flash memory controller needs to frequently access the FTL when it is working. When reading the flash memory, the FTL is queried through the logical address to obtain the physical address of the flash memory where the data is stored. When writing to the flash memory, a physical address is assigned to the written data, and the correspondence between the written logical address and the physical address is recorded in the FTL. When operations such as GC and erase leveling occur, the mapping relationship between the logical address and the physical address changes, and the FTL needs to be updated.
[0007] There are already many technical solutions for accessing FTL.
[0008] The characteristics of FTL include a large number of entries (common SSDs need to manage hundreds of millions of FTL entries), a small size of each entry (about a few to a dozen bytes), and strong randomness (access to FTL entries is distributed throughout the entry space and lacks locality). In addition, since it needs to support large-capacity FLASH, it is often necessary to access more than 4GB of space.
[0009] DRAM is generally used to store GB-level data. However, the access latency of DRAM cannot match the high-speed processing components such as CPU, and seriously affects the processing performance of flash controller. Traditionally, cache is used as the storage middle layer to provide high-speed data access capability for CPU by caching part of the data in DRAM.
[0010] However, due to the randomness of FTL table access, even if Cache is used to cache the FTL table, frequent paging will cause Cache thrashing and the FTL access capability cannot be significantly improved.
[0011] For example, when accessing FTL table entry A, the address of table entry A stored in DRAM is read first. Due to the randomness of FTL table entry access, it is unlikely that table entry A already exists in the cache, so it can be considered that the cache is always missing and table entry A needs to be read from the external DRAM memory to the cache. At this time, the delay penalty is approximately more than 100ns.
[0012] Due to the storage of FTL tables, the DRAM memory size in the system often exceeds 4GB. The commonly used 32-bit address access method cannot access address space exceeding 4GB, so TLB is required. The high-order address is obtained by accessing the TLB, and the address is combined to generate access to DRAM. The TLB access and address combination process further increases the access latency.
[0013] You can also use DMA to access FTL. When accessing FTL, you need to configure the high and low bits of the address, and then trigger DMA to move the FTL to a space that the CPU can directly access (or can access with low latency), such as low 4G DDR or the system's SRAM. However, the disadvantages of this solution are also obvious: the process of configuring DMA takes time, and the CPU access latency will also be relatively large. And because of the involvement of DMA, storage consistency issues also need to be considered.
[0014] Moreover, when the size of the FTL entry changes, the access latency of the FTL will be further increased. Summary of the invention
[0015] According to a first aspect of the present invention, a first device for accessing FTL according to the first aspect of the present invention is provided, comprising an FTL table entry address storage component, an FTL table entry data storage component, a CPU interface and a main memory interface, wherein the FTL table entry address storage component stores a plurality of FTL table entry addresses; the FTL table entry data storage component stores a plurality of FTL table entry data; wherein the FTL table entry address and the FTL table entry data associated therewith are accessed respectively in the FTL table entry address storage component and the FTL table entry data storage component by the same index, the FTL table entry address is the storage address of the FTL table entry data associated therewith in the main memory; in response to the CPU interface receiving a preload request for the FTL table entry of a specified address, the FTL table entry is obtained from the main memory through the main memory interface, the preload request also specifies a first index, the first index indicates the storage location of the FTL table entry of the specified address in the FTL table entry data storage component; in response to the CPU interface receiving a read request for the FTL table entry of the first index, the FTL table entry is provided to the CPU through the CPU interface.
[0016] According to the first device for accessing FTL according to the first aspect of the present invention, a second device for accessing FTL according to the first aspect of the present invention is provided, wherein after receiving a preload request for an FTL table entry of a specified address, the device for accessing FTL processes the load request in an asynchronous manner; and after receiving a read request for an FTL table entry of a first index, the device for accessing FTL processes the read request in a synchronous manner.
[0017] According to the first or second device for accessing FTL according to the first aspect of the present invention, a third device for accessing FTL according to the first aspect of the present invention is provided, wherein after receiving a read request for an FTL table entry of a first index, if the FTL table entry of the specified address does not exist in the FTL table entry data storage component, it also waits to load the FTL table entry of the specified address from the main memory into the FTL table entry data storage component.
[0018] According to one of the first to third devices for accessing FTL according to the first aspect of the present invention, a fourth device for accessing FTL according to the first aspect of the present invention is provided, wherein obtaining FTL table entries from the main memory through the main memory interface also includes: locking the FTL table entry at the specified address of the main memory.
[0019] According to a second aspect of the present invention, a first device for accessing FTL according to the second aspect of the present invention is provided, comprising an FTL table item address storage component, an FTL table item data storage component, a CPU interface and a main memory interface, wherein the FTL table item address storage component stores a plurality of FTL table item addresses; the FTL table item data storage component stores a plurality of FTL table item data; wherein the FTL table item address and the FTL table item data associated therewith are accessed respectively in the FTL table item address storage component and the FTL table item data storage component by the same index, and the FTL table item address is the storage address of the FTL table item data associated therewith in the main memory; in response to the CPU interface receiving an update request for the FTL table item of the first index, the FTL table item data indicated by the first index in the FTL table item data storage component is updated; in response to the CPU interface receiving a refresh request for the FTL table item of the first index, the FTL table item data specified by the first index is written into the main memory through the main memory interface according to the FTL table item address specified by the first index.
[0020] According to the first device for accessing FTL according to the second aspect of the present invention, a second device for accessing FTL according to the second aspect of the present invention is provided, wherein after receiving an FTL table entry update request, the device for accessing FTL processes the FTL table entry update request in a synchronous manner; after receiving an FTL table entry write request, the device for accessing FTL processes the FTL table entry write request in an asynchronous manner.
[0021] According to the first or second device for accessing FTL according to the second aspect of the present invention, a third device for accessing FTL according to the second aspect of the present invention is provided, wherein in response to the CPU interface receiving an FTL table entry update request, the FTL table entry address stored in the FTL table entry address storage component is also updated.
[0022] According to one of the first to third devices for accessing FTL according to the second aspect of the present invention, a fourth device for accessing FTL according to the second aspect of the present invention is provided, wherein in response to receiving an FTL table entry update request, after the FTL table entry data stored in the FTL table entry data storage component is updated, the completion of the FTL table entry update request processing is indicated through the CPU interface; and the updated FTL table entry data is written into the main memory through the main memory interface.
[0023] According to one of the first to fourth devices for accessing FTL according to the second aspect of the present invention, a fifth device for accessing FTL according to the second aspect of the present invention is provided, wherein in response to receiving an FTL table entry flush request, it is also detected whether the specified FTL table entry has been written to the main memory, and after the specified FTL table entry is written to the main memory, the completion of the processing of the FTL table entry flush request is indicated through the CPU interface.
[0024] According to one of the first to fifth devices for accessing FTL according to the second aspect of the present invention, a sixth device for accessing FTL according to the second aspect of the present invention is provided, wherein after receiving an FTL table entry write request and before writing the specified FTL table entry into the main memory, the CPU interface indicates that the processing of the FTL table entry write request is completed.
[0025] According to one of the first to sixth devices for accessing FTL according to the second aspect of the present invention, a seventh device for accessing FTL according to the second aspect of the present invention is provided, wherein writing the specified FTL table entry data into the main memory through the main memory interface according to the specified FTL table entry address also includes: unlocking the FTL table entry at the specified address of the main memory.
[0026] According to one of the first to seventh devices for accessing FTL according to the second aspect of the present invention, an eighth device for accessing FTL according to the second aspect of the present invention is provided, wherein in response to the CPU interface receiving a preload request for an FTL table entry of a specified address, the FTL table entry is obtained from the main memory through the main memory interface, and the preload request also specifies a first index, and the first index indicates a storage location of the FTL table entry of the specified address in the FTL table entry data storage component; in response to the CPU interface receiving a read request for the FTL table entry of the first index, the FTL table entry is provided to the CPU through the CPU interface.
[0027] According to a third aspect of the present invention, a first method for accessing FTL according to the third aspect of the present invention is provided, comprising: issuing a preload request for an FTL table entry of a specified address to load the specified FTL table entry into a storage location indicated by a first index of an FTL table entry storage component; and issuing a read request for the FTL table entry of the first index to obtain the FTL table entry of the first index from the FTL table entry storage component.
[0028] According to the first method for accessing FTL according to the third aspect of the present invention, a second method for accessing FTL according to the third aspect of the present invention is provided, wherein the operation of issuing a preload request for the FTL table entry of the specified address is performed asynchronously; and the operation of issuing a read request for the FTL table entry of the first index is performed synchronously.
[0029] According to the first or second method for accessing FTL of the third aspect of the present invention, a third method for accessing FTL according to the third aspect of the present invention is provided, which also includes: issuing an update request for the FTL table entry of the first index to update the FTL table entry indicated by the first index in the FTL table entry storage component; and issuing a flush request for the FTL table entry of the first index to write the FTL table entry indicated by the first index in the FTL table entry storage component into the main memory.
[0030] According to one of the first to third methods of accessing FTL according to the third aspect of the present invention, a fourth method of accessing FTL according to the third aspect of the present invention is provided, wherein: the operation of issuing an update request for the FTL table entry of the first index is performed synchronously; and the operation of issuing a flush request for the FTL table entry of the specified address is performed asynchronously.
[0031] According to one of the first to fourth methods of accessing FTL according to the third aspect of the present invention, a fifth method of accessing FTL according to the third aspect of the present invention is provided, wherein: the operation of issuing a flush request for the FTL table entry of the first index is performed in a synchronous manner.
[0032] According to one of the first to fifth methods of accessing FTL according to the third aspect of the present invention, a sixth method of accessing FTL according to the third aspect of the present invention is provided, wherein the preloading request for the FTL table entry at the specified address also indicates locking the FTL table entry at the specified address.
[0033] According to one of the first to sixth methods of accessing FTL according to the third aspect of the present invention, a seventh method of accessing FTL according to the third aspect of the present invention is provided, wherein: the write request for the FTL table entry of the first index also indicates unlocking the FTL table entry at the FTL table entry address indicated by the first index in the main memory.
[0034] According to one of the first to seventh methods of accessing FTL according to the third aspect of the present invention, an eighth method of accessing FTL according to the third aspect of the present invention is provided, wherein: after issuing a preload request for the FTL table entry of a specified address, before issuing a read request for the FTL table entry of the first index, operations unrelated to accessing the FTL table entry of the specified address are also performed.
[0035] According to one of the first to eighth methods of accessing FTL according to the third aspect of the present invention, a ninth method of accessing FTL according to the third aspect of the present invention is provided, wherein: after issuing an update request for the FTL table entry of the first index and before issuing a flush request for the FTL table entry of the first index, operations unrelated to accessing the FTL table entry of the first index are also performed.
[0036] According to one of the first to ninth methods of accessing FTL according to the third aspect of the present invention, there is provided a tenth method of accessing FTL according to the third aspect of the present invention, wherein the operations unrelated to accessing the FTL table entry of the first index include operations of accessing a second FTL table entry.
[0037] According to one of the first to tenth methods of accessing an FTL according to the third aspect of the present invention, there is provided an eleventh method of accessing an FTL according to the third aspect of the present invention, further comprising: allocating an entry of an FTL table entry storage component having a first index.
[0038] According to one of the first to eleventh methods for accessing FTL according to the third aspect of the present invention, a twelfth method for accessing FTL according to the third aspect of the present invention is provided, which also includes: issuing a flush request to the FTL table entry storage unit to write all updated FTL table entries in the FTL table entry storage unit into the main memory.
[0039] According to one of the first to twelfth methods for accessing FTL according to the third aspect of the present invention, a thirteenth method for accessing FTL according to the third aspect of the present invention is provided, which also includes writing the updated FTL table entry in the FTL storage component into the main memory after issuing an update request for the FTL table entry of the first index.
[0040] According to a fourth aspect of the present invention, there is provided a computer program comprising computer program code, which, when loaded into and executed on a computer system, causes the computer system to perform the FTL access method provided according to the third aspect of the present invention.
[0041] According to a fifth aspect of the present invention, there is provided a program comprising program code, which, when loaded into a storage device and executed on the storage device, causes the storage device to execute the FTL access method provided according to the third aspect of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] 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:
[0043] Figure 1 is a block diagram of a circuit system according to an embodiment of the present invention;
[0044] Figure 2 is a block diagram of an FTL acceleration circuit according to an embodiment of the present invention;
[0045] Figure 3 is a flowchart of a FTL table entry reading process according to an embodiment of the present invention;
[0046] Figure 4A is a flowchart of an FTL table entry update process according to an embodiment of the present invention; and
[0047] Figure 4B is a flowchart of an FTL table entry updating process according to another embodiment of the present invention. DETAILED DESCRIPTION
[0048] Circuit system
[0049] Figure 11 is a block diagram of a circuit system according to an embodiment of the present invention. A CPU is coupled with a main memory such as a DRAM to form a circuit system. An FTL acceleration circuit is provided between the CPU and the main memory. The FTL acceleration circuit is coupled to the CPU. The CPU accesses the FTL acceleration circuit through a high-speed local interface. For example, the CPU accesses the FTL acceleration circuit in a register access mode. When the CPU accesses the FTL acceleration circuit, the FTL acceleration circuit provides a result to the CPU within one instruction execution cycle.
[0050] The FTL acceleration circuit is coupled to a main memory (e.g., DRAM) via a bus. The main memory stores the FTL table. The storage space of the main memory may be several GB, and the storage space occupied by the FTL table may be several GB. The FTL acceleration circuit may access the FTL table stored in the main memory using the existing technology.
[0051] The CPU accesses the FTL table stored in the main memory through the FTL acceleration circuit. Optionally, the CPU can also directly access the main memory without using the FTL acceleration circuit. Optionally, the CPU accesses the FTL table stored in the main memory through the FTL acceleration circuit, and the CPU directly accesses the main memory to obtain other contents outside the FTL table stored in the main memory.
[0052] Figure 2 1 is a block diagram of an FTL acceleration circuit according to an embodiment of the present invention. The FTL acceleration circuit includes an FTL table entry storage unit. The FTL table entry storage unit includes an FTL table entry address storage unit and an FTL table entry data storage unit, which are respectively used to store the address of the FTL table entry (for example, the storage address of the FTL table entry in the main memory) and the data of the FTL table entry corresponding to the address.
[0053] In the FTL acceleration circuit, multiple pairs of FTL table entries may be stored. The FTL table entry may be, for example, {FTL table entry address, FTL table entry data}. Furthermore, through the index, the CPU may explicitly access the FTL table entry address storage component and / or the FTL table entry data storage component of the FTL acceleration circuit.
[0054] In another example, the length of the FTL entry is also stored in association with the FTL entry in the FTL acceleration circuit, so that the FTL entry address indicates the starting address of the FTL entry in the main memory, and the FTL entry length indicates the size of the memory space occupied by the FTL entry.
[0055] The FTL acceleration circuit also includes a CPU interface and a main memory interface. The CPU accesses the FTL acceleration circuit through the CPU interface. The CPU interface is a low-latency access interface that supports synchronous / asynchronous operation modes. In the synchronous operation mode, the CPU sends an access request to the FTL acceleration circuit through the CPU interface of the FTL acceleration circuit. The FTL acceleration circuit indicates to the CPU that the access request has been processed only after obtaining the access result, and provides the CPU with the access result. After the CPU obtains the access result provided by the FTL acceleration circuit, it can continue to perform subsequent operations (such as executing the next instruction). In the asynchronous operation mode, the CPU sends an access request to the FTL acceleration circuit through the CPU interface. The FTL acceleration circuit indicates to the CPU that the access request has been processed without waiting for the return result.
[0056] The FTL acceleration circuit accesses the main memory (eg, DDR memory) through a main memory interface. The main memory interface is used to access the main memory and may be any known or to-be-developed memory access interface.
[0057] The CPU interface of the FTL acceleration circuit provides multiple access methods.
[0058] (1) FTL table entry preloading (FTL_Prefetch(index,addr))
[0059] The CPU sends an FTL table entry preload request (FTL_Prefetch) to the FTL acceleration circuit through the CPU interface to request the FTL acceleration circuit to load the FTL table entry A of the specified main memory address (for example, the address indicated by addr) from the main memory, store the FTL table entry address of the FTL table entry A in the address storage component of the FTL acceleration circuit, store the FTL table entry data of the table entry A in the FTL table entry data storage component of the FTL acceleration circuit, and store the address of the table entry A in the FTL table entry address storage component. The preload request sent by the CPU to the FTL acceleration circuit also includes an index (Index), and the index (Index) indicates the position of the FTL table entry storage component to which the FTL table entry is loaded. Through the index (Index), the CPU can also obtain the table entry address and / or table entry data of the table entry A from the FTL acceleration circuit. Since the time to access the main memory is much longer than the CPU instruction execution time, in order to avoid the CPU waiting for the execution result of the FTL acceleration circuit for a long time, preferably, the asynchronous operation mode is used to process the access request.
[0060] Optionally, the request sent by the CPU to the FTL acceleration circuit includes multiple addresses. The FTL acceleration circuit splices the multiple addresses into an address for the main memory. For example, the multiple addresses are high-order addresses and low-order addresses, and the multiple addresses can also be page addresses and page offset addresses.
[0061] After receiving the preload request, the FTL acceleration circuit uses the main memory address to read data of the specified length from the main memory to obtain the FTL table entry A, and stores the table entry data of the table entry A in the table entry data storage component indexed by the index Index of the FTL acceleration circuit. The FTL acceleration circuit also stores the main memory address of the table entry A in the table entry address storage component indexed by the index Index of the FTL acceleration circuit.
[0062] Optionally, when the FTL acceleration circuit reads the FTL table entry data from the main memory, the FTL table entry data in the main memory is also locked. In the FTL table entry preload request issued by the CPU, it is also indicated whether to lock the FTL table entry data in the main memory.
[0063] Optionally, the FTL table entry preload request indicates the logical address of the FTL table entry A to be loaded. The FTL acceleration circuit determines the main memory address of the FTL table entry A stored in the main memory according to the logical address. For example, the main memory address of the FTL table entry A is determined by the FTL table base address and the logical address as the offset value. Alternatively, the main memory address of the FTL table entry A is searched for using the logical address as an index.
[0064] Optionally, if the index index is indicated in the FTL table entry preloading request, and the storage unit indicated by the index index has been allocated in the FTL table entry storage component of the FTL acceleration circuit (the FTL table entry has been stored or a request has been made to load the FTL table entry to be stored in the storage unit indicated by the index index to the main memory), the content of the storage unit indicated by the index index will be cleared or marked invalid, and the FTL table entry will be retrieved from the main memory again.
[0065] (2) FTL table item read (FTL_Read_item(Index))
[0066] The CPU sends an FTL table entry read request to the FTL acceleration circuit through the CPU interface. In the FTL table entry read request, the index (index) of the FTL table entry to be read in the FTL table entry storage component is specified. The CPU requests the FTL acceleration circuit to provide the corresponding FTL table entry A through the index Index. The FTL acceleration circuit obtains the table entry data from the FTL table entry data storage component according to the index Index and provides it to the CPU. The time required for the FTL acceleration circuit to provide the table entry data to the CPU is close to the CPU instruction execution time, so preferably, the access request is processed using the synchronous operation mode. If the CPU requests the FTL acceleration circuit to provide the table entry data of the corresponding FTL table entry A through the index Index, the requested table entry data does not exist in the FTL table entry storage component of the FTL acceleration circuit, and the FTL acceleration circuit checks whether a request has been issued to the main memory to obtain the FTL table entry A of the specified main memory address. If the request has been issued, wait for the main memory to return the FTL table entry A, store the FTL table entry A in the FTL table entry storage component, and provide the table entry A to the CPU. If the request has not been issued, the CPU is informed that the requested FTL table entry A does not exist in the FTL acceleration component.
[0067] (3) FTL table entry address read (FTL_Read_addr(Index))
[0068] The CPU sends a FTL table entry address read request to the FTL acceleration circuit through the CPU interface. The CPU requests the FTL acceleration circuit to provide the table entry address of the corresponding FTL table entry A through the index (Index). The FTL acceleration circuit obtains the table entry data from the internal FTL table entry address storage component according to the index Index, and provides it to the CPU. The time required for the FTL acceleration circuit to provide the table entry address to the CPU is close to the CPU instruction execution time, so preferably, the synchronous operation mode is used to process the access request. If the CPU requests the FTL acceleration circuit to provide the table entry address of the corresponding FTL table entry A through the index Index, and the requested table entry address does not exist in the FTL table entry address storage component of the FTL acceleration circuit, then the CPU is informed that the requested FTL table entry A does not exist in the FTL acceleration component.
[0069] The reading operation of the FTL entry address stored in the FTL acceleration circuit is not necessary. Generally, when the CPU updates the FTL entry, only the entry data is updated without updating the FTL entry address, so the CPU does not need to update the FTL entry address stored in the FTL acceleration circuit.
[0070] (4) FTL table item update (FTL_Write_item(index,item))
[0071] The CPU sends an FTL table entry update request to the FTL acceleration circuit through the CPU interface. The CPU requests the FTL acceleration circuit to update the FTL table entry data with index Index to the new table entry data (item) specified by the CPU. The FTL acceleration circuit executes the update of the table entry data in the FTL table entry data storage component. The time required for the FTL acceleration circuit to update the table entry data is close to the CPU instruction execution time, so preferably, the access request is processed using the synchronous operation mode. Optionally, if the CPU requests the FTL acceleration circuit to update the corresponding FTL table entry data through the index Index, and the table entry data with index Index does not exist in the FTL table entry data storage component of the FTL acceleration circuit, the new table entry data is stored in the FTL table entry data storage component. And optionally, the CPU is informed that the table entry data with index Index does not exist in the FTL table entry data storage component of the FTL acceleration circuit.
[0072] Optionally, in the FTL table entry update request issued by the CPU, it is also indicated whether to unlock the FTL table entry data in the main memory. When the FTL acceleration circuit updates the FTL table entry data to the main memory, it also unlocks the FTL table entry data in the main memory according to the instruction. Thus, when the CPU needs to continuously update the FTL table entry data, it can unlock the FTL table entry data in the main memory only at the last update.
[0073] (5) FTL table entry address update (FTL_Write_addr(index,addr))
[0074] The CPU sends an FTL table entry address update request to the FTL acceleration circuit through the CPU interface. The CPU requests the FTL acceleration circuit to update the FTL table entry address with index Index in the FTL table entry address storage component to a new table entry address (addr) specified by the CPU. The FTL acceleration circuit performs an update of the table entry address in the FTL table entry address storage component. The time required for the FTL acceleration circuit to update the table entry address is close to the CPU instruction execution time, so preferably, the access request is processed using a synchronous operation mode. Optionally, if the CPU requests the FTL acceleration circuit to update the corresponding FTL table entry address through the index Index, and the table entry address with index Index does not exist in the FTL table entry address storage component of the FTL acceleration circuit, then the new table entry address is stored in the FTL table entry address storage component. And optionally, the FTL acceleration circuit informs the CPU that the table entry address with index Index does not exist in the FTL table entry address storage component of the FTL acceleration circuit.
[0075] The update operation of the FTL table entry address stored in the FTL acceleration circuit is not necessary.
[0076] (6) FTL entry flush (FTL_Flush_entry(index), FTL_Flush_entry)
[0077] The CPU sends an FTL table entry write request to the FTL acceleration circuit through the CPU interface. The CPU requests the FTL acceleration circuit to write the FTL table entry A indexed by Index into the main memory. The FTL acceleration circuit obtains the main memory address of the FTL table entry A from the FTL table entry address storage component according to the index Index, obtains the FTL table entry data (table entry A) from the FTL table entry data storage component, and writes the table entry A to the main memory according to the main memory address. Since the time to access the main memory is much longer than the CPU instruction execution time, in order to avoid the CPU waiting for the execution result of the FTL acceleration circuit for a long time, it is preferably used to process the access request using an asynchronous operation mode.
[0078] Optionally, no parameters are provided in the FTL table entry write request, and the FTL acceleration circuit writes all FTL table entries in the FTL table entry storage component to the main memory in response to the FTL table entry write request without parameters. The FTL table entry data stored in the FTL table entry data storage component is written to the main memory according to the corresponding FTL table entry address stored in the FTL table entry address storage component.
[0079] Optionally, the FTL table entry flushing request issued by the CPU also indicates whether to unlock the FTL table entry data in the main memory.
[0080] (7) FTL table item write-through (FTL_WriteThrough_item(index,item))
[0081] The CPU sends an FTL table entry write-through request to the FTL acceleration circuit through the CPU interface. The CPU requests the FTL acceleration circuit to update the FTL table entry data whose index in the FTL table entry data storage unit is Index to the new table entry data specified by the CPU, and write the new table entry data into the main memory. The FTL acceleration circuit executes the update of the table entry data in the FTL table entry data storage component. The FTL acceleration circuit also actively initiates a main memory update request, obtains the main memory address from the FTL table entry address storage component according to the index (index), and writes the FTL table entry data indicated by the index (index) into the main memory according to the main memory address, without CPU intervention.
[0082] Since the operation of writing data into the main memory is time-consuming, preferably, the access request is processed using an asynchronous operation mode, and after the FTL acceleration circuit writes the FTL table entry data into the FTL table entry data storage unit, it indicates to the CPU that the FTL table entry write-through request processing is completed.
[0083] Operation process
[0084] (1) Read FTL table entries
[0085] Figure 3 1 is a flow chart of a FTL entry reading process according to an embodiment of the present invention. When the CPU wants to use an FTL entry, it obtains the FTL entry (eg, entry A) from the main memory according to an embodiment of the present invention.
[0086] As an example, the CPU receives a request to read a storage device and needs to query the FTL to obtain the physical address to be accessed by the read request. Through the logical address of the read request, the CPU determines to load the FTL table entry A at the main memory address Addr. The CPU requests the FTL acceleration circuit to preload the FTL table entry A (310) through the FTL acceleration circuit local interface (e.g., FTL_Prefetch (index, addr)). In order to request the FTL acceleration circuit to preload the FTL table entry A, the CPU also informs the FTL acceleration circuit of the index (index) used to index the FTL table entry A, so that after the FTL acceleration circuit loads the FTL table entry A, the CPU can quickly obtain the FTL table entry A from the FTL acceleration circuit through the index index. The FTL acceleration circuit will store the obtained FTL table entry A in the FTL table entry data storage component and the FTL table entry address storage component addressed by the index (index).
[0087] The CPU requests the FTL acceleration circuit to preload the FTL table entry A in an asynchronous manner. After the CPU issues the request, it does not need to wait for the FTL acceleration circuit to return the execution result, but continues to execute other processes (320). Therefore, the processing capacity of the CPU can be effectively utilized during the process of the FTL acceleration circuit reading the FTL table entry A from the main memory (such as DRAM).
[0088] The FTL acceleration circuit responds to the request for preloading FTL table entry A issued by the CPU, and uses the address addr to read data from the main memory as FTL table entry A (315). The FTL acceleration circuit responds to the request for preloading FTL table entry A issued by the CPU in an asynchronous manner, and after receiving the request for preloading FTL table entry A and before obtaining FTL table entry A from the main memory, it indicates to the CPU that the preloading request processing is completed.
[0089] In one example, the CPU also informs the FTL acceleration circuit of the length of the requested FTL table entry A, so that the FTL acceleration circuit reads data of the specified length from the main memory. Optionally, the CPU also instructs the FTL acceleration circuit to lock the requested FTL table entry A, and when the FTL acceleration circuit obtains the FTL table entry A from the main memory, it first requests to lock the FTL table entry A, and after successfully locking, reads the FTL table entry A from the main memory.
[0090] After a period of time, the CPU estimates that the FTL acceleration circuit has retrieved the FTL table entry A from the main memory. The CPU reads (e.g., FTL_Read_item) the FTL table entry A with index index from the FTL acceleration circuit through the FTL acceleration circuit CPU interface (330). In another example, the FTL acceleration circuit sends a message or interrupt to the CPU to indicate that the CPU has retrieved the FTL table entry from the main memory.
[0091] In the example in the figure below, when the CPU reads the FTL table entry A with index index from the FTL acceleration circuit, the FTL acceleration circuit has obtained the FTL table entry A from the main memory and stored it in the FTL table entry data storage component of the FTL acceleration circuit. The FTL acceleration circuit also stores the main memory address addr of table entry A in the FTL table entry address storage component, and the FTL table entry A stored in the FTL acceleration circuit and the address of table entry A can be accessed through the index index.
[0092] In response to the CPU reading the FTL table entry A with index index from the FTL acceleration circuit, the FTL acceleration circuit obtains the table entry A from the FTL table entry data storage component and provides it to the CPU (335). The CPU performs the operation of reading the FTL table entry A with index index from the FTL acceleration circuit in a synchronous manner. The CPU continues to perform other operations (e.g., operations using the FTL table entry A) only after receiving the table entry A provided by the FTL acceleration circuit.
[0093] In another example, when the CPU reads FTL table entry A with index index from the FTL acceleration circuit, the FTL acceleration circuit receives a request to preload FTL table entry A from the main memory, but has not yet obtained FTL table entry A from the main memory. Since the operation of reading FTL table entry A with index index from the FTL acceleration circuit is performed in a synchronous manner, the FTL acceleration circuit waits to obtain FTL table entry A from the main memory, stores table entry A in the FTL table entry data storage component of the FTL acceleration circuit, and provides FTL table entry A to the CPU.
[0094] In still another example, when the CPU reads the FTL table entry A with index index from the FTL acceleration circuit, the FTL acceleration circuit has not yet received a request to preload the FTL table entry A from the main memory. The FTL acceleration circuit checks whether a request has been issued to the main memory to preload the FTL table entry A with the specified main memory address; if the request has not been issued, the CPU is informed that the requested FTL table entry A does not exist in the FTL acceleration component. Optionally, the FTL acceleration circuit checks whether a request has been issued to the main memory to preload the FTL table entry A with the specified main memory address; if the request has not been issued, the FTL acceleration circuit issues a request to the main memory to preload the FTL table entry A with the specified main memory address, and after waiting to obtain the FTL table entry A from the main memory, the FTL table entry A is stored in the FTL table entry data storage component of the FTL acceleration circuit, and the FTL table entry A is provided to the CPU.
[0095] In another embodiment, in order to fully utilize the preloading capability of the FTL acceleration circuit, the CPU issues multiple preloading requests to the FTL acceleration circuit to request the FTL acceleration circuit to preload multiple (e.g., m, where m is a positive integer) FTL table entries. After issuing m preloading requests, the FTL table entry A initially requested to be preloaded has been retrieved from the main memory by the FTL acceleration circuit, so that the CPU immediately issues an FTL table entry read request, and the FTL acceleration circuit can immediately provide the read FTL table entry A to the CPU.
[0096] (2) Update FTL entry ( Figure 4A )
[0097] When processing some IO requests (such as write requests), it is necessary to allocate new corresponding physical addresses to logical addresses and update FTL entries (such as entry A). Figure 4A The process of updating the FTL table entry according to the embodiment of the present invention is shown.
[0098] To update the FTL table entry A, the CPU obtains the FTL table entry A from the main memory according to an embodiment of the present invention, and stores it in the FTL table entry data storage component of the FTL acceleration circuit.
[0099] Next, the CPU allocates a new physical address for the FTL table item A. To write the FTL table item A with the updated physical address into the main memory, the CPU writes the FTL table item A (including the newly allocated physical address) with the index index to the FTL acceleration circuit through the FTL acceleration circuit CPU interface (410). In response to the CPU writing (FTL_Write_item(index,item)) the FTL table item A with the index index to the FTL acceleration circuit, the FTL acceleration circuit updates the table item data with the index index in the FTL table item data storage component (415). The operation of the CPU writing the FTL table item A with the index index to the FTL acceleration circuit is performed in a synchronous manner.
[0100] The CPU may then perform other processing (420).
[0101] In one example, the CPU also requests the FTL acceleration circuit to flush the FTL table entry indexed as index to the main memory (FTL_Flush_entry(index)) through the FTL acceleration circuit CPU interface. In response to the CPU requesting the FTL acceleration circuit to flush the FTL table entry indexed as index to the main memory, the FTL acceleration circuit obtains the main memory address of table entry A from the FTL table entry address storage component based on the index index of table entry A, obtains the content of table entry A from the FTL table entry data storage component, and issues a write request to the main memory through the main memory interface. The operation of the CPU requesting the FTL acceleration circuit to flush the FTL table entry indexed as index to the main memory can be performed in an asynchronous manner, so that the CPU can perform other processing during the process of the FTL acceleration circuit flushing the FTL table entry to the main memory. The operation of the CPU requesting the FTL acceleration circuit to flush the FTL table entry indexed as index to the main memory can also be performed in a synchronous manner. After the FTL acceleration circuit flushes the FTL table entry to the main memory, it indicates to the CPU that the FTL table entry flush request is completed. Optionally, the FTL acceleration circuit combines multiple FTL table entries and writes the multiple FTL table entries into the main memory in one main memory update request.
[0102] In another example, the CPU also requests the FTL acceleration circuit to flush all "dirty" FTL entries to the main memory (FTL_Flush_entry) through the FTL acceleration circuit CPU interface. "Dirty" FTL entries refer to FTL entries that have been loaded into the FTL entry storage component and updated but have not been flushed to the main memory.
[0103] Optionally, the FTL acceleration circuit also maintains status for each entry of the FTL table entry storage component, including an empty state indicating that the FTL entry has not been loaded, a "preloaded" state that an FTL entry load request has been received but the FTL entry has not been received, a valid state that the FTL entry has been loaded and the FTL entry has not been updated, a "dirty" state that the FTL entry has been updated, etc.
[0104] Optionally, the CPU further instructs the FTL acceleration circuit to unlock the updated FTL table entry A. When the FTL acceleration circuit updates the FTL table entry A to the main memory, the FTL table entry A in the main memory is also unlocked.
[0105] In another embodiment, the CPU generates a new FTL table entry instead of obtaining the FTL table entry from the main memory. The CPU sends an FTL table entry update (FTL_Write_item(index,item)) request to the FTL acceleration circuit through the CPU interface of the FTL acceleration circuit to write the generated FTL table entry into the FTL table entry storage component of the FTL acceleration circuit indicated by the index index.
[0106] Figure 4B The process of updating the FTL table entry according to another embodiment of the present invention is shown.
[0107] To update FTL table item A, the CPU obtains FTL table item A from the main memory according to an embodiment of the present invention, and allocates a new physical address to FTL table item A. To write the FTL table item A with the updated physical address into the main memory, the CPU issues a write-through request (FTL_WriteThrough_item(intel,item)) of FTL table item A (including the newly allocated physical address) with index index to the FTL acceleration circuit through the CPU interface of the FTL acceleration circuit. In response to the CPU issuing a write-through request of FTL table item A to the FTL acceleration circuit, the FTL acceleration circuit updates the table item data with index index in the FTL table item data storage component. The FTL acceleration circuit also obtains the main memory address from the FTL table item address storage component according to the index index, and writes the new table item data into the main memory according to the main memory address through the main memory interface without CPU intervention. The operation of the CPU writing through the FTL table item A with index index to the FTL acceleration circuit is performed asynchronously. While the FTL acceleration device updates the FTL entry storage component and writes new entry data into the main memory, the CPU can perform other processing (420).
[0108] Optionally, the FTL acceleration circuit combines multiple FTL table entries and writes the multiple FTL table entries into the main memory in one main memory update request.
[0109] Optionally, after issuing the FTL table entry write-through request, the CPU also requests the FTL acceleration circuit to flush the FTL table entry indexed by index to the main memory (FTL_Flush_entry(index)) through the FTL acceleration circuit CPU interface. After receiving the FTL table entry flushing request, the FTL acceleration circuit checks the FTL table entry indexed by index in the FTL table entry storage unit. If the FTL table entry has been written to the main memory, it directly indicates to the CPU that the FTL table entry flushing request is completed; if the FTL table entry has not been written to the main memory, it waits until the FTL table entry is written to the main memory before indicating to the CPU that the FTL table entry flushing request is completed.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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.
[0114] 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 accessing FTL, characterized in that: include: issuing a preload request for an FTL table entry at a specified main memory address, so as to load the specified FTL table entry from the main memory to a storage location indicated by a first index of an FTL table entry storage component in the FTL acceleration circuit through an FTL acceleration circuit; wherein the FTL acceleration circuit is coupled to a CPU and the main memory, the FTL acceleration circuit comprises a CPU interface, the CPU interface is a low-latency access interface, and the CPU accesses the FTL accelerator circuit through the CPU interface to obtain the FTL table entry of the FTL table stored in the main memory; issuing a read request for the FTL table entry of the first index, so as to obtain the FTL table entry of the first index from the FTL table entry storage component through the FTL acceleration circuit; The operation of issuing a preload request for the FTL table entry of the specified main memory address is performed in an asynchronous manner; and the operation of issuing a read request for the FTL table entry of the first index is performed in a synchronous manner.
2. The method according to claim 1, characterized in that The method further comprises: issuing an update request for the FTL table entry of the first index, so as to update the FTL table entry indicated by the first index in the FTL table entry storage component; A flush request for the FTL table entry of the first index is issued to write the FTL table entry indicated by the first index in the FTL table entry storage component into the main memory.
3. The method according to claim 2, characterized in that The operation of issuing a flush request for the FTL table entry of the first index is performed in a synchronous manner.
4. The method according to claim 1, characterized in that The method further comprises: After issuing an update request for the FTL table entry of the first index and before issuing a flush request for the FTL table entry of the first index, performing an operation unrelated to accessing the FTL table entry of the first index; and / or, After issuing a preload request for the FTL table entry at the specified address and before issuing a read request for the FTL table entry at the first index, an operation unrelated to accessing the FTL table entry at the specified address is performed.
5. The method according to claim 4, characterized in that The operation unrelated to accessing the FTL table entry of the first index includes an operation of accessing a second FTL table entry.
6. The method according to claim 4, characterized in that The preloading request for the FTL table entry at the specified address also indicates locking the FTL table entry at the specified address.
7. The method according to claim 4, characterized in that The write request for the FTL table entry of the first index also indicates unlocking the FTL table entry at the FTL table entry address indicated by the first index in the main memory.
8. A device for accessing FTL, used to execute the method according to any one of claims 1 to 7, characterized in that: It includes an FTL table entry address storage component, an FTL table entry data storage component, a CPU interface and a main memory interface, and the FTL table entry address storage component stores a plurality of FTL table entry addresses; The FTL table entry data storage component stores a plurality of FTL table entry data; wherein the FTL table entry address and the FTL table entry data associated therewith are accessed in the FTL table entry address storage component and the FTL table entry data storage component respectively by the same index, the FTL table entry address being the storage address of the FTL table entry data associated therewith in the main memory; In response to the CPU interface receiving an update request for the FTL table entry of the first index, the FTL table entry data indicated by the first index in the FTL table entry data storage component is updated; in response to the CPU interface receiving a flush request for the FTL table entry of the first index, the FTL table entry data specified by the first index is written into the main memory through the main memory interface according to the FTL table entry address specified by the first index.
Citation Information
Patent Citations
Solid state disk log generating method and device
CN106354615A
Mechanism for Using a GPU Controller for Preloading Caches
CN104025185A
Management method of mapping table caches in solid-state disk system
CN104166634A
Cache management method and system
CN105095113A
Address mapping method and device based on large-capacity solid storage
CN105205009A
