Method, device, computer equipment and storage medium for improving SSD mapping table management efficiency
By applying for mapping table cache in HMB and judging data validity, the problem of limited memory space of DRAM-less SSD is solved, and the mapping table management efficiency and read and write performance are improved.
Patent Information
- Application Number
- CN202210625431.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-06-02
AI Technical Summary
In the prior art, DRAM-less SSD has limited memory space, resulting in low efficiency in mapping table management and ineffective use of HMB technology to improve mapping table cache, affecting the read and write performance of firmware.
By applying for mapping table cache in HMB and judging the data validity during mapping table transfer, directly maintaining valid data in HMB, avoiding frequent loading into SRAM, and realizing direct substitution between mapping table and NAND.
Improves mapping table management efficiency, reduces SRAM mapping table cache competition, and improves firmware read and write performance.
Smart Images

Figure CN114996175B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of SSD mapping table management technology, and in particular to a method, apparatus, computer equipment, and storage medium for improving SSD mapping table management efficiency. Background Art
[0002] DRAM-less SSDs have limited overall memory space, and the memory available for mapping table caching is even more limited. Therefore, mapping tables need to be dynamically swapped between SRAM and NAND to meet host read and write requests. Currently, HMB technology can be used to allocate host memory for mapping table caching to expand the number of loadable table entries, thereby providing a wider range of high-speed read and write performance. However, SSD firmware cannot directly access host memory. Therefore, when managing mapping tables, the current firmware first loads the mapping table from host memory into SRAM for processing, which affects the efficiency of mapping table management. Summary of the Invention
[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a method, apparatus, computer equipment, and storage medium for improving the efficiency of SSD mapping table management.
[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0005] In a first aspect, this embodiment provides a method for improving SSD mapping table management efficiency, comprising the following steps:
[0006] Get the mapping table migration request;
[0007] Determine the mapping table migration range according to the mapping table migration request;
[0008] Apply for mapping table cache in HMB according to the mapping table migration range;
[0009] Bind the requested mapping table cache address to the mapping table migration request;
[0010] Use the requested mapping table cache to read the mapping table data on the NAND within the migration range;
[0011] Determine whether the read mapping table data is valid data;
[0012] If the read mapping table data is valid data, the mapping table data is retained in the HMB.
[0013] A further technical solution is: in the step of determining the mapping table moving range according to the mapping table moving request, the mapping table moving range refers to all mapping table blocks except the mapping table block currently in use.
[0014] A further technical solution is: after the step of judging whether the read mapping table data is valid data, the method further comprises: if the read mapping table data is invalid data, discarding the mapping table data and releasing the applied mapping table cache.
[0015] A further technical solution is: if the read mapping table data is valid data, then after the step of keeping the mapping table data in the HMB, it also includes: if the firmware accesses the mapping table data, then the requested mapping table cache is loaded into the SRAM.
[0016] In a second aspect, this embodiment provides a device for improving the management efficiency of an SSD mapping table, comprising: an acquisition unit, a determination unit, an application unit, a binding unit, a reading unit, a judgment unit, and a holding unit;
[0017] The acquiring unit is configured to acquire a mapping table migration request;
[0018] The determining unit is configured to determine a mapping table migration range according to the mapping table migration request;
[0019] The application unit is used to apply for a mapping table cache in the HMB according to the mapping table migration range;
[0020] The binding unit is used to bind the address of the applied mapping table cache with the mapping table migration request;
[0021] The reading unit is used to use the applied mapping table cache to read the mapping table data on the NAND within the transfer range;
[0022] The judging unit is configured to judge whether the read mapping table data is valid data;
[0023] The holding unit is configured to hold the mapping table data in the HMB if the read mapping table data is valid data.
[0024] A further technical solution is as follows: in the determining unit, the mapping table moving range refers to all mapping table blocks except the mapping table block currently in use.
[0025] A further technical solution thereof is: further comprising: a discarding and releasing unit, which is used to discard the mapping table data and release the applied mapping table cache.
[0026] Its further technical solution is: it also includes: a loading unit, which is used to load the applied mapping table cache into the SRAM if the firmware accesses the mapping table data.
[0027] In a third aspect, this embodiment provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method for improving the SSD mapping table management efficiency as described above is implemented.
[0028] In a fourth aspect, this embodiment provides a storage medium storing a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method for improving the management efficiency of the SSD mapping table as described above can be implemented.
[0029] Compared with the prior art, the present invention has the following advantages: during the mapping table migration management process, the firmware supports direct replacement of the HMB mapping table with the NAND mapping table, thereby avoiding frequent loading of the HMB mapping table into the SRAM and improving the mapping table management efficiency.
[0030] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0032] Figure 1 A flowchart of a method for improving SSD mapping table management efficiency provided by an embodiment of the present invention;
[0033] Figure 2 A schematic block diagram of an apparatus for improving SSD mapping table management efficiency provided by an embodiment of the present invention;
[0034] Figure 3 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0036] It will be understood that when used in this specification and the appended claims, the terms “comprises” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0037] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0038] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0039] See also Figure 1 In the specific embodiment shown, the present invention discloses a method for improving the efficiency of SSD mapping table management, comprising the following steps:
[0040] S1, obtain a mapping table migration request;
[0041] S2, determining the mapping table migration range according to the mapping table migration request;
[0042] Specifically, in this embodiment, the mapping table migration range refers to all mapping table blocks except the mapping table block currently in use.
[0043] Specifically, mapping table migration involves scanning the old mapping table blocks, rewriting only the valid mapping table data into new NAND mapping table blocks, and then recycling all scanned old mapping table blocks. This achieves a mechanism similar to mapping table block garbage collection (GC). Therefore, the scope of mapping table migration generally covers all mapping table blocks except the currently used mapping table blocks.
[0044] S3: Apply for mapping table cache in HMB based on the mapping table migration range;
[0045] S4, binding the requested mapping table cache address to the mapping table migration request;
[0046] Specifically, because the size of the mapping table cache may be smaller than the size of the NAND FLASH PAGE or the size of the LPA, multiple mapping table caches need to be combined to store the mapping table move request. By binding the address of the mapping table cache with the mapping table move request, the applied mapping table cache address can be saved in the system data structure read or written by the firmware, thereby achieving binding. This process also realizes the combination of separate mapping table caches.
[0047] S5, using the requested mapping table cache to read the mapping table data on the NAND within the migration range;
[0048] S6, determining whether the read mapping table data is valid data;
[0049] S7, if the read mapping table data is valid data, then the mapping table data is retained in the HMB;
[0050] Specifically, if the gppa (bank / blk / page) corresponding to the page mapping table data read on NAND is consistent with the gppa currently recorded in M2P, then the page data is considered valid data, otherwise it is invalid data; the data recorded in the M2P table is<MPA,gppa> Corresponding relationship: one MPA corresponds to one page of mapping table data.
[0051] S8: If the read mapping table data is invalid data, the mapping table data is discarded and the requested mapping table cache is released.
[0052] Specifically, if the gppa (bank / blk / page) corresponding to the page mapping table data read on the NAND is consistent with the gppa currently recorded in the M2P, the page data is considered valid data; otherwise, it is considered invalid data. Discarding the mapping table data means deleting the mapping table data.
[0053] Wherein, after the step of retaining the mapping table data in the HMB if the read mapping table data is valid data, the method further includes: loading the requested mapping table cache into the SRAM if the firmware accesses the mapping table data.
[0054] Specifically, the mapping table data is maintained in the HMB, and then the process is repeated until all the mapping table data within the migration range is processed and the mapping table migration is completed. During this process, the mapping table data does not need to be loaded into the SRAM, which greatly reduces the competition for the SRAM mapping table cache and greatly improves the mapping table management efficiency. Only when the loaded mapping table cache data content needs to be accessed in the subsequent firmware processing flow, the corresponding mapping table cache in the HMB needs to be loaded into the SRAM.
[0055] Specifically, the loop refers to traversing all mapping table BLOCKs except the mapping table BLOCK currently being written, because mapping table movement is generally processed by moving only one BLOCK at a time.
[0056] Among them, "complete processing" means repeating the process from S4 to S8, reading the data of a mapping table block, writing the valid data to the new mapping table block, and then reclaiming the moved mapping table block as an idle block. The process is considered complete when all mapping table blocks except the currently used mapping table block are reclaimed. The purpose of moving the mapping table blocks is to free up the mapping table blocks so that there are idle blocks available when new mapping table data is subsequently written to the NAND.
[0057] The present invention improves the efficiency of mapping table management by enabling firmware to control the direct replacement of the HMB mapping table with the NAND mapping table during the mapping table migration management process, thereby avoiding frequent loading of the HMB mapping table into the SRAM.
[0058] See also Figure 2 As shown, the present invention also discloses a device for improving the management efficiency of an SSD mapping table, comprising: an acquisition unit 10, a determination unit 20, an application unit 30, a binding unit 40, a reading unit 50, a judgment unit 60 and a holding unit 70;
[0059] The obtaining unit 10 is used to obtain a mapping table migration request;
[0060] The determining unit 20 is configured to determine a mapping table migration range according to the mapping table migration request;
[0061] The application unit 30 is used to apply for a mapping table cache in the HMB according to the mapping table migration range;
[0062] The binding unit 40 is used to bind the address of the applied mapping table cache with the mapping table migration request;
[0063] The reading unit 50 is used to read the mapping table data on the NAND within the migration range using the applied mapping table cache;
[0064] The judging unit 60 is configured to judge whether the read mapping table data is valid data;
[0065] The holding unit 70 is configured to hold the mapping table data in the HMB if the read mapping table data is valid data.
[0066] Wherein, in the determining unit 20, the mapping table moving range refers to all mapping table blocks except the mapping table block currently in use.
[0067] The device further includes: a discarding and releasing unit 80, which is used to discard the mapping table data and release the requested mapping table cache.
[0068] The device further includes: a loading unit, configured to load the requested mapping table cache into the SRAM if the firmware accesses the mapping table data.
[0069] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned device and each unit for improving the management efficiency of the SSD mapping table can refer to the corresponding description in the aforementioned method embodiment. For the convenience and brevity of the description, it will not be repeated here.
[0070] The above-mentioned device for improving the management efficiency of the SSD mapping table can be implemented in the form of a computer program. The computer program can be used in the following ways: Figure 3 Runs on the computer device shown.
[0071] See also Figure 3 , Figure 3 This is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 can be a terminal or a server. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, personal digital assistant, wearable device, or other electronic device with communication capabilities. The server can be a standalone server or a server cluster consisting of multiple servers.
[0072] See Figure 3 The computer device 500 includes a processor 502 , a memory, and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0073] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, which, when executed, can enable the processor 502 to execute a method for improving the efficiency of SSD mapping table management.
[0074] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
[0075] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a method for improving the management efficiency of the SSD mapping table.
[0076] The network interface 505 is used to communicate with other devices through the network. Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0077] The processor 502 is configured to execute a computer program 5032 stored in the memory to implement the following steps:
[0078] Step S1, obtaining a mapping table migration request;
[0079] Step S2: determining a mapping table migration range according to the mapping table migration request;
[0080] Step S3: Apply for mapping table cache in the HMB according to the mapping table migration range;
[0081] Step S4, binding the requested mapping table cache address to the mapping table migration request;
[0082] Step S5, using the requested mapping table cache to read the mapping table data on the NAND within the transfer range;
[0083] Step S6, determining whether the read mapping table data is valid data;
[0084] Step S7: If the read mapping table data is valid data, the mapping table data is retained in the HMB;
[0085] Step S8: If the read mapping table data is invalid data, the mapping table data is discarded and the requested mapping table cache is released.
[0086] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0087] Those skilled in the art will appreciate that all or part of the steps in the method of the above-described embodiment can be implemented by instructing the relevant hardware through a computer program. The computer program includes program instructions, which can be stored in a storage medium that is computer-readable. The program instructions are executed by at least one processor in the computer system to implement the steps in the method of the above-described embodiment.
[0088] Therefore, the present invention also provides a storage medium. The storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method for improving the management efficiency of the SSD mapping table can be implemented. The storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method can be implemented. The program instructions include the following steps:
[0089] Step S1, obtaining a mapping table migration request;
[0090] Step S2: determining a mapping table migration range according to the mapping table migration request;
[0091] Step S3: Apply for mapping table cache in the HMB according to the mapping table migration range;
[0092] Step S4, binding the requested mapping table cache address to the mapping table migration request;
[0093] Step S5, using the requested mapping table cache to read the mapping table data on the NAND within the transfer range;
[0094] Step S6, determining whether the read mapping table data is valid data;
[0095] Step S7: If the read mapping table data is valid data, the mapping table data is retained in the HMB;
[0096] Step S8: If the read mapping table data is invalid data, the mapping table data is discarded and the requested mapping table cache is released.
[0097] The storage medium may be any computer-readable storage medium that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk.
[0098] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0099] In the several embodiments provided herein, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the various units is merely a logical functional division, and actual implementation may employ other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented.
[0100] The steps in the methods of the embodiments of the present invention may be adjusted in order, combined, or deleted as needed. The units in the devices of the embodiments of the present invention may be combined, divided, or deleted as needed. Furthermore, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit.
[0101] If this integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the existing technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, terminal, or network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present invention.
[0102] The above embodiments are preferred implementation schemes of the present invention. In addition, the present invention can also be implemented in other ways. Any obvious replacement without departing from the concept of the present technical solution is within the scope of protection of the present invention.
Claims
1. A method for improving SSD mapping table management efficiency, characterized in that: The following steps are involved: Get the mapping table migration request; Determine the mapping table migration range according to the mapping table migration request; Apply for mapping table cache in HMB according to the mapping table migration range; Bind the requested mapping table cache address to the mapping table migration request; Use the requested mapping table cache to read the mapping table data on the NAND within the migration range; Determine whether the read mapping table data is valid data; If the mapping table data read is valid data, the mapping table data is retained in the HMB; Specifically, mapping table migration refers to scanning the OLD mapping table blocks, rewriting only the valid mapping table data into the new NAND mapping table blocks, and then recycling all the scanned OLD mapping table blocks; Specifically, the size of the mapping table cache is smaller than the size of the NAND FLASH PAGE or the size of the LPA, so multiple mapping table caches are needed to be combined to store the mapping table move request. By binding the address of the mapping table cache with the mapping table move request, the requested mapping table cache address can be saved in the system data structure read or written by the firmware to achieve binding.
2. The method for improving SSD mapping table management efficiency according to claim 1, characterized in that: In the step of determining a mapping table migration range according to the mapping table migration request, the mapping table migration range refers to all mapping table blocks except the mapping table block currently in use.
3. The method for improving SSD mapping table management efficiency according to claim 1, characterized in that: After the step of determining whether the read mapping table data is valid data, the method further includes: if the read mapping table data is invalid data, discarding the mapping table data and releasing the applied mapping table cache.
4. The method for improving SSD mapping table management efficiency according to claim 1, characterized in that: After the step of retaining the mapping table data in the HMB if the read mapping table data is valid data, the method further includes: loading the requested mapping table cache into the SRAM if the firmware accesses the mapping table data.
5. A device for improving SSD mapping table management efficiency, characterized in that: include: Acquisition unit, determination unit, application unit, binding unit, reading unit, judgment unit and holding unit; The acquiring unit is configured to acquire a mapping table migration request; The determining unit is configured to determine a mapping table migration range according to the mapping table migration request; The application unit is used to apply for a mapping table cache in the HMB according to the mapping table migration range; The binding unit is used to bind the address of the applied mapping table cache with the mapping table migration request; The reading unit is used to use the applied mapping table cache to read the mapping table data on the NAND within the transfer range; The judging unit is configured to judge whether the read mapping table data is valid data; The holding unit is configured to hold the mapping table data in the HMB if the read mapping table data is valid data; Specifically, mapping table migration refers to scanning the OLD mapping table blocks, rewriting only the valid mapping table data into the new NAND mapping table blocks, and then recycling all the scanned OLD mapping table blocks; Specifically, the size of the mapping table cache is smaller than the size of the NAND FLASH PAGE or the size of the LPA, so multiple mapping table caches are needed to be combined to store the mapping table move request. By binding the address of the mapping table cache with the mapping table move request, the requested mapping table cache address can be saved in the system data structure read or written by the firmware to achieve binding.
6. The device for improving SSD mapping table management efficiency according to claim 5, characterized in that: In the determining unit, the mapping table moving range refers to all mapping table blocks except the mapping table block currently in use.
7. The device for improving SSD mapping table management efficiency according to claim 5, characterized in that: Also includes: The discarding and releasing unit is used to discard the mapping table data and release the applied mapping table cache.
8. The device for improving SSD mapping table management efficiency according to claim 5, characterized in that: Also includes: The loading unit is configured to load the requested mapping table cache into the SRAM if the firmware accesses the mapping table data.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method for improving the management efficiency of the SSD mapping table according to any one of claims 1 to 4 when executing the computer program.
10. A storage medium, characterized in that: The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the method for improving the management efficiency of the SSD mapping table according to any one of claims 1 to 4 can be implemented.
Citation Information
Patent Citations
HMB-based logic physical mapping table protection method and device and solid state disk
CN110083481A
Data storage device and method of deleting namespace thereof
CN110908927A