Management method and system of using HMB as physical mapping table cache
By using HMB as an L2P mapping table cache, the problems of high cost and poor performance of SSD hard drives are solved, and efficient management of HMB cache and real-time updates of hot and cold data are achieved, thereby improving the performance and space utilization of SSD.
Patent Information
- Application Number
- CN202211027123.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-25
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-08-25
AI Technical Summary
In existing technologies, SSDs are costly when using DRAM as the L2P mapping table storage, while NAND offers poor performance. Furthermore, the limited HMB cache space cannot cover all L2P entries, thus limiting performance improvements.
Using HMB as an L2P mapping table cache, by arranging physical addresses in logical address order, dividing them into multiple space segments and paths, and defining metadata structure, the HMB cache can achieve fast read/write and real-time updates, supporting various storage uses and namespaces.
It reduces the cost of DRAM usage in SSDs, improves HMB cache management efficiency, supports multiple LBA formats and NAND storage units, and enables real-time updates and efficient management of hot and cold data.
Smart Images

Figure CN115391236B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of solid-state drive storage technology, and more specifically to a management method and system for using HMB (Host Memory Buffer) as a physical mapping table cache. Background Technology
[0002] During the read and write process of non-volatile storage devices, an address translation layer is needed to translate the logical unit addresses (LBAs) used in the host to the physical data addresses in the storage device. For SSD solid-state drives based on NAND flash memory technology, this translation layer is called the Flash Translation Layer (FTL). The FTL stores a mapping table that represents the correspondence between logical addresses and physical addresses on the NAND flash memory (L2P), enabling read and write access to data on the NAND. Traditional SSD architectures typically store the L2P mapping table on either the DRAM or NAND flash memory of the SSD device. DRAM has lower read and write latency, but using DRAM increases the manufacturing cost of SSDs. NAND flash memory, on the other hand, has higher read and write latency, which is detrimental to SSD performance.
[0003] The Host Controller Interface (HMB) protocol is defined in the Non-Volatile Memory (NVMe) specification, allocating a portion of the host's memory space to the SSD controller. The SSD controller can utilize this memory space to store the Level-to-Party (L2P) mapping table. HMB's read / write latency falls between that of DRAM and NAND, providing a cost-effective and performance-balanced solution for L2P storage. The SSD controller accesses the HMB space via the device's PCIe interface to access and manage the L2P mapping table. Due to limitations in host memory resources, the memory space allocated to the HMB typically only stores a portion of the L2P mapping table. Therefore, the HMB is usually used as a cache for the L2P mapping table, storing frequently used L2P entries, while the complete mapping table is stored on the NAND. When the SSD performs a read operation on the NAND, it needs to obtain the corresponding L2P entry, which can be retrieved by reading the HMB cache. If the relevant entry is not found in the HMB cache, it then searches on the NAND.
[0004] Frequently used L2P entries are typically referred to as "hot data." Conversely, infrequently used L2P entries are referred to as "cold data." Storing hot L2P entries in the HMB cache can improve the overall access performance of the L2P mapping table. During SSD usage, as application scenarios change, the types of hot and cold data will also change; cold data may become hot data, and hot data may become cold data. Therefore, the L2P entries in the HMB need to be continuously updated accordingly. Summary of the Invention
[0005] The purpose of this application is to provide a method and system for caching physical mapping tables in HMB. Based on the usage characteristics of L2P table entries in HMB cache, a management scheme for L2P mapping tables is defined, which realizes fast reading, writing, searching and real-time updating of L2P mapping tables in HMB.
[0006] This application discloses a management method for using HMB as a physical mapping table cache, including:
[0007] Arrange the physical addresses in logical address order, and combine the physical mapping tables corresponding to multiple consecutive physical addresses into a table entry unit. The logical address corresponding to the starting mapping table of each table entry unit is used as the index of that table entry unit.
[0008] Determine the space size of the HMB, divide all table entry units into multiple space segments according to the space size of the HMB, each space segment includes multiple table entry units, and divide each space segment into multiple paths;
[0009] Metadata is calculated based on the logical address corresponding to the starting mapping table of the table entry to be stored and the space size of the HMB. The metadata includes a segment number and a path number. The segment number is equal to the modulo result of the logical address divided by the space size of the HMB, and the path number is equal to the remainder of the modulo result divided by the number of paths.
[0010] The metadata and the table entries to be stored are written into the HMB.
[0011] In a preferred embodiment, the metadata further includes a write sequence number indicating the write order of the metadata. When the metadata and the table entry to be stored are written to the HMB, the metadata corresponding to the earliest written write sequence number and the table entry corresponding to that metadata in the HMB are replaced, and the write sequence numbers of all metadata are updated.
[0012] In a preferred embodiment, the write order number includes {0, 1, 2, 3}, where 0 indicates that the metadata was written earliest and will be replaced in the next write, and 3 indicates that the metadata was written most recently.
[0013] In a preferred embodiment, the metadata further includes a write sequence number indicating the write order of the metadata, and when the metadata and the table entry unit to be stored are written to the HMB, the metadata in the HMB for a specific road number and its corresponding table entry unit are specified to be replaced, and the write sequence number of all metadata is updated.
[0014] In a preferred embodiment, the write order number of the metadata corresponding to the specified specific road number is updated to indicate that it was recently written, the write order number of the metadata written later than the metadata corresponding to the specified specific road number is decremented by 1, and the write order number of the metadata written earlier than the metadata corresponding to the specified specific road number remains unchanged.
[0015] In a preferred embodiment, metadata is generated based on the logical address corresponding to the mapping table to be queried or read, or the logical address corresponding to the starting mapping table of the table entry cell to be queried or read. The metadata is then searched in the HBM, and when a matching metadata is found, the mapping table corresponding to the metadata is returned.
[0016] In a preferred embodiment, the HMB is divided into multiple subspaces corresponding to different namespaces, and each subspace of the HMB includes multiple logical storage sub-blocks for storing metadata, table entry units, user data, and verification data.
[0017] In a preferred embodiment, the HMB is divided into multiple subspaces corresponding to different namespaces. The step of writing the metadata and the table entry unit to be stored into the HMB further includes: determining whether the data corresponding to the metadata and the table entry unit to be stored is cold data or hot data; storing the metadata and the table entry unit to be stored in the subspaces of different namespaces according to the determination result of cold data and hot data; and dividing the subspace used to store the metadata and the table entry unit to be stored corresponding to hot data into one space segment, so that the hit rate of hot data lookup reaches 100%.
[0018] In a preferred embodiment, a table of physical mappings corresponding to 1024 consecutive physical addresses constitutes a table entry unit.
[0019] In a preferred embodiment, all table entries are divided into 1, 128, or 256 spatial segments.
[0020] In a preferred embodiment, each spatial segment is divided into 4, 8, or 6 paths.
[0021] This application also discloses a management system that uses HMB as a physical mapping table cache, including:
[0022] The mapping table partitioning module is configured to arrange physical addresses in logical address order, and to form a table entry unit by combining the physical mapping tables corresponding to multiple consecutive physical addresses. The logical address corresponding to the starting mapping table of each table entry unit is used as the index of that table entry unit.
[0023] The table entry unit partitioning module is configured to determine the space size of the HMB, divide all table entry units into multiple space segments according to the space size of the HMB, each space segment includes multiple table entry units, and divide each space segment into multiple paths.
[0024] The metadata calculation module is configured to calculate metadata based on the logical address corresponding to the starting mapping table of the table entry unit to be stored and the space size of the HMB. The metadata includes a segment number and a path number. The segment number is equal to the modulo result of the logical address divided by the space size of the HMB, and the path number is equal to the remainder of the modulo result divided by the number of paths.
[0025] The write module is configured to write the metadata and the table entry unit to be stored into the HMB.
[0026] This application also discloses a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the method described above.
[0027] Compared with the prior art, this application has at least the following beneficial effects:
[0028] This solution uses HMB as the address mapping table cache for SSD hard drives, which can replace the traditional DRAM-based address mapping table storage solution, saving or avoiding the cost of using DRAM on SSD hard drives and reducing the size of SSDs.
[0029] The L2P mapping table is arranged sequentially according to LDA and divided into multiple space segments according to the HMB size, which solves the problem that the entire L2P table space cannot be covered when the HMB space is insufficient.
[0030] The data structure of the L2P mapping table unit is defined, enabling hardware-based computation and lookup of metadata, significantly improving the management efficiency of the HMB cache and supporting multiple LBA formats and NAND storage units. The read, write, lookup, and replace operation instructions for the HMB cache are defined, allowing the firewall (FW) to manage the contents of the HMB cache through the provided LDA. The operation results of the HW on the HMB cache are defined, serving as the interface for the FW. The HMB entry replacement mechanism is defined: replacement in old-new order or in the order specified by the FW, achieving flexibility in entry management.
[0031] Dividing a single HMB space into multiple subspaces and managing HMB partitions improves the utilization of HMB space. This allows HMB to support multiple namespaces for various storage purposes, enabling simultaneous support for different application scenarios and real-time updates of hot and cold data.
[0032] This specification contains numerous technical features distributed across various technical solutions. Listing all possible combinations of these features (i.e., technical solutions) would make the specification excessively lengthy. To avoid this problem, the various technical features disclosed in the above-described invention, the various embodiments and examples below, and the various technical features disclosed in the accompanying drawings can be freely combined to form various new technical solutions (all of which should be considered as described in this specification), unless such a combination of technical features is technically infeasible. For example, one example discloses feature A+B+C, and another example discloses feature A+B+D+E. Features C and D are equivalent technical means that serve the same function, and technically only one needs to be used; they cannot be used simultaneously. Feature E can technically be combined with feature C. Therefore, the solution A+B+C+D should not be considered as described because it is technically infeasible, while the solution A+B+C+E should be considered as described. Attached Figure Description
[0033] Figure 1 A flowchart of an HMB cache physical mapping table method in one embodiment of this application is shown.
[0034] Figure 2 A schematic diagram of the HMB cache operation process in one embodiment of this application is shown.
[0035] Figure 3 A schematic diagram of the HMB cache data stream is shown in one embodiment of this application. Detailed Implementation
[0036] In the following description, many technical details are presented to help the reader better understand this application. However, those skilled in the art will understand that the technical solutions claimed in this application can be implemented even without these technical details and various variations and modifications based on the following embodiments.
[0037] The following is a brief summary of some of the innovative aspects of the embodiments of this application:
[0038] This disclosure presents a management scheme for using the HMB (Hardware Address Mapping Table) as a cache for a solid-state drive (SSD). The scheme divides the L2P (Low-to-Place) cache into multiple entry units, uses the starting LDA (Local Address Depth) as the index for each L2P entry unit, and calculates metadata based on the starting LDA and the size of the HMB space, enabling hardware management of the L2P entry units. Furthermore, the scheme implements software (FW) operations such as reading, writing, searching, and replacing the HMB cache. The hardware (HW) automatically calculates the metadata and metadata address corresponding to each L2P entry unit using the starting LDA provided by the FW, and performs operations on the corresponding L2P cache entry units and metadata, thus achieving cache management of the L2P cache. Multiple entry replacement methods are supported for metadata operations. Additionally, this scheme also implements subspace partitioning of the HMB cache and supports multiple namespaces.
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0040] This application discloses a method for caching a physical mapping table in an HMB cache. Figure 1 A flowchart of a method for caching a physical mapping table in an HMB is shown in one embodiment. The method includes the following steps:
[0041] Step 101: Arrange the physical addresses in logical address order, and form a table entry unit by combining the physical mapping tables corresponding to multiple consecutive physical addresses. The logical address corresponding to the starting mapping table of each table entry unit is used as the index of that table entry unit. In one embodiment, a table entry unit is formed by combining the physical mapping tables corresponding to 1024 consecutive physical addresses.
[0042] Step 102: Determine the space size of the HMB, divide all table entries into multiple spatial segments based on the HMB space size, each spatial segment includes multiple table entries, and divide each spatial segment into multiple paths. In one embodiment, all table entries are divided into 1, 128, or 256 spatial segments. In another embodiment, each spatial segment is divided into 4, 8, or 6 paths.
[0043] Step 103: Calculate metadata based on the logical address corresponding to the starting mapping table of the table entry unit to be stored and the space size of the HMB. The metadata includes segment number and path number. The segment number is equal to the modulo result of the logical address divided by the space size of the HMB, and the path number is equal to the remainder of the modulo result divided by the number of paths.
[0044] Step 104: Write the metadata and the table entry cells to be stored into the HMB.
[0045] In one embodiment, the metadata further includes a write sequence number, which indicates the write order of the metadata. When writing the metadata and the table entry to be stored to the HMB, the metadata corresponding to the earliest written write sequence number and the table entry corresponding to that metadata in the HMB are replaced, and the write sequence numbers of all metadata are updated. For example, the write sequence numbers include {0, 1, 2, 3}, where 0 to 3 sequentially represent the write order of the metadata. Here, 0 indicates that the metadata was written earliest and will be replaced on the next write, and 3 indicates that the metadata was written most recently.
[0046] In another embodiment, when writing metadata and the table entry unit to be stored to the HMB, the metadata and its corresponding table entry unit in the HMB for a specific route number are specified to be replaced, and the write order number of all metadata is updated. The write order number of the metadata corresponding to the specified route number is updated to indicate that it was recently written, the write order number of metadata written later than the metadata corresponding to the specified route number is decremented by 1, and the write order number of metadata written earlier than the metadata corresponding to the specified route number remains unchanged.
[0047] In one embodiment, metadata is generated based on the logical address corresponding to the mapping table to be queried or read, or the logical address corresponding to the starting mapping table of the table entry unit to be queried or read. The metadata is then searched in the HMB, and when a matching metadata is found, the mapping table corresponding to the metadata is returned.
[0048] In one embodiment, the HMB is divided into multiple subspaces corresponding to different namespaces, and each subspace of the HMB includes multiple logical storage sub-blocks for storing metadata, table entry units, user data, and verification data.
[0049] In one embodiment, when writing metadata and table entry units to be stored to the HMB, it is determined whether the data corresponding to the metadata and table entry units to be stored is cold data or hot data. Based on the determination result of cold data and hot data, the metadata and table entry units to be stored are stored in subspaces of different namespaces. Furthermore, the subspace used to store the metadata and table entry units to be stored corresponding to hot data is divided into one space segment to improve the hit rate of hot data lookup, which can be as high as 100%.
[0050] To better understand the technical solution of this application, a specific example is provided below. The details listed in this example are mainly for ease of understanding and are not intended to limit the scope of protection of this application.
[0051] The NVMe protocol specifies that non-volatile memory supports various logical block (LB) sizes, such as 512 bytes and 4KB. A logical block is the smallest addressable data unit for a read / write command. The address of a logical block is called its LBA.
[0052] Each L2P entry is 32 bits long and represents the address of a physical storage cell in the NAND flash memory, i.e., a Physical Address (PDA). The size of a physical storage cell in NAND flash memory is typically 4KB, 8KB, etc. Each L2P entry also corresponds to a logical address, called the Logical Data Address (LDA). PDAs are arranged sequentially according to their LDAs, with each PDA serving as an entry in the L2P mapping table, and the LDA serving as the index for each entry, thus achieving the conversion from LDA to PDA. In this application, to facilitate the management of L2P entries and improve the efficiency of read and write operations, a certain number of consecutive PDAs are grouped into an entry unit. Each entry unit occupies the same amount of storage space, and the LDA of its first entry is called the Starting Logical Address (SLDA), which can serve as the index for this entry unit. Read and write operations on the L2P mapping table are performed on an entry unit basis, thereby improving the efficiency of read and write operations.
[0053] Taking a 512-byte logical block and 4KB flash physical space as an example, the composition of the L2P table entry is shown in Table 1 below.
[0054] Composition of L2P entries in Table 1
[0055]
[0056]
[0057] Taking a 4KB logical block and 8KB flash physical space as an example, the composition of the L2P table entry is shown in Table 2 below.
[0058] Composition of L2P Entries in Table 2
[0059]
[0060] The HMB space allocated by the system is often insufficient to store all L2P entries. For example, Windows 10 typically allocates only 64MB as HMB space. To ensure HMB coverage of all L2P entries, the entire L2P entry space is divided into multiple sections according to the HMB space size. Each section has a unique section number and can cover multiple L2P entry units. Within the same section, each L2P entry unit has its intra-section offset address calculated from its corresponding SLDA, and each L2P entry unit's intra-section offset address is unique. Because the L2P entry space is divided into multiple sections, it is possible for two or more entry units to belong to different sections but have the same offset address within their respective sections. To allow HMB to store entry units with the same offset address, each section is divided into 4 or 8 ways. For L2P entry units with different section numbers but the same intra-section offset address, different way numbers can be used. Metadata contains the segment number and route number, and can therefore be used as an index for L2P table entries. When an L2P table entry is written to the HMB cache, its corresponding metadata is also updated in the metadata table. When looking up an L2P table entry, the metadata can be used to achieve a fast lookup of the L2P table entry. The introduction of metadata allows the HMB space to store L2P table entries corresponding to any segment number and route number, enabling the HMB cache to cover the entire L2P table entry space.
[0061] A metadata entry can only store a fixed number of paths (4 or 8). When the number of L2P entries with the same offset address that need to be stored exceeds the number of paths that the metadata can store, an existing entry needs to be replaced to make room for the new entry. Therefore, a sequence number (or sequential number) is introduced into the metadata to indicate the old and new states of L2P entries with the same offset address. When the metadata that needs to be updated exceeds the number of paths that can be stored, the oldest L2P entry with the correct path number (i.e., the one written first) and its metadata are replaced, and the sequence numbers of the other paths are updated to the oldest ones in sequence. Taking 4-path metadata as an example, the replacement rules for the old and new sequence numbers are shown in Table 3 below. In Table 3, the sequence number 0 for path number 3 is the oldest, so the new entry will replace path number 3 and update its sequence number to the newest one, 2. The old and new sequence numbers for path numbers 0, 1, and 2 are decremented by 1 in sequence.
[0062] Table 3 shows the sequential replacement method for the route numbers.
[0063] Road number Current serial number Updated serial number 0 3 2 1 2 1 2 1 0 3 0 3
[0064] Meanwhile, to enable flexible management of table entries in the HMB by the Firewall (FW), a sequence number replacement rule for the FW can be defined. The FW can specify the route number to be replaced, and the HW will replace the table entry for that route number and update the sequence number in the metadata. Taking 4-way metadata as an example, the replacement rule for the old and new sequence numbers of the route numbers specified by the FW is shown in Table 4 below. In Table 4, the FW specifies that route number 1 will be replaced, so the new table entry will replace route number 1 and update its sequence number to the latest 2. For routes with a newer sequence number than route number 1 (route number 0 in this example), their sequence number is decremented by 1. For routes with an older sequence number than route number 1 (route numbers 2 and 3 in this example), their sequence numbers remain unchanged.
[0065] Table 4 shows the replacement method for the serial numbers of the four routes in a specified order.
[0066] Road number Current serial number Updated serial number 0 3 2 1 2 3 2 1 1 3 0 0
[0067] In summary, metadata consists of the old and new sequence numbers, the path number, and the segment number, plus a valid bit. Taking an HMB divided into 256 spatial segments, each containing 4 paths, as an example, the metadata is defined in the format shown in Table 5 below:
[0068] Table 5: Composition of Data Elements
[0069]
[0070]
[0071] Figure 2 The operation flow of HMB caching in one embodiment is shown. Figure 3 This is an example of a data stream in the HMB cache. HMB entry operation instructions are initiated by the FW, and the HW completes the entry operations and metadata operations. As defined in Table 6 below, the HMB cache operation instructions can be: a write instruction to read an L2P entry cell from SRAM and write it into the HMB; a read instruction to read an L2P entry cell from the HMB and write it into SRAM; a search instruction to find a specific L2P entry in the HMB; and a replace instruction to replace a specific L2P entry in the HMB with a new entry. To implement these operations, the following HMB operation instructions are defined. In these instructions, the FW needs to provide the SLDA corresponding to the L2P entry or entry cell. The HW calculates the metadata based on the SLDA, and then locates the entry or entry cell by searching the metadata, performing read, write, search, or replace operations. A dedicated space can be allocated in the HMB for storing metadata. The HW can perform search, calculation, and update operations on the metadata.
[0072] Table 6. Operation Instructions for HMB Cache
[0073]
[0074]
[0075] HW reads metadata from the HMB space for queries. There are two possible results for metadata lookups: "hit" or "miss". A "hit" means the corresponding entry unit already exists in the HMB. A "miss" means the corresponding entry unit does not exist in the HMB. For write and replace instructions, HW needs to update the corresponding metadata after writing the new L2P entry or entry unit to the HMB. For read and lookup instructions, HW does not need to update the metadata. The lookup results cached in the HMB are shown in Table 7 below.
[0076] Table 7: HMB Cache Lookup Results
[0077]
[0078]
[0079] A namespace is a collection of non-volatile memories that can be formatted into logical blocks. After formatting, a namespace is a collection of logical blocks of size N, where the block sizes can vary, and the block addresses range from 0 to N-1 (where N is the logical space size). An NVMe controller can support multiple namespaces, distinguished by namespace IDs. The host-allocated HMB space, however, is a single logical space.
[0080] In this invention, the HMB space is divided into multiple HMB subspaces corresponding to different namespaces. Each subspace includes multiple logical storage sub-blocks, which can be used to store metadata, table entry units, user data, and verification data, respectively. Each sub-block corresponds to a different starting physical address, and the starting physical address of each sub-block is recorded using hardware registers. In this way, the HMB space can be used to store multiple types of data simultaneously, with each type of data stored in different logical sub-blocks. For example, the HMB can store L2P table entries as a table entry cache, and can also store metadata, user data, and verification data.
[0081] Dividing the HMB into logical sub-blocks also enables it to support multiple namespaces. When operating on L2P entries of a namespace, the HMB command provides the corresponding namespace ID. The HW, based on the namespace ID and the physical address corresponding to that space, performs lookup or access operations only within its logical sub-block and returns the result. Different cache management methods can be defined within each logical sub-block of the HMB to meet the different needs of different namespaces. For a given non-volatile memory, the size, access speed, and application scenarios of different namespaces can vary. For example, a namespace can be allocated to a larger, slower-accessing third-level cell (TLC) to store infrequently used cold data; a namespace can be allocated to a smaller, faster-accessing multi-level cell (MLC) to store frequently used hot data. In this invention, the namespace used to store cold data can be defined as a cache supporting multiple segments, and the namespace used to store hot data can be defined as a cache supporting a single segment. In this way, when searching for cold data entries, the HMB cache may return a "hit" or a "miss" result; when searching for hot data entries, the HMB cache always returns a "hit" result. This improves the search speed for hot data L2P entries.
[0082] Another embodiment of this application discloses a management system using an HMB as a physical mapping table cache, comprising: a mapping table partitioning module, a table entry unit partitioning module, a metadata calculation module, and a writing module. The mapping table partitioning module is configured to arrange physical addresses in logical address order, forming a table entry unit from the physical mapping tables corresponding to multiple consecutive physical addresses, with the logical address corresponding to the starting mapping table of each table entry unit serving as its index. The table entry unit partitioning module is configured to determine the size of the HMB space, divide all table entry units into multiple space segments based on the HMB space size, with each space segment including multiple table entry units, and further divide each space segment into multiple paths. The metadata calculation module is configured to calculate metadata based on the logical address corresponding to the starting mapping table of the table entry unit to be stored and the size of the HMB space. The metadata includes a segment number and a path number, where the segment number is equal to the modulo result of the logical address divided by the size of the HMB space, and the path number is equal to the remainder of the modulo result divided by the number of paths. The writing module is configured to write the metadata and the table entry unit to be stored into the HMB.
[0083] Accordingly, embodiments of this specification also provide a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the various method embodiments of this specification. Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined herein, computer-readable storage media does not include transient media, such as modulated data signals and carrier waves.
[0084] It should be noted that in this patent application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. In this patent application, if it refers to performing an action according to a certain element, it means performing the action at least according to that element, including two cases: performing the action only according to that element, and performing the action according to that element and other elements. Expressions such as "multiple," "repeatedly," and "various" include two, two times, two kinds, and more than two, more than two times, and more than two kinds.
[0085] All references to this specification are considered to be incorporated integrally into the disclosure herein so that they can serve as a basis for modifications where necessary. Furthermore, it should be understood that the above are merely preferred embodiments of this specification and are not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the scope of protection of one or more embodiments of this specification.
[0086] In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Furthermore, the processes described in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A management method for using HMB as a physical mapping table cache, characterized in that, include: Arrange the physical addresses in logical address order, and combine the physical mapping tables corresponding to multiple consecutive physical addresses into a table entry unit. The logical address corresponding to the starting mapping table of each table entry unit is used as the index of that table entry unit. Determine the space size of the HMB, divide all table entry units into multiple space segments according to the space size of the HMB, each space segment includes multiple table entry units, and divide each space segment into multiple paths; Metadata is calculated based on the logical address corresponding to the starting mapping table of the table entry unit to be stored and the space size of the HMB. The metadata includes a segment number, a path number, and a write order number. The segment number is equal to the modulo result of the logical address divided by the space size of the HMB. The path number is equal to the remainder of the modulo result divided by the number of paths. The write order number indicates the write order of the metadata. When the metadata and the table entry unit to be stored are written to the HMB, the metadata corresponding to the earliest written write order number and the table entry unit corresponding to that metadata are replaced, or the metadata and the table entry unit corresponding to the specified path number in the HMB are replaced. In addition, the write order numbers of all metadata are updated. and The metadata and the table entries to be stored are written into the HMB.
2. The management method for using HMB as a physical mapping table cache according to claim 1, characterized in that, When replacing the metadata corresponding to the earliest written write sequence number and the corresponding table entry cell in the HMB, the write sequence number includes {0,1,2,3}, where 0 indicates that the metadata was written earliest and will be replaced in the next write, and 3 indicates that the metadata was written most recently.
3. The management method for using HMB as a physical mapping table cache according to claim 1, characterized in that, When the metadata in the HMB and its corresponding table entry cell for a specific route number are specified to be replaced, the write order number of the metadata corresponding to the specified route number is updated to indicate that it was recently written, the write order number of the metadata written later than the metadata corresponding to the specified route number is decremented by 1, and the write order number of the metadata written earlier than the metadata corresponding to the specified route number remains unchanged.
4. The management method for using HMB as a physical mapping table cache according to claim 1, characterized in that, Metadata is generated based on the logical address corresponding to the mapping table to be queried or read, or the logical address corresponding to the starting mapping table of the table entry cell to be queried or read. The metadata is then searched in the HMB. When a matching metadata is found, the mapping table corresponding to the metadata is returned.
5. The management method for using HMB as a physical mapping table cache according to claim 1, characterized in that, The HMB is divided into multiple subspaces corresponding to different namespaces. Each subspace of the HMB includes multiple logical storage sub-blocks for storing metadata, table entry units, user data, and verification data.
6. The management method for using HMB as a physical mapping table cache according to claim 1, characterized in that, The HMB is divided into multiple subspaces corresponding to different namespaces. The step of writing the metadata and the table entry unit to be stored into the HMB further includes: determining whether the data corresponding to the metadata and the table entry unit to be stored is cold data or hot data; storing the metadata and the table entry unit to be stored in the subspaces of different namespaces according to the determination result of cold data and hot data; and dividing the subspace used to store the metadata and the table entry unit to be stored corresponding to hot data into one space segment to make the hit rate of hot data lookup reach 100%.
7. The management method for using HMB as a physical mapping table cache according to claim 1, characterized in that, A table entry unit consists of 1024 consecutive physical addresses corresponding to physical mapping tables.
8. The management method for using HMB as a physical mapping table cache according to claim 1, characterized in that, All table entries are divided into 1, 128, or 256 spatial segments.
9. The management method for using HMB as a physical mapping table cache according to claim 1, characterized in that, Each spatial segment is divided into 4, 8, or 6 paths.
10. A management system that uses HMB as a physical mapping table cache, characterized in that, include: The mapping table partitioning module is configured to arrange physical addresses in logical address order, and to form a table entry unit by combining the physical mapping tables corresponding to multiple consecutive physical addresses. The logical address corresponding to the starting mapping table of each table entry unit is used as the index of that table entry unit. The table entry unit partitioning module is configured to determine the space size of the HMB, divide all table entry units into multiple space segments according to the space size of the HMB, each space segment includes multiple table entry units, and divide each space segment into multiple paths. The metadata calculation module is configured to calculate metadata based on the logical address corresponding to the starting mapping table of the table entry unit to be stored and the space size of the HMB. The metadata includes a segment number, a path number, and a write order number. The segment number is equal to the modulo result of the logical address divided by the space size of the HMB. The path number is equal to the remainder of the modulo result divided by the number of paths. The write order number indicates the write order of the metadata. When writing the metadata and the table entry unit to be stored into the HMB, the module replaces the metadata in the HMB corresponding to the earliest written write order number and the table entry unit corresponding to that metadata, or specifies the replacement of the metadata in the HMB with a specific path number and its corresponding table entry unit. In addition, the module updates the write order number of all metadata. and The write module is configured to write the metadata and the table entry unit to be stored into the HMB.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Method and device for realizing solid-state drive based on host memory buffer
CN112416819A
