Memory system, operation method therefor, storage medium and memory controller
By dynamically adjusting the capacity of multi-level mapped tables in the cache in the memory controller, the large-scale random read performance of the memory system is improved, and the problem of low cache hit rate of the mapped table is solved, and more efficient cache resource utilization is achieved.
Patent Information
- Application Number
- PCT/CN2023/097441
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-05
AI Technical Summary
When existing memory systems operate at large-scale random read operations, the mapping table cache hit rate is low, resulting in large search time overhead and affecting performance.
The memory controller adjusts the capacity of the multi-level mapping table in the cache, dynamically adjusts the capacity used to store different mapping tables in the cache according to the random read range, improves the cache hit rate of the mapping table, and optimizes the cache resource utilization rate.
It improves the large-scale random read performance of the memory system, reduces the number of map table updates and time overhead, and optimizes the competition for cache resources, improving system performance and efficiency.
Smart Images

Figure CN2023097441_05122024_PF_FP_ABST
Abstract
Description
Memory system and operation method thereof, storage medium, and memory controller Technical Field
[0001] The embodiments of the present disclosure relate to the field of semiconductor technology, and more particularly to a memory system and an operating method thereof, a storage medium, and a memory controller. Background Art
[0002] Memory devices are used to store information in modern information technology. Flash memory, a typical non-volatile semiconductor memory, offers advantages such as high storage density, manageable production costs, suitable programming and erasing speeds, and high retention characteristics, making it a mainstream product in the memory market.
[0003] Memory systems such as solid-state drives (SSDs) used in personal computers and servers, and universal flash storage (UFS) used in mobile phones and various embedded systems, typically use flash memory as their permanent storage medium. Therefore, further improving the data read and write performance of memory systems has become a pressing issue in the industry.
[0004] Summary of the Invention
[0005] Embodiments of the present disclosure provide a memory system and an operating method thereof, a storage medium, and a memory controller.
[0006] In a first aspect, an embodiment of the present disclosure provides a memory system, comprising: at least one non-volatile memory device and a memory controller coupled to the at least one non-volatile memory device; wherein the memory device stores a multi-level mapping table, and the multi-level mapping table is used to implement mapping from logical addresses to physical addresses; the memory controller includes a cache, and the cache stores part of the multi-level mapping table; the memory controller is configured to: perform a random read operation on data stored in the memory device; wherein, in response to a random read range corresponding to the random read operation meeting a preset condition, the capacity of the cache for storing different levels of mapping tables is adjusted.
[0007] In some embodiments, the multi-level mapping table includes a first-level mapping table, a second-level mapping table and a third-level mapping table, the first-level mapping table stores the physical address of the second-level mapping table, the second-level mapping table stores the physical address of the third-level mapping table, the third-level mapping table stores the physical address of the data, and the cache stores all of the first-level mapping table, part of the second-level mapping table and part of the third-level mapping table.
[0008] In some embodiments, the memory controller is configured to: in response to the random read range being greater than or equal to a preset value, increase the proportion of the capacity of the cache used to store the second-level mapping table in the total capacity used to store the second-level mapping table and the third-level mapping table.
[0009] In some embodiments, the memory controller is configured to: obtain a target mapping table cache hit rate in response to the random read range being greater than or equal to a preset value; detect a current mapping table cache hit rate; and in response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, increase the proportion of the capacity of the cache used to store the second-level mapping table in the total capacity used to store the second-level mapping table and the third-level mapping table until the current mapping table cache hit rate is greater than or equal to the target mapping table cache hit rate.
[0010] In some embodiments, the memory controller is configured to: determine the difference between the current mapping table cache hit rate and the target mapping table cache hit rate; based on the difference, determine the increase in the capacity of the cache used to store the second-level mapping table in this adjustment; wherein the increase is positively correlated with the difference.
[0011] In some embodiments, the memory controller is configured to: in response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, and the proportion of the capacity currently used to store the second-level mapping table in the cache in the total capacity used to store the second-level mapping table and the third-level mapping table reaches a preset proportion, stop adjusting the capacity of the cache used to store different levels of mapping tables.
[0012] In some embodiments, the memory controller is configured to determine a cache hit rate of the target mapping table based on the random read range.
[0013] In some embodiments, the memory controller is configured to: in response to the random read range being smaller than the preset value, keep unchanged the capacity of the cache for storing the second-level mapping table and the capacity for storing the third-level mapping table.
[0014] In some embodiments, the memory controller is configured to determine the preset value according to the current capacity of the cache for storing the second-level mapping table and in combination with mapping rules between mapping tables at various levels.
[0015] In some embodiments, the memory controller is configured to: in response to the random read range being greater than or equal to a preset value, increase a total capacity of the cache for storing the second-level mapping table and the third-level mapping table.
[0016] In some embodiments, the multi-level mapping table includes a first-level mapping table and a second-level mapping table, the first-level mapping table stores the physical address of the second-level mapping table, the second-level mapping table stores the physical address of data, and the cache stores part of the first-level mapping table and part of the second-level mapping table; the memory controller is configured to: in response to the random read range being greater than or equal to a preset value, increase the proportion of the capacity of the cache used to store the first-level mapping table in the total capacity used to store the first-level mapping table and the second-level mapping table.
[0017] In some embodiments, the memory system comprises a DRAM-less memory system, and the cache comprises a static random access memory.
[0018] In some embodiments, the memory system includes: universal flash storage, and the memory device includes a NAND type memory.
[0019] In a second aspect, an embodiment of the present disclosure provides an operating method for a memory system, wherein the memory system comprises: at least one non-volatile memory device and a memory controller coupled to the at least one non-volatile memory device; wherein the memory device stores a multi-level mapping table, and the multi-level mapping table is used to implement mapping from logical addresses to physical addresses; the memory controller comprises a cache, and the cache stores part of the multi-level mapping table; the operating method comprises: performing a random read operation on data stored in the memory device; wherein, in response to a random read range corresponding to the random read operation satisfying a preset condition, adjusting the capacity of the cache for storing different levels of mapping tables.
[0020] In some embodiments, the multi-level mapping table includes a first-level mapping table, a second-level mapping table and a third-level mapping table, the first-level mapping table stores the physical address of the second-level mapping table, the second-level mapping table stores the physical address of the third-level mapping table, the third-level mapping table stores the physical address of the data, and the cache stores all of the first-level mapping table, part of the second-level mapping table and part of the third-level mapping table; in response to the random read range corresponding to the random read operation meeting a preset condition, adjusting the capacity of the cache for storing different levels of mapping tables, including: in response to the random read range being greater than or equal to a preset value, increasing the proportion of the capacity of the cache for storing the second-level mapping table in the total capacity for storing the second-level mapping table and the third-level mapping table.
[0021] In some embodiments, in response to the random read range being greater than or equal to a preset value, the proportion of the capacity of the cache used to store the second-level mapping table in the total capacity used to store the second-level mapping table and the third-level mapping table is increased, specifically including: in response to the random read range being greater than or equal to the preset value, obtaining the target mapping table cache hit rate; detecting the current mapping table cache hit rate; in response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, increasing the proportion of the capacity of the cache used to store the second-level mapping table in the total capacity used to store the second-level mapping table and the third-level mapping table until the current mapping table cache hit rate is greater than or equal to the target mapping table cache hit rate.
[0022] In some embodiments, the method further includes: determining the difference between the current mapping table cache hit rate and the target mapping table cache hit rate; based on the difference, determining the increase in the capacity of the cache used to store the second-level mapping table in this adjustment; wherein the increase is positively correlated with the difference.
[0023] In some embodiments, the method further includes: in response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, and the proportion of the capacity currently used to store the second-level mapping table in the cache to the total capacity used to store the second-level mapping table and the third-level mapping table reaches a preset proportion, stopping adjusting the capacity in the cache used to store different levels of mapping tables.
[0024] In a third aspect, an embodiment of the present disclosure provides a storage medium having executable instructions stored thereon. When the executable instructions are executed by a processor, the steps of the method described in any one of the above embodiments are implemented.
[0025] In a fourth aspect, an embodiment of the present disclosure provides a memory controller comprising: a cache and a control unit, wherein the cache is configured to: store a multi-level mapping table of part of a non-volatile memory device; the multi-level mapping table is configured to implement mapping of logical addresses to physical addresses; the control unit is configured to: perform a random read operation on data stored in the memory device; wherein, in response to a random read range corresponding to the random read operation satisfying a preset condition, the capacity of the cache for storing different levels of mapping tables is adjusted.
[0026] In some embodiments, the memory controller further includes: a flash translation layer connecting the control unit and the cache; the flash translation layer is configured to convert the logical address into a corresponding physical address based on mapping information in the multi-level mapping table stored in the cache.
[0027] In some embodiments, the control unit is further configured to: receive instructions from the host to perform read, write, and erase operations on the memory device; the cache is further configured to temporarily store data transferred between the host and the memory device; the memory controller further includes: an encoder / decoder for encoding and decoding data transferred between the host and the memory device.
[0028] An embodiment of the present disclosure also provides another memory system, which includes: at least one non-volatile memory device and a memory controller coupled to the at least one non-volatile memory device; wherein the memory device stores a multi-level mapping table, and the multi-level mapping table is used to implement mapping from logical addresses to physical addresses; the memory controller includes a cache, and the cache stores part of the multi-level mapping table; the memory controller is configured to: perform a random read operation on data stored in the memory device; wherein, in response to a random read range corresponding to the random read operation meeting a preset condition, adjust the value of different levels of mapping tables loaded from the memory device to the cache at one time.
[0029] In the memory system provided by the embodiment of the present disclosure, a memory device stores multiple levels of mapping tables, and a cache of a memory controller is used to load part of the multiple levels of mapping tables. When the random read range of the memory controller satisfies a preset condition, the memory controller adjusts the capacity of the cache used to store mapping tables of different levels. In this way, on the one hand, when performing a large-scale random read operation, the memory controller can increase the capacity of the cache used to store at least one level of mapping tables to improve the mapping table cache hit rate, thereby reducing the number of times the mapping table is updated from the memory device to the cache, reducing the time overhead of searching the corresponding mapping table, and improving the performance of the memory system's large-scale random read; on the other hand, dynamically adjusting the capacity of the cache used to store mapping tables of different levels can improve cache utilization, have less impact on other task scheduling, and reduce problems such as cache resource competition. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] FIG1 is a schematic diagram of an exemplary system having a memory device according to an embodiment of the present disclosure;
[0031] FIG2a is a schematic diagram of a memory card provided in an embodiment of the present disclosure;
[0032] FIG2 b is a schematic diagram of an SSD provided by an embodiment of the present disclosure;
[0033] FIG3 is a schematic diagram of a memory system provided by an embodiment of the present disclosure;
[0034] FIG4 is a schematic diagram of a multi-level mapping table provided in an embodiment of the present disclosure;
[0035] FIG5 is a schematic diagram of mapping tables of various levels loaded into a cache according to an embodiment of the present disclosure;
[0036] FIG6 is a schematic diagram of another memory system provided by an embodiment of the present disclosure;
[0037] FIG7 is a flowchart of the steps of adjusting the capacity of mapping tables at various levels in a cache by a memory controller according to an embodiment of the present disclosure;
[0038] FIG8 is a schematic diagram of a negative feedback dynamic adjustment mechanism for a mapping table cache hit rate provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0039] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the specific embodiments described herein. Instead, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0040] In the following description, numerous specific details are provided to provide a more thorough understanding of the present disclosure. However, it will be apparent to those skilled in the art that the present disclosure can be practiced without one or more of these details. In other instances, certain technical features known in the art are not described to avoid confusion with the present disclosure; that is, all features of actual embodiments are not described herein, nor are well-known functions and structures described in detail.
[0041] In the drawings, the sizes of layers, regions, elements and their relative sizes may be exaggerated for clarity. Like reference numerals denote like elements throughout.
[0042] It should be understood that when an element or layer is referred to as being "on, adjacent to, connected to, or coupled to" another element or layer, it may be directly on, adjacent to, connected to, or coupled to the other element or layer, or there may be intervening elements or layers. In contrast, when an element is referred to as being "directly on, directly adjacent to, directly connected to, or directly coupled to" another element or layer, there may be no intervening elements or layers. It should be understood that although the terms first, second, third, etc. may be used to describe various elements, components, regions, layers, and / or parts, these elements, components, regions, layers, and / or parts should not be limited by these terms. These terms are merely used to distinguish one element, component, region, layer, or part from another element, component, region, layer, or part. Therefore, without departing from the teachings of the present disclosure, the first element, component, region, layer, or part discussed below may be represented as a second element, component, region, layer, or part. However, when the second element, component, region, layer, or part is discussed, it does not necessarily mean that the first element, component, region, layer, or part exists in the present disclosure.
[0043] Spatially relative terms such as "under," "beneath," "below," "under," "above," "above," etc., may be used herein for convenience of description to describe the relationship of an element or feature shown in the figures to other elements or features. It should be understood that in addition to the orientations shown in the figures, the spatially relative terms are intended to include different orientations of the device in use and operation. For example, if the device in the drawings is flipped, then the elements or features described as "under the other elements" or "under it" or "under it" will be oriented as "on" the other elements or features. Thus, the exemplary terms "under" and "under" may include both upper and lower orientations. The device may be oriented otherwise (rotated 90 degrees or in other orientations) and the spatial descriptors used herein are interpreted accordingly.
[0044] The purpose of the terms used herein is only to describe specific embodiments and is not intended to limit the present disclosure. When used herein, the singular forms "a", "an", and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "comprising" and / or "comprising", when used in this specification, determine the presence of the features, integers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.
[0045] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present disclosure, the implementation of the embodiments of the present disclosure is described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference only and are not intended to limit the embodiments of the present disclosure.
[0046] The memory device in the embodiments of the present disclosure includes but is not limited to a three-dimensional NAND memory. For ease of understanding, the three-dimensional NAND memory is used as an example for description.
[0047] FIG1 shows a block diagram of an exemplary system 100 with a memory device according to some aspects of the present disclosure. System 100 can be a mobile phone, a desktop computer, a laptop computer, a tablet computer, a vehicle computer, a game console, a printer, a positioning device, a wearable electronic device, a smart sensor, a virtual reality (VR) device, an augmented reality (AR) device, or any other suitable electronic device having storage therein. As shown in FIG1 , system 100 can include a host 108 and a memory system 102, and memory system 102 has one or more memory devices 104 and a memory controller 106. Host 108 can be a processor (e.g., a central processing unit (CPU)) or a system on chip (SoC) (e.g., an application processor (AP)) of an electronic device. Host 108 can be configured to send data to or receive data from memory device 104.
[0048] According to some embodiments, the memory controller 106 is coupled to the memory device 104 and the host 108 and is configured to control the memory device 104. The memory controller 106 can manage data stored in the memory device 104 and communicate with the host 108. In some embodiments, the memory controller 106 is designed to operate in a low duty cycle environment, such as a secure digital (SD) card, a compact flash (CF) card, a universal serial bus (USB) flash drive, or other media used in electronic devices such as personal computers, digital cameras, mobile phones, etc. In some embodiments, the memory controller 106 is designed to operate in a high duty cycle environment, such as a solid state drive or an embedded multimedia card (eMMC), which is used as data storage for mobile devices such as smartphones, tablets, laptops, etc., as well as enterprise storage arrays.
[0049] The memory controller 106 can be configured to control the operation of the memory device 104, such as read, erase, and program operations. The memory controller 106 can also be configured to manage various functions related to data stored or to be stored in the memory device 104, including but not limited to bad block management, garbage collection, logical to physical address translation, wear leveling, etc. In some embodiments, the memory controller 106 is also configured to process error correction code (ECC) on data read from or written to the memory device 104. The memory controller 106 can also perform any other suitable functions, such as formatting the memory device 104. The memory controller 106 can communicate with a host (e.g., host 108) according to a specific communication protocol. For example, the memory controller 106 can communicate with the host through at least one of various interface protocols, such as USB protocol, MMC protocol, Peripheral Component Interconnect (PCI) protocol, PCI Express (PCI-E) protocol, Advanced Technology Attachment (ATA) protocol, Serial ATA protocol, Parallel ATA protocol, Small Computer Mini Interface (SCSI) protocol, Enhanced MiniDisk Interface (ESDI) protocol, Integrated Drive Electronics (IDE) protocol, Firewire protocol, etc.
[0050] The memory controller 106 and one or more memory devices 104 can be integrated into various types of storage devices, for example, included in the same package (e.g., universal flash memory package or eMMC package). That is, the memory system 102 can be implemented and packaged into different types of end-use electronic products. In one example, as shown in FIG2a, the memory controller 106 and a single memory device 104 can be integrated into a memory card 202. The memory card 202 can include a PC card (PCMCIA, Personal Computer Memory Card International Association), a CF card, a Smart Media (SM) card, a memory stick, a multimedia card (MMC, RS-MMC, MMCmicro), an SD card (SD, miniSD, microSD, SDHC), a UFS card, etc. The memory card 202 can also include a memory card connector 204 that couples the memory card 202 to a host (e.g., the host 108 in FIG1 ). In another example, as shown in FIG2b, the memory controller 106 and multiple memory devices 104 can be integrated into an SSD 206. SSD 206 may also include an SSD connector 208 that couples SSD 206 to a host (eg, host 108 in FIG. 1 ). In some implementations, SSD 206 has a greater storage capacity and / or operating speed than memory card 202.
[0051] In some embodiments, as shown in FIG3 , a memory system 300 uses a non-volatile memory device 310 (e.g., a NAND memory) to store user data and a logical-to-physical address mapping table (L2P mapping table) corresponding to the user data. When reading data, a portion of the L2P mapping table is loaded into a cache 321 of a memory controller 320. The memory controller 320 uses the logical address provided by the host 400 and the portion of the L2P mapping table loaded in the cache 321 to search for a physical address in the memory device 310. The memory controller 320 then uses the searched physical address to read the corresponding data from the memory device 310. By way of example, the cache 321 in the memory controller 320 includes, but is not limited to, static random access memory (SRAM), dynamic random access memory (DRAM), and the like.
[0052] Several methods can be used to store and maintain the L2P mapping table. One method is single-level direct L2P mapping, which can contain mapping information for data in the entire memory device. Therefore, the single-level direct page mapping scheme requires a large amount of storage space (on the order of 1-2MB of L2P mapping table for 1GB of data) to store the L2P mapping table, which is challenging for large-capacity memory devices. Another method for storing and maintaining the L2P mapping table is a multi-level mapping scheme. Here, a three-level mapping scheme is used as an example. As shown in Figure 4, the first-level mapping table stores the physical address of the second-level mapping table, and each mapping in the first-level mapping table points to a second-level mapping table; the second-level mapping table stores the physical address of the third-level mapping table, and each mapping in the second-level mapping table points to a third-level mapping table; the third-level mapping table stores the physical address of the data (such as physical block number, physical page number, etc.), and each mapping in the third-level mapping table points to a physical block (Block) or physical page (Page) in the memory device. For example, for a memory device with a data storage capacity of 128G, the size of the corresponding third-level mapping table is 128M, the size of the corresponding second-level mapping table is 128K, and the size of the corresponding first-level mapping table is 128Byte.
[0053] The Flash Translation Layer (FTL) 322 may be located in the memory controller 320 and is used to convert logical addresses into physical addresses. Due to the limited capacity of the cache 321 in the memory controller 320, in a multi-level mapping scheme, it is impossible to load all multi-level mapping tables into the cache 321. Therefore, the first-level mapping table may be loaded into the cache 321 in its entirety, i.e., the first-level mapping table resides in the cache 321, while the second-level mapping table and the third-level mapping table may be partially loaded into the cache 321. It is understood that if the Flash Translation Layer 322 cannot obtain the mapping information required for data reading from the current cache 321, it is necessary to update the second-level mapping table and / or the third-level mapping table stored in the cache 321, i.e., reload part of the second-level mapping table and / or part of the third-level mapping table from the memory device 310 into the cache 321 until the required mapping information is found. It is worth noting that for sequential reads, the mapping information is continuous, so the multi-level mapping scheme has better sequential read performance. However, for random reads, the mapping information is dispersed. This may require multiple additional read operations from memory device 310 to update the second-level mapping table and / or third-level mapping table in cache 321 in order to find the mapping information required for random reads. Therefore, the random read performance of the multi-level mapping scheme is relatively poor. Here, the read latency of cache 321 can be on the order of a few microseconds, while the read latency of memory device 310 can be even higher, for example, tens of microseconds.
[0054] In some embodiments, the memory system 300 may be a DRAM-less memory system, i.e., it does not include DRAM. For example, the memory system 300 may be a UFS, and the cache 321 in the memory system 300 may be an SRAM. A fixed capacity in the SRAM may be statically allocated to store a multi-level mapping table, while the remaining SRAM capacity is used as cache space for other task scheduling by the firmware (FW). The firmware may be stored in the storage medium of the memory device 310 and may be executed by the control unit 323 (e.g., a processor) in the memory controller 320.
[0055] Taking a memory device with a data storage capacity of 128GB as an example, as shown in FIG5 , the total capacity of the SRAM in the memory controller can be 2MB. The SRAM can store a 128-byte first-level mapping table (i.e., all first-level mapping tables in the memory device), an 8KB second-level mapping table, and a 256KB third-level mapping table. This ensures that random read operations within the 8GB range do not update the second-level mapping table stored in the SRAM. To ensure that random read operations within the 1GB range do not update the third-level mapping table stored in the SRAM, that is, to achieve a 100% mapping table cache hit rate, the capacity of the SRAM used to store the third-level mapping table can be increased from 256KB to 1024KB. However, with the SRAM capacity used to store the second-level mapping table and the third-level mapping table being 8KB and 1024KB, respectively, large-scale random read operations will result in additional table lookups, severely degrading the performance of large-scale random reads. Taking 1000 random reads within a 128GB range (i.e., full-disk random reads) as an example, as shown in Table 1, the ratio of random read commands, additional reads for loading the second-level mapping table, and additional reads for loading the third-level mapping table is almost 1:1:1. 1000 random read commands will result in a total of 2931 reads, and these extra 1931 reads will seriously affect the performance of the memory system.
[0056] It is understandable that the cache space of the memory controller is limited. For large-scale random reads, if the cache space of the third-level mapping table is continued to be increased, the efficiency of the firmware in performing other tasks will be reduced; if the cache space of the second-level mapping table and the third-level mapping table is not increased, the number of additional reads of the loaded mapping table will increase, and the random read time overhead will increase, resulting in poor random read performance.
[0057] Table 1
[0058] 3 , an embodiment of the present disclosure provides a memory system 300, comprising: at least one non-volatile memory device 310 and a memory controller 320 coupled to the at least one non-volatile memory device 310; wherein the memory device 310 stores a multi-level mapping table, and the multi-level mapping table is used to implement mapping from logical addresses to physical addresses; the memory controller 320 includes a cache 321, and the cache 321 stores a portion of the multi-level mapping table; the memory controller 320 is configured to: perform a random read operation on the data stored in the memory device 310; wherein, in response to the random read range corresponding to the random read operation satisfying a preset condition, the capacity of the cache 321 for storing different levels of mapping tables is adjusted.
[0059] In an embodiment of the present disclosure, a memory controller 320 may be connected to at least one memory device 310. The memory controller 320 communicates with the host 400 via a host interface 301. The host 400 may send commands and / or data via the host interface 301 to request the memory controller 320 to perform read, program, and erase operations on the memory device 310. The memory controller 320 may be configured to retrieve data from one or more memory devices 310 and send the data to the host 400 via a data bus. The memory device 310 may include one or more NAND flash memory cell arrays, and the storage medium of the memory device 310 may store executable instructions, such as the firmware in the above-mentioned embodiment. The memory controller 320 may include one or more caches 321. The cache 321 may be a high-speed cache (such as SRAM). The cache 321 may be used to store any suitable information, including L2P mapping tables, software code, commands, and firmware, to facilitate the memory controller 320 to quickly execute various commands and operations. In some embodiments, as shown in FIG6 , the memory device 310 may be a flash memory and the cache 321 may be an SRAM. The memory controller 320 includes a processor, which is connected to the host 400 via a host interface and to the memory device 310 via a flash memory interface. The processor is also connected to the cache 321 and can obtain L2P mapping information from the cache 321.
[0060] The memory device 310 stores a multi-level L2P mapping table that maps logical addresses to physical addresses corresponding to data stored in the memory device 310. When reading data, a portion of the multi-level mapping table is loaded from the memory device 310 into the cache 321. The memory controller 320 uses the logical address provided by the host 400 and the portion of the L2P mapping table loaded from the cache 321 to search for a physical address in the memory device 310. The memory controller then uses the searched physical address to read the corresponding data from the memory device 310.
[0061] Exemplarily, the memory controller 320 is configured to perform a random read operation on data stored in the memory device 310 in response to a read command from the host 400. The memory controller 320 detects a random read range using firmware stored in the memory device 310. If the random read range satisfies a preset condition (e.g., the random read range is greater than a certain value), the memory controller 320 adjusts the capacity of the cache 321 for storing mapping tables at each level.
[0062] Taking the three-level mapping scheme as an example, the capacity of the second-level mapping table can be increased and the capacity of the third-level mapping table can be reduced (adjusting the ratio of the capacity of the second-level mapping table to the third-level mapping table) while maintaining the total capacity of the second-level mapping table and the third-level mapping table. Alternatively, the capacity of the second-level mapping table and the third-level mapping table can be increased simultaneously, or the capacity of one of the second-level mapping table and the third-level mapping table can be increased (increasing the total capacity of the second-level mapping table and the third-level mapping table). If the random read range does not meet the preset conditions, the memory controller 320 does not adjust the capacity of the cache 321 used to store the mapping tables at each level.
[0063] The memory controller 320 sends a mapping table load instruction to receive the adjusted multi-level mapping table of the corresponding capacity from the memory device 310 and load it into the cache 321. The load instruction here can include the adjusted capacity information of each level of the mapping table. The larger the capacity of the cache 321 for storing each level of the mapping table, the more mapping information can be obtained from the memory device 310 in a single load. The memory controller 320 can then search for the corresponding physical address of the memory device 310 based on the logical address provided by the host 400 and the portion of the multi-level mapping table loaded in the cache 321, and then use the searched physical address to read the corresponding data in the memory device 310.
[0064] It should be noted that embodiments of the present disclosure may also include mapping schemes with more than three levels, such as mapping schemes with four or more levels, without limitation. It is understood that when a memory system includes a mapping scheme with more than four levels, the specific adjustment targets need to be adjusted accordingly based on actual conditions. For example, when a memory system includes four levels, the capacities of the second-level mapping table, the third-level mapping table, and the fourth-level mapping table may be adjusted, and the capacities of the third-level mapping table and the fourth-level mapping table may also be adjusted. The specific adjustment scheme may be adjusted based on the mapping strategy.
[0065] In some embodiments, when the random read range is less than a certain value, the memory controller 320 may further reduce the capacity of the cache 321 used to store mapping tables at different levels (e.g., reducing the capacity of the second-level mapping table and / or the third-level mapping table) to allocate additional cache capacity for executing other firmware tasks, thereby improving cache utilization. It is understood that in scenarios such as sequential read operations or random read operations with a relatively small range, the memory controller 320 may not adjust the capacity of the cache 321 used to store mapping tables at all levels.
[0066] In this way, on the one hand, when performing large-scale random read operations, the memory controller 320 can increase the capacity of the cache 321 for storing at least one level of mapping tables (such as increasing the capacity of the second-level mapping table) to improve the mapping table cache hit rate, thereby reducing the number of times the mapping table is updated from the memory device 310 to the cache 321, reducing the time overhead of searching the corresponding mapping table, and improving the large-scale random read performance of the memory system 300; on the other hand, dynamically adjusting the capacity of the cache 321 for storing different levels of mapping tables can improve the utilization rate of the cache 321, have less impact on other task scheduling, and reduce problems such as cache resource competition.
[0067] In some embodiments, the memory system 300 includes a DRAM-less memory system, and the cache 321 includes a static random access memory.
[0068] In the embodiment of the present disclosure, the memory system 300 may not include DRAM, i.e., a DRAM-less memory system. For example, the cache 321 in the memory controller 320 may use SRAM instead of DRAM. SRAM has higher access speed and lower power consumption than DRAM, which helps improve the performance of the memory system 300.
[0069] In some embodiments, the memory system 300 includes general flash memory, and the memory device 310 includes a NAND-type memory.
[0070] In the disclosed embodiment, the memory system 300 may be a UFS, in which the memory device 310 may be a NAND memory. UFS features small size, high performance, and low power consumption, making it suitable for use in embedded and mobile devices. Compared to NOR flash memory, NAND flash memory has higher storage density, a higher number of erasable times, and a lower cost per bit. In some embodiments, the memory system 300 may also be an SSD, SD card, or CF card.
[0071] In some embodiments, the multi-level mapping table includes a first-level mapping table, a second-level mapping table...an N-level mapping table, where N is an integer greater than or equal to three, the physical address of the next-level mapping table is stored in the first-level mapping table, the physical address of the data is stored in the last-level mapping table, and the cache stores at least all of the first M-level mapping tables (M is greater than or equal to 1 and less than N) and a portion of each mapping table in the next NM-level mapping tables. In some specific embodiments, as shown in FIG4 , the multi-level mapping table includes a first-level mapping table, a second-level mapping table, and a third-level mapping table, the first-level mapping table stores the physical address of the second-level mapping table, the second-level mapping table stores the physical address of the third-level mapping table, the third-level mapping table stores the physical address of the data, and the cache stores all of the first-level mapping table, a portion of the second-level mapping table, and a portion of the third-level mapping table.
[0072] In the embodiment of the present disclosure, since the capacity occupied by the first-level mapping table is relatively small (for example, the size of the first-level mapping table corresponding to a memory device with a storage data capacity of 128G is only 128Byte), all the first-level mapping tables in the memory device can be loaded into the cache, while the second-level mapping tables and the third-level mapping tables in the memory device are partially loaded into the cache to reduce problems such as competition for cache resources.
[0073] For ease of understanding, the following multi-level mapping tables are described using the above-mentioned three-level mapping table as an example. In some embodiments, the memory controller 320 is configured to: in response to the random read range being greater than or equal to a preset value, increase the proportion of the capacity of the cache 321 used to store the second-level mapping table in the total capacity used to store the second-level mapping table and the third-level mapping table.
[0074] In the embodiment of the present disclosure, the memory controller 320 may utilize firmware stored in the memory device 310 to detect a random read range, and when the random read range is greater than a preset value, increase the ratio of the capacity used to store the second-level mapping table in the cache 321 relative to the total capacity used to store the second-level mapping table and the third-level mapping table. In other words, the memory controller 320 may not increase the total capacity of the cache 321 used to store the second-level mapping table and the third-level mapping table. Instead, the memory controller 320 may increase the capacity of the second-level mapping table and decrease the capacity of the third-level mapping table while maintaining the total capacity of the second-level mapping table and the third-level mapping table in the cache 321 unchanged.
[0075] For example, as shown in Table 2, taking 1000 random reads within a 128G range (the storage data capacity of the memory device is 128G, i.e., full-disk random reads) as an example, compared to the corresponding embodiment in Table 1, the memory controller reduces the capacity of the third-level mapping table in the cache from 1024K to 904K, and allocates the 120K reduced capacity of the third-level mapping table in the cache to the second-level mapping table, i.e., the capacity of the second-level mapping table in the cache is increased from the original 8K to 128K. In this way, it is ensured that random reads within the 128G range do not update the second-level mapping table loaded in the cache, i.e., the number of reads for additionally loading the second-level mapping table is 0, while the increase in the number of reads for additionally loading the third-level mapping table is not significant. Ultimately, the total number of reads is reduced from 2931 to 1994, significantly improving the random read performance of the memory system.
[0076] Table 2
[0077] In some embodiments, the memory controller 320 is configured to: obtain a target mapping table cache hit rate in response to the random read range being greater than or equal to a preset value; detect the current mapping table cache hit rate; in response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, increase the proportion of the capacity of the cache 321 used to store the second-level mapping table in the total capacity used to store the second-level mapping table and the third-level mapping table, until the current mapping table cache hit rate is greater than or equal to the target mapping table cache hit rate.
[0078] In some embodiments, the memory controller 320 is configured to determine the target mapping table cache hit rate according to the random read range.
[0079] In some embodiments, the memory controller 320 is configured to: in response to the random read range being smaller than the preset value, keep the capacity of the cache 321 for storing the second-level mapping table and the capacity for storing the third-level mapping table unchanged.
[0080] In an embodiment of the present disclosure, referring to FIG7 , the memory controller 320 can detect a random read range using firmware stored in the memory device 310. When the random read range is greater than or equal to a preset value, the memory controller 320 can calculate a target mapping table cache hit rate based on the random read range and through the firmware. The memory controller 320 can detect the current mapping table cache hit rate. If the current mapping table cache hit rate is less than the target mapping table cache hit rate, the memory controller 320 adjusts the capacity of the cache 321 for storing the second-level mapping table and the capacity for storing the third-level mapping table. If the current mapping table cache hit rate is greater than or equal to the target mapping table cache hit rate, the memory controller 320 stops adjusting the capacity of the cache 321 for storing mapping tables of different levels. In addition, if the random read range is less than the preset value, the memory controller 320 can keep the capacity of the cache 321 for storing the second-level mapping table and the third-level mapping table unchanged.
[0081] In this way, memory controller 320 can adjust the capacity of cache 321 for storing the second-level mapping table and the capacity for storing the third-level mapping table multiple times until the current mapping table cache hit rate is greater than or equal to the target mapping table cache hit rate. By dynamically adjusting the capacity of different levels of mapping tables in cache 321 multiple times, the target mapping table cache hit rate can be accurately achieved without exceeding the target mapping table cache hit rate by a large margin, thereby fully utilizing limited cache resources, improving the memory system's large-scale random read performance while reducing cache resource competition.
[0082] In some embodiments, the memory controller 320 is configured to: in response to the random read range being greater than or equal to a preset value, increase a total capacity of the cache 321 for storing the second-level mapping table and the third-level mapping table.
[0083] In an embodiment of the present disclosure, when the random read range is greater than or equal to a preset value, the memory controller 320 adjusts the capacity of the cache 321 for storing the second-level mapping table and the capacity for storing the third-level mapping table, including but not limited to the following methods: one is that the memory controller 320 increases the capacity of the second-level mapping table and reduces the capacity of the third-level mapping table while maintaining the total capacity of the second-level mapping table and the third-level mapping table in the cache 321 unchanged; another is that the memory controller 320 increases the capacity of at least one of the second-level mapping table and the third-level mapping table in the cache 321, so that the total capacity of the second-level mapping table and the third-level mapping table increases. Increasing the total capacity of the cache 321 for storing the second-level mapping table and the third-level mapping table can also be achieved by increasing the capacity of one of the second-level mapping table and the third-level mapping table and reducing the capacity of the other.
[0084] It is understandable that increasing the total capacity of the cache 321 for storing the second-level mapping table and the third-level mapping table can further improve the mapping table cache hit rate, thereby improving the performance of the memory system under a wider range of random reads.
[0085] In some embodiments, the memory controller 320 is configured to: determine the difference between the current mapping table cache hit rate and the target mapping table cache hit rate; based on the difference, determine the increase in the capacity of the cache 321 used to store the second-level mapping table in this adjustment; wherein the increase is positively correlated with the difference.
[0086] In the embodiment of the present disclosure, the memory controller 320 can calculate the target mapping table cache hit rate based on the random read range and using the firmware stored in the memory device 310, thereby calculating the difference between the current mapping table cache hit rate and the target mapping table cache hit rate; then the memory controller 320 can determine the increase in the capacity of the cache 321 used to store the second-level mapping table in this adjustment based on the difference, and the larger the difference, the greater the increase in the capacity of the second-level mapping table in this adjustment; the smaller the difference, the smaller the increase in the capacity of the second-level mapping table in this adjustment.
[0087] In this way, when the difference is large, the increase in this adjustment is large (that is, the single adjustment range is large), thereby reducing the number of adjustments to the multi-level mapping table capacity in cache 321 in order to achieve the target mapping table cache hit rate, speeding up the adjustment of the mapping table cache capacity, and improving the performance of the memory system; when the difference is small, the increase in this adjustment is small, so as to accurately achieve the target mapping table cache hit rate, thereby making full use of limited cache resources.
[0088] In some embodiments, the memory controller 320 is configured to: in response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, and the proportion of the capacity currently used to store the second-level mapping table in the cache 321 in the total capacity used to store the second-level mapping table and the third-level mapping table reaches a preset proportion, stop adjusting the capacity of the cache 321 used to store different levels of mapping tables.
[0089] In an embodiment of the present disclosure, the memory controller 320 may further set a preset ratio, i.e., a threshold value for the ratio of the capacity of the second-level mapping table in the current cache 321 to the total capacity for storing the second-level mapping table and the third-level mapping table. When the cache hit rate of the current mapping table is still lower than the cache hit rate of the target mapping table, but the capacity ratio of the second-level mapping table in the cache 321 reaches the preset ratio, the memory controller 320 may stop adjusting the capacity of the cache 321 for storing mapping tables of different levels. In this way, the capacity of the second-level mapping table in the cache 321 will not be too large, thereby preventing the cache resources required for the third-level mapping table from being squeezed out. The above-mentioned preset ratio may be determined based on the proportional relationship between the capacity of all second-level mapping tables and the capacity of all third-level mapping tables in the memory device 310.
[0090] As shown in Figure 8, the specific implementation method of each embodiment of the present disclosure is a negative feedback dynamic adjustment mechanism based on the current mapping table cache hit rate. The input is the target mapping table cache hit rate Y_In of the second-level mapping table and the third-level mapping table, and the output is the current mapping table cache hit rate Y_out of the second-level mapping table and the third-level mapping table. X represents the comparison node of Y_In and Y_out. On the basis of the current dynamic L2P mapping table cache algorithm, according to the following formula: Y_out = K (Y_In-Y_out), where K is the adjustment coefficient, the current mapping table cache hit rate can be dynamically adjusted to achieve the target mapping table cache hit rate, thereby improving the performance of large-scale random reads of the memory system.
[0091] In some embodiments, the memory controller 320 is configured to determine the preset value according to the current capacity of the cache 321 for storing the second-level mapping table and in combination with mapping rules between mapping tables at various levels.
[0092] In the embodiment of the present disclosure, the memory controller 320 can calculate a preset value corresponding to the random read range using the firmware stored in the memory device 310 and based on the capacity of the current cache 321 for storing the second-level mapping table and the mapping rules between each level of mapping tables. The mapping rules herein may refer to the proportional relationship between the capacity of adjacent level mapping tables and between the data stored in the memory device and the lowest level mapping table.
[0093] For example, using a three-level mapping scheme as an example, the mapping rule may be that the size of the third-level mapping table is 1 / 1024 of the data storage capacity of the corresponding memory device, the size of the second-level mapping table is 1 / 1024 of the size of the corresponding third-level mapping table, and the size of the first-level mapping table is 1 / 1024 of the size of the corresponding second-level mapping table. In other words, if the capacity of cache 321 for storing the second-level mapping table is 8K, then random reads within an 8GB range can be guaranteed not to update the second-level mapping table in cache 321. In other words, the preset value can be set to 8GB. When the random read range exceeds 8GB, additional reads will be generated to reload the second-level mapping table from the memory device. In this case, the capacity of cache 321 for storing multi-level mapping tables needs to be adjusted to improve the random read performance of the memory system.
[0094] In some embodiments, the multi-level mapping table includes a first-level mapping table and a second-level mapping table, the first-level mapping table stores the physical address of the second-level mapping table, the second-level mapping table stores the physical address of the data, and the cache 321 stores part of the first-level mapping table and part of the second-level mapping table; the memory controller 320 is configured to: in response to the random read range being greater than or equal to a preset value, increase the proportion of the capacity of the cache 321 used to store the first-level mapping table in the total capacity used to store the first-level mapping table and the second-level mapping table.
[0095] In the embodiment of the present disclosure, the multi-level mapping table can also be two-level, that is, only including a first-level mapping table and a second-level mapping table. In this way, when the random read range is greater than or equal to a preset value, the memory controller 320 can increase the proportion of the capacity used to store the first-level mapping table in the cache 321 to the total capacity used to store the first-level mapping table and the second-level mapping table to improve the mapping table cache hit rate, thereby reducing the number of times the mapping table is updated from the memory device 310 to the cache 321, reducing the time overhead of searching the corresponding mapping table, and improving the performance of large-scale random reads of the memory system 300.
[0096] 3 , an embodiment of the present disclosure provides a memory controller 320, comprising: a cache 321 and a control unit 323, wherein the cache 321 is configured to: store a portion of a multi-level mapping table in a non-volatile memory device 310; the multi-level mapping table is configured to implement a mapping from a logical address to a physical address; the control unit 323 is configured to: perform a random read operation on data stored in the memory device 310; wherein, in response to a random read range corresponding to the random read operation satisfying a preset condition, the capacity of the cache 321 for storing mapping tables of different levels is adjusted.
[0097] In some embodiments, the memory controller 320 also includes: a flash memory translation layer 322, connecting the control unit 323 and the cache 321; the flash memory translation layer 322 is configured to convert the logical address into a corresponding physical address according to the mapping information in the multi-level mapping table stored in the cache 321.
[0098] In some embodiments, the control unit 323 is further configured to: receive instructions from the host 400 to perform read, write and erase operations on the memory device 310; the cache 321 is further configured to temporarily store data transferred between the host 400 and the memory device 310; the memory controller 320 also includes: an encoder / decoder 324 for encoding and decoding data transferred between the host 400 and the memory device 310.
[0099] In the embodiment of the present disclosure, the memory controller 320 may include a cache 321 , a flash translation layer 322 , a control unit 323 , and an encoder / decoder 324 .
[0100] The memory controller 320 may include one or more caches 321. Caches 321 may be high-speed caches (e.g., SRAM). Caches 321 may be used to store any suitable information, including L2P mapping tables, software code, commands, and firmware, to facilitate rapid execution of various commands and operations by the memory controller 320. A flash translation layer 322 may be implemented using a distribution portion of the memory controller 320 circuitry and control software, and is used to convert logical addresses into physical addresses.
[0101] The control unit 323 can be any suitable integrated circuit (e.g., one or more processors) that is configured to receive instructions from the host 400 via the host interface 301 and to transmit commands and / or data to one or more memory devices 310 via the interface 302 to perform read, program, and erase operations on the memory devices 310. For example, the control unit 323 receives a request from the host 400 to access the flash memory medium. The control unit 323 can also be configured to communicate with and control other components of the memory controller 320. For example, the control unit 323 can instruct the flash translation layer 322 to scan the cache 321 to obtain mapping information, and send / receive address mapping information from the flash translation layer 322. The control unit 323 can also communicate with the encoder / decoder 324 and other suitable components of the memory controller 320.
[0102] The encoder / decoder 324 may provide encoding and decoding for data processed by the memory controller 320. The encoder / decoder 324 may also generate and store error correction codes (ECC) and metadata, which may be used to detect and correct errors in data stored by the memory device.
[0103] In some embodiments, the multi-level mapping table includes a first-level mapping table, a second-level mapping table and a third-level mapping table, the first-level mapping table stores the physical address of the second-level mapping table, the second-level mapping table stores the physical address of the third-level mapping table, the third-level mapping table stores the physical address of the data, and the cache 321 stores all of the first-level mapping tables, part of the second-level mapping tables and part of the third-level mapping tables; the control unit 323 is configured to: when the random read range is greater than or equal to a preset value, increase the proportion of the capacity of the cache 321 used to store the second-level mapping table in the total capacity used to store the second-level mapping table and the third-level mapping table.
[0104] In some embodiments, the control unit 323 is configured to: obtain the target mapping table cache hit rate when the random read range is greater than or equal to a preset value; detect the current mapping table cache hit rate; when the current mapping table cache hit rate is less than the target mapping table cache hit rate, increase the proportion of the capacity used to store the second-level mapping table in the cache 321 in the total capacity used to store the second-level mapping table and the third-level mapping table, until the current mapping table cache hit rate is greater than or equal to the target mapping table cache hit rate.
[0105] In some embodiments, the control unit 323 is configured to: determine the difference between the current mapping table cache hit rate and the target mapping table cache hit rate; based on the difference, determine the increase in the capacity of the cache 321 used to store the second-level mapping table in this adjustment; wherein the increase is positively correlated with the difference.
[0106] In some embodiments, the control unit 323 is configured to: stop adjusting the capacity of the cache 321 for storing different levels of mapping tables when the current mapping table cache hit rate is less than the target mapping table cache hit rate, and when the proportion of the capacity currently used to store the second-level mapping table in the cache 321 in the total capacity used to store the second-level mapping table and the third-level mapping table reaches a preset proportion.
[0107] In some embodiments, the control unit 323 is configured to determine the target mapping table cache hit rate according to the random read range.
[0108] In some embodiments, the control unit 323 is configured to keep the capacity of the cache 321 for storing the second-level mapping table and the capacity of the cache 321 for storing the third-level mapping table unchanged when the random read range is smaller than the preset value.
[0109] In some embodiments, the control unit 323 is configured to determine the preset value according to the current capacity of the cache 321 for storing the second-level mapping table and in combination with mapping rules between mapping tables at various levels.
[0110] In some embodiments, the control unit 323 is configured to increase the total capacity of the cache 321 for storing the second-level mapping table and the third-level mapping table when the random read range is greater than or equal to a preset value.
[0111] 3 , an embodiment of the present disclosure also provides another memory system, wherein the memory system 300 includes: at least one non-volatile memory device 310 and a memory controller 320 coupled to the at least one non-volatile memory device 310; wherein the memory device 310 stores a multi-level mapping table, and the multi-level mapping table is used to implement mapping from logical addresses to physical addresses; the memory controller 320 includes a cache 321, and the cache 321 stores part of the multi-level mapping table; the memory controller 320 is configured to: perform a random read operation on the data stored in the memory device 310; wherein, in response to a random read range corresponding to the random read operation meeting a preset condition, adjust the value of different levels of mapping tables loaded from the memory device 310 to the cache 321 at one time.
[0112] In an embodiment of the present disclosure, the memory controller 320 is configured to issue a mapping table loading instruction and adjust the capacity of different levels of mapping tables loaded from the memory device 310 to the cache 321 at one time when the random read range meets a preset condition (such as the random read range is greater than a certain value). The "one load" here refers to a mapping table reading operation.
[0113] Taking the three-level mapping scheme as an example, the memory controller 320 can increase the proportion of the second-level mapping table's capacity to the total capacity of the second-level and third-level mapping tables during a single mapping table load, without increasing the total capacity of the second-level and third-level mapping tables during a single load. This increases the capacity of cache 321 used to store the second-level mapping table, but the total capacity of cache 321 used to store multiple levels of mapping tables remains unchanged. This improves the mapping table cache hit rate, reduces the number of additional mapping table loads from memory device 310 to cache 321, reduces the time overhead of searching for the corresponding mapping table, and improves the performance of large-scale random reads of the memory system 300. Furthermore, dynamically adjusting the capacity of different levels of mapping tables loaded from memory device 310 to cache 321 at a time can improve cache 321 utilization, minimize the impact on other task scheduling, and reduce cache resource competition and other issues.
[0114] It can be understood that when the random read range of at least one random read operation among multiple random read operations meets the preset conditions, since the memory controller 320 adjusts the values of different levels of mapping tables loaded from the memory device 310 to the cache 321 at one time, the capacity of the second-level mapping table loaded by at least one random read operation is different from the capacity of the second-level mapping table loaded by other random read operations (here it can also be that the capacity of the third-level mapping table loaded by at least one random read operation is different from the other times).
[0115] In some embodiments, the memory controller 320 can load the multi-level mapping table corresponding to the random read operation into the cache 321 within a preset number of reads. That is, it is not limited to loading the multi-level mapping table once to achieve a 100% mapping table cache hit rate, but rather there is no read number for loading the L2P mapping table beyond the preset number of reads. Here, the memory controller 320 can calculate the preset number of reads through firmware based on a target mapping table cache hit rate, and the target mapping table cache hit rate is less than 100%.
[0116] An embodiment of the present disclosure also provides an operating method of a memory system, wherein the memory system includes: at least one non-volatile memory device and a memory controller coupled to the at least one non-volatile memory device; wherein the memory device stores a multi-level mapping table, and the multi-level mapping table is used to implement mapping from logical addresses to physical addresses; the memory controller includes a cache, and the cache stores part of the multi-level mapping table; the operating method includes: performing a random read operation on data stored in the memory device; wherein, in response to a random read range corresponding to the random read operation meeting a preset condition, adjusting the capacity of the cache for storing different levels of mapping tables.
[0117] In some embodiments, the multi-level mapping table includes a first-level mapping table, a second-level mapping table and a third-level mapping table, the first-level mapping table stores the physical address of the second-level mapping table, the second-level mapping table stores the physical address of the third-level mapping table, the third-level mapping table stores the physical address of the data, and the cache stores all of the first-level mapping table, part of the second-level mapping table and part of the third-level mapping table; in response to the random read range corresponding to the random read operation meeting a preset condition, adjusting the capacity of the cache for storing different levels of mapping tables, including: in response to the random read range being greater than or equal to a preset value, increasing the proportion of the capacity of the cache for storing the second-level mapping table in the total capacity for storing the second-level mapping table and the third-level mapping table.
[0118] In some embodiments, in response to the random read range being greater than or equal to a preset value, the proportion of the capacity of the cache used to store the second-level mapping table in the total capacity used to store the second-level mapping table and the third-level mapping table is increased, specifically including: in response to the random read range being greater than or equal to the preset value, obtaining the target mapping table cache hit rate; detecting the current mapping table cache hit rate; in response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, increasing the proportion of the capacity of the cache used to store the second-level mapping table in the total capacity used to store the second-level mapping table and the third-level mapping table until the current mapping table cache hit rate is greater than or equal to the target mapping table cache hit rate.
[0119] Specifically, referring to FIG7 , the operating method of the memory system provided by the present disclosure may include the following steps:
[0120] S101, the firmware detects a random read range of a random read operation;
[0121] S102: Determine whether the random read range is greater than or equal to a preset value. If so, proceed to step S103.
[0122] S103, obtaining a target mapping table cache hit rate;
[0123] S104, detecting the current mapping table cache hit rate, and determining whether the current mapping table cache hit rate is greater than or equal to the target mapping table cache hit rate, if not, executing step S105;
[0124] S105, adjusting the capacity of the cache for storing mapping tables of different levels, and then re-performing step S104;
[0125] The detailed operation method of the memory system can be understood by referring to the specific implementation methods in the above embodiments, which will not be repeated here.
[0126] In some embodiments, the method further includes: determining the difference between the current mapping table cache hit rate and the target mapping table cache hit rate; based on the difference, determining the increase in the capacity of the cache used to store the second-level mapping table in this adjustment; wherein the increase is positively correlated with the difference.
[0127] In some embodiments, the method further includes: in response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, and the proportion of the capacity currently used to store the second-level mapping table in the cache to the total capacity used to store the second-level mapping table and the third-level mapping table reaches a preset proportion, stopping adjusting the capacity in the cache used to store different levels of mapping tables.
[0128] An embodiment of the present disclosure provides a storage medium having executable instructions stored thereon. When the executable instructions are executed by a processor, the steps of the method described in any one of the above embodiments are implemented.
[0129] In the embodiment of the present disclosure, the storage medium may be a NAND flash memory in the memory device 310, and the storage medium may store executable instructions, which may be the firmware in the above embodiment. Thus, the control unit 323 including the processor in the memory controller 320 may execute the executable instructions in the storage medium, thereby implementing the steps in any of the methods in the above embodiment.
[0130] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present disclosure. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present disclosure, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure. The serial numbers of the embodiments of the present disclosure are for description only and do not represent the advantages and disadvantages of the embodiments.
[0131] The above description is only a preferred embodiment of the present disclosure and does not limit the patent scope of the present disclosure. All equivalent structural transformations made by using the contents of the present disclosure and the drawings under the inventive concept of the present disclosure, or direct / indirect application in other related technical fields are included in the patent protection scope of the present disclosure. Industrial Applicability
[0132] In the memory system provided by the embodiment of the present disclosure, a memory device stores multiple levels of mapping tables, and a cache of a memory controller is used to store part of the multiple levels of mapping tables. When the random read range of the memory controller satisfies a preset condition, the memory controller adjusts the capacity of the cache used to store mapping tables of different levels. In this way, on the one hand, when performing a large-scale random read operation, the memory controller can increase the capacity of the cache used to store at least one level of mapping tables to improve the mapping table cache hit rate, thereby reducing the number of times the mapping table is updated from the memory device to the cache, reducing the time overhead of searching the corresponding mapping table, and improving the performance of the memory system's large-scale random read; on the other hand, dynamically adjusting the capacity of the cache used to store mapping tables of different levels can improve cache utilization, have less impact on other task scheduling, and reduce problems such as cache resource competition.
Claims
1. A memory system, comprising: at least one non-volatile memory device and a memory controller coupled to the at least one non-volatile memory device; wherein, The memory device stores a multi-level mapping table, wherein the multi-level mapping table is used to implement mapping from a logical address to a physical address; The memory controller comprises a cache, wherein a portion of the multi-level mapping table is stored in the cache; The memory controller is configured to: A random read operation is performed on the data stored in the memory device; wherein, in response to a random read range corresponding to the random read operation satisfying a preset condition, the capacity of the cache for storing mapping tables of different levels is adjusted.
2. The memory system according to claim 1, wherein: The multi-level mapping table includes a first-level mapping table, a second-level mapping table and a third-level mapping table. The first-level mapping table stores the physical address of the second-level mapping table, the second-level mapping table stores the physical address of the third-level mapping table, the third-level mapping table stores the physical address of data, and the cache stores all of the first-level mapping table, part of the second-level mapping table and part of the third-level mapping table.
3. The memory system according to claim 2, wherein: The memory controller is configured to: In response to the random read range being greater than or equal to a preset value, increasing a proportion of a capacity in the cache for storing the second-level mapping table in a total capacity for storing the second-level mapping table and the third-level mapping table.
4. The memory system according to claim 3, wherein: The memory controller is configured to: In response to the random read range being greater than or equal to a preset value, obtaining a target mapping table cache hit rate; Detect the current mapping table cache hit rate; In response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, increasing the proportion of the capacity of the cache used to store the second-level mapping table in the total capacity used to store the second-level mapping table and the third-level mapping table until the current mapping table cache hit rate is greater than or equal to the target mapping table cache hit rate.
5. The memory system according to claim 4, wherein: The memory controller is configured to: Determine a difference between a current mapping table cache hit rate and a target mapping table cache hit rate; According to the difference, an increase in the capacity of the cache for storing the second-level mapping table in this adjustment is determined; wherein the increase is positively correlated with the difference.
6. The memory system according to claim 4, wherein: The memory controller is configured to: In response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, and the proportion of the capacity currently used to store the second-level mapping table in the cache in the total capacity used to store the second-level mapping table and the third-level mapping table reaches a preset proportion, stop adjusting the capacity of the cache used to store mapping tables of different levels.
7. The memory system according to claim 4, wherein: The memory controller is configured to: The target mapping table cache hit rate is determined according to the random read range.
8. The memory system according to claim 3, wherein: The memory controller is configured to: In response to the random read range being smaller than the preset value, the capacity of the cache for storing the second-level mapping table and the capacity of the cache for storing the third-level mapping table are kept unchanged.
9. The memory system according to claim 3, wherein: The memory controller is configured to: The preset value is determined according to the capacity of the current cache for storing the second-level mapping table and in combination with the mapping rules between the mapping tables at each level.
10. The memory system according to claim 2, wherein: The memory controller is configured to: In response to the random read range being greater than or equal to a preset value, increasing a total capacity of the cache for storing the second-level mapping table and the third-level mapping table.
11. The memory system according to claim 1, wherein: The multi-level mapping table includes a first-level mapping table and a second-level mapping table, the first-level mapping table stores a physical address of the second-level mapping table, the second-level mapping table stores a physical address of data, and the cache stores part of the first-level mapping table and part of the second-level mapping table; The memory controller is configured to: In response to the random read range being greater than or equal to a preset value, increasing a proportion of a capacity in the cache for storing the first-level mapping table in a total capacity for storing the first-level mapping table and the second-level mapping table.
12. The memory system according to claim 1, wherein: The memory system comprises a DRAM-less memory system, and the cache comprises a static random access memory.
13. The memory system according to claim 1, wherein: The memory system comprises universal flash storage, and the memory device comprises a NAND type memory.
14. A method for operating a memory system, wherein: The memory system comprises: at least one non-volatile memory device and a memory controller coupled to the at least one non-volatile memory device; a multi-level mapping table is stored in the memory device, and the multi-level mapping table is used to implement the mapping from the logical address to the physical address; the memory controller comprises a cache, and the cache stores part of the multi-level mapping table; the operation method comprises: A random read operation is performed on the data stored in the memory device; wherein, in response to a random read range corresponding to the random read operation satisfying a preset condition, the capacity of the cache for storing mapping tables of different levels is adjusted.
15. The operating method according to claim 14, wherein: The multi-level mapping table includes a first-level mapping table, a second-level mapping table and a third-level mapping table, the first-level mapping table stores a physical address of the second-level mapping table, the second-level mapping table stores a physical address of the third-level mapping table, the third-level mapping table stores a physical address of data, and the cache stores all of the first-level mapping table, part of the second-level mapping table and part of the third-level mapping table; In response to the random read range corresponding to the random read operation satisfying a preset condition, adjusting the capacity of the cache for storing mapping tables of different levels, comprises: In response to the random read range being greater than or equal to a preset value, increasing a proportion of a capacity in the cache for storing the second-level mapping table in a total capacity for storing the second-level mapping table and the third-level mapping table.
16. The operating method according to claim 15, wherein: In response to the random read range being greater than or equal to a preset value, increasing the proportion of the capacity of the cache for storing the second-level mapping table in the total capacity for storing the second-level mapping table and the third-level mapping table, specifically includes: In response to the random read range being greater than or equal to a preset value, obtaining a target mapping table cache hit rate; Detect the current mapping table cache hit rate; In response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, increasing the proportion of the capacity of the cache used to store the second-level mapping table in the total capacity used to store the second-level mapping table and the third-level mapping table until the current mapping table cache hit rate is greater than or equal to the target mapping table cache hit rate.
17. The operating method according to claim 16, further comprising: Determine a difference between a current mapping table cache hit rate and a target mapping table cache hit rate; According to the difference, an increase in the capacity of the cache for storing the second-level mapping table in this adjustment is determined; wherein the increase is positively correlated with the difference.
18. The operating method according to claim 16, further comprising: In response to the current mapping table cache hit rate being less than the target mapping table cache hit rate, and when the proportion of the capacity currently used to store the second-level mapping table in the cache in the total capacity used to store the second-level mapping table and the third-level mapping table reaches a preset proportion, stop adjusting the capacity of the cache used to store mapping tables of different levels.
19. A storage medium, wherein: The storage medium stores executable instructions, and when the executable instructions are executed by the processor, the steps of the method described in any one of claims 14 to 18 are implemented.
20. A memory controller comprising: Cache and control section, where The cache is configured to: store a multi-level mapping table of a portion of a non-volatile memory device; the multi-level mapping table is configured to implement mapping from a logical address to a physical address; The control unit is configured to: perform a random read operation on the data stored in the memory device; wherein, in response to a random read range corresponding to the random read operation satisfying a preset condition, adjust the capacity of the cache for storing mapping tables of different levels.
21. The memory controller of claim 20, further comprising: A flash conversion layer, connecting the control unit and the cache; The flash translation layer is configured to translate the logical address into a corresponding physical address according to mapping information in the multi-level mapping table stored in the cache.
22. The memory controller according to claim 20, wherein: The control unit is further configured to: receive instructions from a host to perform read, write and erase operations on the memory device; The cache is further configured to temporarily store data transferred between the host and the memory device; The memory controller further includes: An encoder / decoder is used for encoding and decoding data transmitted between the host and the memory device.
23. A memory system comprising: at least one non-volatile memory device and a memory controller coupled to the at least one non-volatile memory device; wherein, The memory device stores a multi-level mapping table, wherein the multi-level mapping table is used to implement mapping from a logical address to a physical address; The memory controller comprises a cache, wherein a portion of the multi-level mapping table is stored in the cache; The memory controller is configured to: A random read operation is performed on the data stored in the memory device; wherein, in response to a random read range corresponding to the random read operation satisfying a preset condition, the amount of different levels of mapping tables loaded from the memory device to the cache at one time is adjusted.
Citation Information
Patent Citations
Optimized flash memory address mapping method
CN104268094A
Memory system and operating method thereof
CN111324552A
Mapping table management method and system executed in computing device
CN113297099A
Address mapping table processing method and device and storage equipment
CN115185858A
Method for managing mapping table of SSD device
KR1020120037218A
