Planar programming method and flash memory device thereof
By calculating the IO pressure of the flash memory device in real time and dynamically adjusting the programming mode, the problem of reduced write bandwidth caused by single-plane programming is solved, and the overall performance and service quality of the flash memory device are improved.
Patent Information
- Application Number
- CN202111670976.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In non-bandwidth business scenarios of existing flash memory devices, single-plane programming reduces write bandwidth and cannot effectively improve read latency and service quality.
By calculating the IO pressure of flash memory devices in real time, the programming mode is dynamically adjusted, and the appropriate programming granularity is selected to optimize IO processing, ensuring that IO latency and service quality are improved without affecting read and write bandwidth.
It is possible to improve the overall performance of flash memory devices without affecting read and write bandwidth, especially IO latency and service quality in non-bandwidth business scenarios.
Smart Images

Figure CN114296656B
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage device applications, and in particular to a planar programming method and a flash memory device thereof. Background Art
[0002] Flash memory devices, such as solid state drives (SSDs), are hard disks made using solid-state electronic storage chip arrays. SSDs include a control unit and a storage unit (FLASH storage chip or DRAM storage chip).
[0003] In order to improve command concurrency, NAND Flash supports multi-plane programming. Multi-plane programming can improve programming efficiency and ultimately increase write bandwidth. Many solid-state drives use multi-plane programming. However, in many non-bandwidth business scenarios, write bandwidth is not high. Business scenarios are more concerned about other performance indicators, such as read latency and quality of service (QoS), especially read IO QoS. In a mixed read-write IO model with low queue depth, multi-plane programming does not help QoS much. Instead, single-plane programming is more friendly to QoS. The reason is that single-plane programming takes less time for the Nand Flash bus and the read IO is delayed less time. However, multi-plane programming has a higher write bandwidth. If single-plane programming is used, the write bandwidth will be reduced.
[0004] Based on this, the existing technology needs to be improved urgently. Summary of the invention
[0005] The embodiment of the present application provides a planar programming method and a flash memory device thereof, which solves the problem of insufficient overall performance of the flash memory device caused by using a single programming mode, and improves the IO delay and service quality of non-bandwidth services without affecting the read and write bandwidth, thereby improving the overall performance of the flash memory device.
[0006] To solve the above technical problems, the present application provides the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a planar programming method, which is applied to a flash memory device, and the method includes:
[0008] Calculate the IO pressure of flash memory devices in real time;
[0009] According to the IO pressure of the flash memory device, the programming mode of the flash memory device is dynamically adjusted, wherein each programming mode corresponds to a programming granularity.
[0010] In some embodiments, dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device includes:
[0011] Determine whether the IO pressure of the flash memory device is greater than a first IO pressure threshold;
[0012] If yes, adjusting the programming mode of the flash memory device to a first plane programming mode, wherein the programming granularity of the first plane programming mode is greater than a first granularity threshold;
[0013] If not, the programming mode of the flash memory device is adjusted to a second plane programming mode, wherein the programming granularity of the second plane programming mode is less than or equal to the first granularity threshold.
[0014] In some embodiments, dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device includes:
[0015] Test the maximum IO bandwidth of the flash memory device in each programming mode.
[0016] According to the IO pressure of the flash memory device and the maximum IO bandwidth corresponding to each programming mode, the programming mode of the flash memory device is dynamically adjusted.
[0017] In some embodiments, according to the IO pressure of the flash memory device and in combination with the maximum IO bandwidth corresponding to each programming mode, the programming mode of the flash memory device is dynamically adjusted, including:
[0018] According to the maximum IO bandwidth corresponding to each programming mode, determine the bandwidth range corresponding to each programming mode;
[0019] If the IO pressure of the flash memory device is within a bandwidth range corresponding to a certain programming mode, the programming mode is determined as the programming mode of the flash memory device, wherein the IO pressure of the flash memory device is less than the maximum IO bandwidth of the determined programming mode.
[0020] In some embodiments, the method further comprises:
[0021] After receiving the IO request, the IO request is processed based on the programming mode.
[0022] In some embodiments, based on the programming mode, processing the IO request includes:
[0023] Setting state variables, wherein the state variables include a first state variable, a second state variable and a third state variable, the first state variable represents the number of the currently executed step, the second state variable represents the number of remaining steps, and the third state variable is used to represent the programming mode;
[0024] According to the programming mode, the state variables are adjusted to handle the IO requests.
[0025] In some embodiments, the IO request includes a write IO request, and adjusting the state variable according to the programming mode to process the IO request includes:
[0026] Obtaining the number of planes of the flash memory device and determining a programming mode of the flash memory device, wherein the number of planes of the flash memory device is not less than four;
[0027] In a first stage, according to a programming mode of the flash memory device, a value of a first state variable and a value of a second state variable are determined, and a write is scheduled to hardware to perform programming of a first number of planes, wherein the first number is equal to a programming granularity corresponding to the determined programming mode;
[0028] In the second stage, the hardware completes programming of the first number of planes and adjusts the value of the first state variable and the value of the second state variable;
[0029] Repeat the above-mentioned first and second stage operations until the programming of all planes is completed.
[0030] In some embodiments, the state variable further includes a write request variable, the value of the write request variable is a first value or a second value, and the method further includes:
[0031] After receiving the write IO request, determine the value of the write request variable, wherein if the write IO request is a new IO request, the value of the write request variable is a first value, and if the write IO request is a previous IO request, the value of the write request variable is a second value;
[0032] If the value of the write request variable is the first value, the IO pressure of the flash memory device is calculated, the programming mode of the flash memory device is determined according to the IO pressure of the flash memory device, and the IO request is processed based on the programming mode.
[0033] In some embodiments, the method further comprises:
[0034] If the value of the write request variable is the second value, the programming mode of the flash memory device is determined according to the third state variable, and the programming of the remaining planes is continued based on the first state variable.
[0035] In some embodiments, the programming granularity is a multiple of the number of planes of the flash memory device.
[0036] In a second aspect, an embodiment of the present application provides a flash memory device, including:
[0037] at least one processor; and
[0038] A memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can be used to execute the planar programming method as in the first aspect.
[0039] In a third aspect, an embodiment of the present application further provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a flash memory device to execute the planar programming method of the first aspect.
[0040] The beneficial effect of the embodiment of the present application is that, different from the prior art, the embodiment of the present application provides a planar programming method, which is applied to a flash memory device, and the method includes: calculating the IO pressure of the flash memory device in real time; dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device, wherein each programming mode corresponds to a programming granularity. By calculating the IO pressure of the flash memory device in real time and dynamically adjusting the programming mode of the flash memory device according to the IO pressure, the present application can improve the IO delay and service quality of non-bandwidth services without affecting the read and write bandwidth, and improve the overall performance of the flash memory device. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0042] Figure 1 is a structural schematic diagram of a flash memory device provided in an embodiment of the present application;
[0043] Figure 2 is a schematic diagram of a plane of a flash memory device provided by an embodiment of the present application;
[0044] Figure 3 It is a schematic diagram of data transmission time and waiting completion time provided in an embodiment of the present application;
[0045] Figure 4 is a schematic diagram of programming time for multi-plane programming provided by an embodiment of the present application;
[0046] Figure 5 It is a flowchart of a planar programming method provided in an embodiment of the present application;
[0047] Figure 6 yes Figure 5 A detailed flow chart of step S20 in FIG.
[0048] Figure 7 yes Figure 5 Another detailed flow chart of step S20 in FIG.
[0049] Figure 8 yes Figure 7 A detailed flow chart of step S22 in FIG.
[0050] Fig. 9 It is a structural diagram of a firmware system of a flash memory device provided in an embodiment of the present application;
[0051] Fig.10 It is a flowchart of processing an IO request provided by an embodiment of the present application;
[0052] Fig.11 yes Fig.10 A detailed flowchart of step S92 in FIG.
[0053] Fig.12a It is a schematic diagram of an IO scheduling scenario provided in an embodiment of the present application;
[0054] Figure 12b is a schematic diagram of another IO scheduling scenario provided in an embodiment of the present application;
[0055] Fig.13 It is a structural schematic diagram of a flash memory device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0057] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in this application do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0058] The technical solution of this application is described in detail below with reference to the accompanying drawings:
[0059] See also Figure 1 , Figure 1 is a structural schematic diagram of a flash memory device provided in an embodiment of the present application;
[0060] like Figure 1As shown, the flash memory device 100 includes a flash memory medium 110 and a controller 120 connected to the flash memory medium 110. The flash memory device 100 is connected to the host 200 in a wired or wireless manner to achieve data interaction.
[0061] Flash memory medium 110, as the storage medium of flash memory device 100, is also called flash memory, Flash, Flash memory or Flash particles. It is a type of storage device and a non-volatile memory. It can store data for a long time even without current supply. Its storage characteristics are equivalent to those of a hard disk, making flash memory medium 110 the basis of storage media for various portable digital devices.
[0062] The controller 120 includes a data converter 121 , a processor 122 , a buffer 123 , a flash controller 124 , and an interface 125 .
[0063] The data converter 121 is connected to the processor 122 and the flash controller 124 respectively, and the data converter 121 is used to convert binary data into hexadecimal data, and convert hexadecimal data into binary data. Specifically, when the flash controller 124 writes data to the flash medium 110, the binary data to be written is converted into hexadecimal data through the data converter 121, and then written into the flash medium 110. When the flash controller 124 reads data from the flash medium 110, the hexadecimal data stored in the flash medium 110 is converted into binary data through the data converter 121, and then the converted data is read from the binary data page register. Among them, the data converter 121 may include a binary data register and a hexadecimal data register. The binary data register can be used to save the data converted from hexadecimal to binary, and the hexadecimal data register can be used to save the data converted from binary to hexadecimal.
[0064] The processor 122 is connected to the data converter 121, the cache 123, the flash memory controller 124 and the interface 125, respectively. The processor 122 and the data converter 121, the cache 123, the flash memory controller 124 and the interface 125 can be connected via a bus or other means. The processor is used to run the non-volatile software programs, instructions and modules stored in the cache 123, so as to implement any method embodiment of the present application.
[0065] The buffer 123 is mainly used to buffer the read / write instructions sent by the host 200 and the read data or write data obtained from the flash memory medium 110 according to the read / write instructions sent by the host 200.
[0066] The flash memory controller 124 is connected to the flash memory medium 110, the data converter 121, the processor 122 and the cache 123, and is used to access the back-end flash memory medium 110 and manage various parameters and data I / O of the flash memory medium 110; or, it is used to provide an access interface and protocol, implement the corresponding SAS / SATAtarget protocol end or NVMe protocol end, obtain the I / O instructions issued by the host 200, decode and generate internal private data results to wait for execution; or, it is responsible for the core processing of the flash translation layer (FTL).
[0067] Interface 125 connects the host 200 and the data converter 121, the processor 122 and the buffer 123, and is used to receive data sent by the host 200, or receive data sent by the processor 122 to realize data transmission between the host 200 and the processor 122. Interface 125 can be a SATA-2 interface, a SATA-3 interface, a SAS interface, an MSATA interface, a PCI-E interface, a NGFF interface, a CFast interface, an SFF-8639 interface and an M.2NVME / SATA protocol.
[0068] See also Figure 2 , Figure 2 is a schematic diagram of a plane of a flash memory device provided by an embodiment of the present application;
[0069] like Figure 2 As shown, a LUN has many blocks, and these blocks are divided into multiple planes, for example: Figure 2 LUN0 in the example includes four planes. A plane is a physical entity, and each plane has a corresponding page register / cache register inside the storage chip, which is mainly used to submit concurrency inside the chip.
[0070] Multi-plane operation is to operate multiple planes (blocks) at the same time. For example, multi-plane programming can program plane0-plane3 at the same time. The corresponding blocks are block n, block n+1, block n+2, block n+3, and n is a multiple of 4. For storage chips with 4 planes, single-plane programming is also supported, that is, only one block is programmed at a time. Dual-plane programming is also supported, that is, 2 planes can be programmed, that is, two blocks are programmed at a time. For example, a write request needs to program Block0 / 1 / 2 / 3. Using the 2-plane programming method, block0 / 1 is programmed first, and after completion, block2 / 3 is programmed.
[0071] Specifically, for writing, the master first writes the data into the Cache Register of the first Plane, and the data remains there and is not immediately written to the flash media, waiting for the master to transfer the data on another or several Planes on the same LUN to the corresponding Cache Register, and then write them to the flash media. Assuming that the time to write a Page is 1.5ms, and the time to transfer a Page is 50μs: if the original Single Plane operation is used, writing two Pages requires at least (1.5ms+50μs)x2; but if the Dual-Plane operation is used, since the write time of one Page is hidden, writing two Pages only requires 1.5ms+50x2μs, which is almost half the time, and the write speed is almost doubled. For reading, using the Dual-Plane operation, the Page data on two different Planes will be loaded into their respective Cache Registers in one flash read time, so that the data of two Pages can be read in one read time, which speeds up the reading speed. Assuming that the reading time and data transmission time are the same, both are 50μs, Single Plane needs 50μs x 4 = 200μs to read and transmit two Pages, while Dual-Plane needs 50μs x 2 + 50μs = 150μs, which is 75% of the former, and the reading speed is also greatly improved.
[0072] At present, NAND Flash supports multi-plane programming to improve command concurrency. Multi-plane programming can improve the writing speed. For example, a TLC particle has 2 planes, each page has 16K, and tProgram is 1ms. It is necessary to program the pages of 2 planes. If 2 single plane programs are used, it takes a total of 2ms. If multi-plane programming is used, it only takes 1ms.
[0073] It is understandable that the NAND Flash programming time consists of two parts: data transfer time (tTransfer) and waiting time for completion (tProgram).
[0074] See also Figure 3 , Figure 3 It is a schematic diagram of data transmission time and waiting completion time provided in an embodiment of the present application.
[0075] like Figure 3As shown in the figure, the sum of the data transfer time (tTransfer) and the waiting completion time (tProgram) can be regarded as the programming time of NAND Flash.
[0076] Please refer to Figure 4 , Figure 4 is a schematic diagram of programming time for multi-plane programming provided by an embodiment of the present application;
[0077] The programming time required for multi-plane programming is: N*tTransfer+tProgram, where N is the number of planes programmed at one time.
[0078] like Figure 4 As shown, the time required to complete programming of two planes at one time is 2*tTransfer+tProgram.
[0079] It can be seen that the total time of multi-plane programming is shorter than that of single-plane programming, so the write bandwidth is higher; but the single bus occupation time is longer. The time occupied by multi-plane programming is 2*tTransfer+tProgram, while the time occupied by single-plane programming is tTransfer+tProgram, which is shorter than multi-plane programming by tTransfer. If there is a read IO at this time point, the read IO needs to wait for the programming to be completed. In the single-plane programming mode, the read IO needs to wait for a shorter time tTransfer, so the delay of the read IO will also be shorter by tTransfer.
[0080] It is understandable that the single bus time refers to the bus time required for one programming. For example, assuming that the data of one plane is 48K, the data volume of two planes is 96K. Single-plane programming requires the transmission of 48K data, while multi-plane programming requires the transmission of 96K data, so multi-plane programming takes longer time on the NAND bus.
[0081] For the performance indicators of storage devices, in addition to the usual read and write bandwidth, latency and quality of service (QoS) are also very important indicators. Usually, different IO types are scheduled according to different priorities within the solid-state drive, and the priority of read IO is higher than that of write IO. When write IO has occupied the NAND Flash bus, read IO needs to wait until the write IO is completed before it can be scheduled, so the length of time that write IO occupies the bus will affect the QoS of read IO. The multi-plane program time is longer than the single plane program, which has a greater impact on the QoS of read IO.
[0082] Based on this, an embodiment of the present application provides a planar programming method and a flash memory device thereof to improve the overall performance of the flash memory device.
[0083] See also Figure 5 , Figure 5 It is a flowchart of a planar programming method provided in an embodiment of the present application;
[0084] The plane programming method is applied to a flash memory device, such as a solid state drive. Specifically, the execution subject of the plane programming method is one or more processors of the flash memory device.
[0085] like Figure 5 As shown, the planar programming method comprises:
[0086] Step S10: Calculate the IO pressure of the flash memory device in real time;
[0087] Specifically, the real-time calculation of the IO pressure of the flash memory device includes: within a fixed time interval, counting the number of read IO and write IO processed in a certain period of time to calculate the IO pressure of the flash memory device, that is, the read and write bandwidth. For example: if the timing interval is set to 100ms, within a certain 100ms period, the firmware processes 1024 96K write IOs, then the write pressure can be calculated to be 1024*96K*1000ms / 100ms=960MB / s.
[0088] Step S20: dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device, wherein each programming mode corresponds to a programming granularity.
[0089] For details, please refer to Figure 6 , Figure 6 yes Figure 5 A detailed flow chart of step S20 in FIG.
[0090] like Figure 6 As shown, step S20: dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device includes:
[0091] Step S201: Obtaining the IO pressure of the flash memory device;
[0092] Specifically, the IO pressure of the flash memory device is calculated by the above step S10.
[0093] Step S202: determining whether the IO pressure of the flash memory device is greater than a first IO pressure threshold;
[0094] Specifically, the first IO pressure threshold is a preset IO pressure threshold, which is set according to the actual performance requirements of the flash memory device. If the IO pressure of the flash memory device is greater than the first IO pressure threshold, then proceed to step S203; if the IO pressure of the flash memory device is not greater than the first IO pressure threshold, then proceed to step S204.
[0095] Step S203: adjusting the programming mode of the flash memory device to a first plane programming mode, wherein the programming granularity of the first plane programming mode is greater than a first granularity threshold;
[0096] Specifically, the first granularity threshold is a preset granularity threshold. Assuming that the first granularity threshold is 1, when the IO pressure of the flash memory device is greater than the first IO pressure threshold, the programming mode of the flash memory device is adjusted to a two-plane programming mode or a multi-plane programming mode.
[0097] Step S204: adjusting the programming mode of the flash memory device to a second plane programming mode, wherein the programming granularity of the second plane programming mode is less than or equal to the first granularity threshold.
[0098] Specifically, the first granularity threshold is a preset granularity threshold. Assuming that the first granularity threshold is 1, when the IO pressure of the flash memory device is less than or equal to the first IO pressure threshold, the programming mode of the flash memory device is adjusted to the single-plane programming mode.
[0099] In an embodiment of the present application, by setting a first IO pressure threshold, it is determined whether the IO pressure of the flash memory device is greater than the first IO pressure threshold to select the corresponding plane programming mode. The present application can improve the IO delay and service quality of non-bandwidth services without affecting the read and write bandwidth, thereby improving the overall performance of the flash memory device.
[0100] For details, please refer to Figure 7 , Figure 7 yes Figure 5 Another detailed flow chart of step S20 in FIG.
[0101] like Figure 7 As shown, step S20: dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device, wherein each programming mode corresponds to a programming granularity, including:
[0102] Step S21: testing the maximum IO bandwidth of the flash memory device in each programming mode;
[0103] Specifically, each programming mode corresponds to a programming granularity, and the programming granularity refers to the number of planes programmed at one time, wherein the programming granularity is related to the total number of planes of the flash memory device. It can be understood that the programming granularity is ≤ the total number of planes of the flash memory device.
[0104] By testing the maximum IO bandwidth of the flash memory device in each programming mode, for example, the number of planes of the flash memory device is 2, at this time, the programming granularity of the flash memory device includes 1 and 2, that is, single-plane programming and two-plane programming. At this time, the maximum IO bandwidth of the flash memory device in single-plane programming and two-plane programming is tested, as shown in Table 1 below:
[0105] Programming Mode Maximum IO bandwidth Single plane programming (singleplane) BW_P1 Two plane programming (twoplane) BW_P2
[0106] Table 1
[0107] Step S22: dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device and the maximum IO bandwidth corresponding to each programming mode.
[0108] For details, please refer to Figure 8 , Figure 8 yes Figure 7 A detailed flow chart of step S22 in FIG.
[0109] like Figure 8 As shown, step S22: dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device and the maximum IO bandwidth corresponding to each programming mode, includes:
[0110] Step S221: determining a bandwidth range corresponding to each programming mode according to the maximum IO bandwidth corresponding to each programming mode;
[0111] It is understandable that the larger the IO bandwidth, the larger the plane required for one-time programming in order to meet the write performance, and the larger the programming granularity. Therefore, assuming that the programming modes are arranged in order from small to large programming granularity, the first programming mode, the second programming mode, ..., the Nth programming mode can be determined, where N is the programming granularity, and the bandwidth range corresponding to a certain programming mode is (the maximum IO bandwidth of the previous programming mode, the maximum IO bandwidth of this programming mode), where the bandwidth range of the first programming mode is (0, the maximum IO bandwidth of the first programming mode), thereby determining the bandwidth range corresponding to each programming mode one by one.
[0112] Step S222: if the IO pressure of the flash memory device is within a bandwidth range corresponding to a certain programming mode, the programming mode is determined as the programming mode of the flash memory device, wherein the IO pressure of the flash memory device is less than the maximum IO bandwidth of the determined programming mode.
[0113] Specifically, the IO pressure of the flash memory device is obtained. If the IO pressure of the flash memory device is within a bandwidth range corresponding to a certain programming mode, the programming mode is determined as the programming mode of the flash memory device, wherein the IO pressure of the flash memory device is less than the maximum IO bandwidth of the determined programming mode.
[0114] In an embodiment of the present application, the method further includes: determining a corresponding programming mode according to a performance target to select a corresponding programming granularity, wherein the performance target includes read latency and service quality.
[0115] For example, if the number of planes of a flash device is 2 and the write bandwidth is 4GB / s, this bandwidth is the bandwidth that the flash device can achieve under two-plane programming. At this time, you can use single-plane programming first, and then test the bandwidth of the flash device, assuming it is 2GB / s. At this time, if the firmware recognizes that the current IO pressure is less than 2GB / s, it will switch to single-plane programming.
[0116] The performance target is the actual performance requirement of the flash memory device. If we focus on the read latency and service quality under the 1GB / s write bandwidth, it is obvious that 1GB / s is smaller than 2GB / s, and single-plane programming can be fully achieved. The firmware will actually use 1GB / s as the first bandwidth threshold instead of 2GB / s. In other words, at this time, if the IO pressure of the flash memory device is less than the first bandwidth threshold, it will be adjusted to single-plane programming. If the IO pressure of the flash memory device is greater than the first bandwidth threshold, it will be adjusted to two-plane programming. It is understandable that considering the need to leave a certain amount of reserved space, the first bandwidth threshold is less than the corresponding maximum IO bandwidth in the single-plane programming mode.
[0117] In an embodiment of the present application, the value of the programming granularity is positively correlated with the IO bandwidth. Specifically, the programming granularity is determined according to the IO bandwidth of the flash memory device, wherein the higher the IO bandwidth, the larger the programming granularity. Assuming that the number of planes of NAND Flash is N, the value of the programming granularity is 1, 2, ..., N, wherein N is a positive integer and N ≥ 2. For example: Assuming that the number of planes of NAND Flash is N = 6, theoretically 1, 2, 3, 4, 5, 6 can be selected. The general principle is that the lower the IO bandwidth, the lower the value of the programming granularity, so that it does not affect the write performance, but also reduces the read latency and improves the quality of service (Qos). In practical applications, the corresponding programming granularity is selected according to the performance target, and the performance target includes read latency and service quality. For example: if the IO pressure is low, the performance target under low IO pressure, i.e., read latency and service quality, is met. For example, according to the performance target, two programming granularity values are set, such as: the values are 6 and 1. When the IO pressure is high, the programming granularity is determined to be 6 to ensure the write bandwidth; and when the IO pressure is low, the programming granularity is determined to be 1 to reduce the read latency and improve the service quality.
[0118] In the embodiment of the present application, since the real-time IO pressure of the flash memory device is utilized and the programming mode of the flash memory device is dynamically adjusted, the present application can improve the IO delay and service quality of non-bandwidth services without affecting the read and write bandwidth, thereby improving the overall performance of the flash memory device.
[0119] In the embodiment of the present application, after determining the way to dynamically adjust the programming mode of the flash memory device, the method further includes:
[0120] After receiving the IO request, the IO request is processed based on the programming mode.
[0121] Specifically, based on the currently determined programming mode, the received IO request is processed.
[0122] Please refer to Fig. 9 , Fig. 9 It is a structural diagram of a firmware system of a flash memory device provided in an embodiment of the present application;
[0123] The flash memory device includes a flash memory controller, and the flash memory controller includes a firmware system. The firmware system is used to connect a host (HOST) and a flash memory array to realize data IO processing.
[0124] like Fig. 9 As shown, the firmware system 80 includes:
[0125] The front-end module 91, i.e., the Front End (FE), is connected to the data storage interface and is used to process the communication protocol with the host system and distribute the data storage operations sent by the host system, i.e., to obtain the host command to generate the IO operation. The front-end module is also responsible for the communication protocol with the host, the parsing of the host command and the SSD command, etc.
[0126] The data processing module 92, namely (Data Process, DP), is connected to the front-end module 91 and is used for processing the data path. Specifically, it is responsible for command-level data processing, such as caching data, etc.
[0127] The mapping table management module 93, i.e., the flash algorithm module, also known as the flash translation layer (FTL), is connected to the data processing module 92 and is used for the management of the mapping table and the management of the granularity of the data written into the flash memory, for example, mapping the IO operation to determine the flash memory array to be issued, and the mapping table management module 83 sends the IO operation to the backend module (BackEnd, BE) so that the backend module (Back End, BE) receives the IO operation;
[0128] The back-end module 94 (Back End, BE) is connected to the mapping table management module 93 and the flash memory medium, and is used for the management of flash memory data reading and writing and flash memory commands.
[0129] Among them, after the front-end module obtains the host command, it processes it to generate an IO operation, and sequentially passes through the data processing module, the mapping table management module and the back-end module to operate the flash array. For example: when the host reads data, the host (Host) sends a host command to the flash device (device), and the front-end module (FE) of the flash device receives the host command, processes it through the data processing module 92 and distributes it to the flash algorithm module (FTL). After receiving it, the flash algorithm module performs a logical-to-physical conversion process, and then sends the request NAND read operation to the back-end module (BE). After receiving it, the back-end module (BE) sends the hardware instruction to HW Op Nand Mode (the hardware module for operating NAND, which is controlled by BE) to operate NAND processing in parallel.
[0130] In the embodiment of the present application, the implementation of dynamic multi-plane programming on the firmware system is completed by the back-end module, and the flash algorithm module (FTL) may not be aware of it.
[0131] Please refer to Fig.10 , Fig.10 It is a flowchart of processing an IO request provided by an embodiment of the present application;
[0132] Step S101: setting state variables, wherein the state variables include a first state variable, a second state variable and a third state variable, the first state variable represents the number of the currently executed step, the second state variable represents the number of remaining steps, and the third state variable is used to represent the programming mode;
[0133] It is understandable that multi-plane programming needs to be completed in multiple steps, so it needs to be recorded through state variables.
[0134] Specifically, assuming that the first state variable is currentStep, currentStep is used to represent the step number currently being executed, the second state variable is remainingStep, remainingStep is used to represent the number of remaining steps, and the third state variable is opPlaneMode, opPlaneMode is used to represent the programming mode.
[0135] Step S102: According to the programming mode, adjust the state variables to process the IO request.
[0136] Specifically, the state variable is adjusted according to the determined current programming mode to process the IO request, wherein the current programming mode includes a single programming mode or a multiple programming mode.
[0137] For details, please refer to Fig.11 , Fig.11 yes Fig.10 A detailed flow chart of step S102 in FIG.
[0138] like Fig.11 As shown, step S102: adjusting the state variables according to the programming mode to process the IO request includes:
[0139] Step S1021: Determine the programming mode of the flash memory device;
[0140] Step S1022: Determine the value of the first state variable and the value of the second state variable;
[0141] Step S1023: Scheduling the write to the hardware to perform programming of the first number of planes;
[0142] Step S1024: the hardware completes programming of the first number of planes, and adjusts the value of the first state variable and the value of the second state variable;
[0143] Step S1025: Whether programming of all planes is completed;
[0144] Specifically, determine whether programming of all planes is completed, if so, end; if not, return to step S1022: determine the value of the first state variable and the value of the second state variable.
[0145] The following example illustrates that the number of planes of the flash memory device is four, namely plane0, plane1, plane2, and plane3, and the current programming mode is the two-plane programming mode (2plane):
[0146] In the first stage, the write IO request is scheduled and executed for the first time. The values of the state variables are initialized, that is, remainStep=2, currentStep=0, opPlaneMode=2, and the write is scheduled to the hardware to execute the programming of Plane0 and Plane1.
[0147] In the second stage, the hardware completes the programming of Plane0 and Plane1, remainStep=1, and the write IO request re-enters the backend scheduling queue to wait for scheduling;
[0148] Repeat the operation of the first stage, the write IO request is scheduled, and the second execution, currentStep = 1, the write is scheduled to the hardware to execute the programming of Plane2 and plane3.
[0149] Repeat the second stage operation, the hardware completes the programming of Plane2 and Plane3, remainStep=0.
[0150] At this point, it is determined that programming of all planes is completed, that is, the write request is completed in the backend module, the backend module generates completion information, and sends the completion information to the mapping table management module (Flash Translation Layer, FTL).
[0151] In the embodiment of the present application, the state variable further includes a write request variable, the value of the write request variable is a first value or a second value, and the method further includes:
[0152] After receiving the write IO request, determine the value of the write request variable, wherein if the write IO request is a new IO request, the value of the write request variable is a first value, and if the write IO request is a previous IO request, the value of the write request variable is a second value; the first value indicates that the write IO request is a new IO request and needs to be reprocessed; the second value indicates that the IO request is a previous IO request and needs to be processed further;
[0153] If the value of the write request variable is the first value, that is, the write request variable = 0, the IO pressure of the flash memory device is calculated, the programming mode of the flash memory device is determined according to the IO pressure of the flash memory device, and the IO request is processed based on the programming mode.
[0154] In an embodiment of the present application, the method further includes:
[0155] If the value of the write request variable is the second value, that is, the write request variable=1, the programming mode of the flash memory device is determined according to the third state variable, and the programming of the remaining planes is continued based on the first state variable.
[0156] Specifically, assume that the write request variable is NewIOFlag, where NewIOFlag is used to indicate whether the currently received IO request is a new write request, and the value of the write request variable is a first value or a second value, where the first value is 0 and the second value is 1.
[0157] It is understandable that the IO request received by the backend module, for example, a write request is a multi-plane programming, and the IO request enters the scheduling process of the backend module. The IO request needs to be scheduled multiple times (completed in steps) at the backend. Therefore, the status of the request needs to be recorded. NewIOFlag indicates that the request is a write request just received by the backend module, and the programming mode needs to be determined first.
[0158] After the backend module schedules the request, it will wait until the first step of programming is completed and the request will be added to the scheduling queue of the backend module again. At this time, the NewIO Flag has been set and there is no need to select the programming mode again. At the next scheduling, programming will start from the last position. For example, the value of NewI OFlag is 0 or 1, where the first value is 0 and the second value is 1.
[0159] For example, the processing flow of a write request includes:
[0160] Step (1), the backend module receives a write request from the mapping table management module, the write request is a fourplane write. At this time, the relevant state variables are initialized, for example, the first state variable, the second state variable and the third state variable are initialized, and the write request variable New IO Flag=1 is initialized.
[0161] Step (2), the backend module starts scheduling IO requests, and schedules a write request. If New IOFlag = 1, then determine the programming mode opPlaneMode, initialize the values of currentStep and remainingStep, and set New IO Flag to 0. If New IO Flag = 0, jump to step (3);
[0162] Step (3): according to the values of currentStep and opPlaneMode, a program command is issued to the hardware, wherein currentStep may indicate the position of the last programming, and opPlaneMode indicates the number of planes to be programmed this time.
[0163] Step (4): After programming is completed, currentStep is incremented by 1 and remainingStep is decremented by 1. If remainingStep is equal to 0, it is determined that programming of all planes is completed and the write request is completed. Otherwise, the scheduling process continues.
[0164] It is understandable that a normal write IO request only requires the first and second stages in the back-end module, but for dynamic multi-plane programming, the back-end module needs to split the multi-plane programming into several times to ensure that the read IO can be interspersed in the middle of the write request, thereby improving the speed of the read request response.
[0165] Please refer to Fig.12a , Fig.12a It is a schematic diagram of an IO scheduling scenario provided in an embodiment of the present application;
[0166] Assume there is a Die scheduling queue and an already executing execution queue. In the scheduling queue, read IO is generally scheduled first, and read IO is placed at the head of the queue first, while the execution queue is executed in the order of front to back.
[0167] like Fig.12a The IO scheduling scenario shown is an IO scheduling scenario for multi-plane programming. At time point T0, there is only one Write IO. After the Write IO is scheduled to the hardware, a Read IO is received. The Read IO needs to wait for the Write IO to be completed before it can be scheduled. Therefore, the final delay of the Read IO is equal to the delay of the Read IO itself plus the delay of the Write IO.
[0168] Please refer to Figure 12b , Figure 12b is a schematic diagram of another IO scheduling scenario provided in an embodiment of the present application;
[0169] like Figure 12b The IO scheduling scenario shown in the figure is a single-plane programming IO scheduling scenario. Since the read IO can be scheduled only after the write IO is partially completed, the delay of the read IO is equal to the delay of the read IO itself plus the delay of the write IO (step 0). The delay of the write IO (step 0) is longer than Fig.12a The Write IO delay in should be short.
[0170] Write IO (step 0) is single-plane programming, while Write IO is multi-plane programming. Therefore, when single-plane programming is used, the delay of Read IO when encountering Write IO is shorter than that of multi-plane programming.
[0171] In an embodiment of the present application, a planar programming method is provided, which is applied to a flash memory device, including: calculating the IO pressure of the flash memory device in real time; dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device, wherein each programming mode corresponds to a programming granularity. By calculating the IO pressure of the flash memory device in real time and dynamically adjusting the programming mode of the flash memory device according to the IO pressure, the present application can improve the IO delay and service quality of non-bandwidth services without affecting the read and write bandwidth, thereby improving the overall performance of the flash memory device.
[0172] Please refer to Fig.13 , Fig.13 is a structural schematic diagram of a flash memory device provided in an embodiment of the present application;
[0173] like Fig.13As shown, the flash memory device 130 includes one or more processors 131 and a memory 132. Fig.13 A processor 131 is taken as an example.
[0174] The processor 131 and the memory 132 may be connected via a bus or other means. Fig.13 The example of connecting through bus is taken in the following.
[0175] The processor 131 is used to provide computing and control capabilities to control the flash memory device 130 to perform corresponding tasks, for example, to control the flash memory device 130 to perform the planar programming method in any of the above method embodiments, including: real-time calculation of the IO pressure of the flash memory device; dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device, wherein each programming mode corresponds to a programming granularity.
[0176] By calculating the IO pressure of the flash memory device in real time and dynamically adjusting the programming mode of the flash memory device according to the IO pressure, the present application can improve the IO delay and service quality of non-bandwidth services without affecting the read and write bandwidth, thereby improving the overall performance of the flash memory device.
[0177] The processor 131 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0178] The memory 132, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the program instructions / modules corresponding to the planar programming method in the embodiment of the present application. The processor 131 can implement the planar programming method in any of the following method embodiments by running the non-transitory software programs, instructions and modules stored in the memory 132. Specifically, the memory 132 may include a volatile memory (volatile memory, VM), such as a random access memory (random access memory, RAM); the memory 132 may also include a non-volatile memory (non-volatile memory, NVM), such as a read-only memory (read-only memory, ROM), a flash memory (flash memory), a hard disk drive (hard disk drive, HDD) or a solid-state drive (solid-state drive, SSD) or other non-transitory solid-state storage devices; the memory 132 may also include a combination of the above-mentioned types of memories.
[0179] The memory 132 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 132 may optionally include a memory remotely arranged relative to the processor 131, and these remote memories may be connected to the processor 131 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0180] One or more modules are stored in the memory 132, and when executed by one or more processors 131, the plane programming method in any of the above method embodiments is executed, for example, the above described Figure 5 The steps shown.
[0181] In the embodiment of the present application, the flash memory device 130 may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output. The flash memory device 130 may also include other components for realizing device functions, which will not be described in detail here.
[0182] The flash memory device of the embodiment of the present application exists in various forms. Figure 5 The steps shown include but are not limited to: storage devices such as solid state drives.
[0183] The present application also provides a computer-readable storage medium, such as a memory including a program code, and the program code can be executed by a processor to complete the planar programming method in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CDROM), a magnetic tape, a floppy disk, and an optical data storage device.
[0184] The present application also provides a computer program product, which includes one or more program codes stored in a computer-readable storage medium. A processor of an electronic device reads the program code from the computer-readable storage medium, and the processor executes the program code to complete the method steps of the planar programming method provided in the above embodiment.
[0185] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware or by hardware associated with a program code, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0186] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0187] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as mentioned above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A planar programming method, characterized in that: Applied to a flash memory device, the method comprises: Calculating the IO pressure of the flash memory device in real time; According to the IO pressure of the flash memory device, dynamically adjust the programming mode of the flash memory device, wherein the programming mode includes a first plane programming mode or a second plane programming mode, each programming mode corresponds to a programming granularity, the programming granularity is the number of planes programmed at one time, and the value of the programming granularity is positively correlated with the IO bandwidth; The dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device includes: Testing the maximum IO bandwidth of the flash memory device in each programming mode; According to the IO pressure of the flash memory device and in combination with the maximum IO bandwidth corresponding to each of the programming modes, dynamically adjusting the programming mode of the flash memory device; The dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device and the maximum IO bandwidth corresponding to each of the programming modes includes: Determine a bandwidth range corresponding to each programming mode according to the maximum IO bandwidth corresponding to each programming mode; If the IO pressure of the flash memory device is within the bandwidth range corresponding to a certain programming mode, determining the programming mode as the programming mode of the flash memory device, wherein the IO pressure of the flash memory device is less than the maximum IO bandwidth of the determined programming mode; The method further comprises: The programming granularity is determined according to the IO bandwidth of the flash memory device, wherein the higher the IO bandwidth, the larger the programming granularity.
2. The method according to claim 1, characterized in that The dynamically adjusting the programming mode of the flash memory device according to the IO pressure of the flash memory device includes: Determining whether the IO pressure of the flash memory device is greater than a first IO pressure threshold; If yes, adjusting the programming mode of the flash memory device to a first plane programming mode, wherein the programming granularity of the first plane programming mode is greater than a first granularity threshold; If not, the programming mode of the flash memory device is adjusted to a second plane programming mode, wherein the programming granularity of the second plane programming mode is less than or equal to the first granularity threshold.
3. The method according to claim 1, characterized in that The method further comprises: After receiving the IO request, processing the IO request based on the programming mode; Based on the programming mode, processing the IO request includes: Setting state variables, wherein the state variables include a first state variable, a second state variable and a third state variable, the first state variable represents the number of steps currently being executed, the second state variable represents the number of remaining steps, and the third state variable is used to represent a programming mode; According to the programming mode, the state variables are adjusted to process the IO request.
4. The method according to claim 3, characterized in that The IO request includes a write IO request, and adjusting the state variable according to the programming mode to process the IO request includes: Obtaining the number of planes of the flash memory device and determining a programming mode of the flash memory device; In a first stage, according to a programming mode of the flash memory device, a value of a first state variable and a value of a second state variable are determined, and a write is scheduled to hardware to perform programming of a first number of planes, wherein the first number is equal to a programming granularity corresponding to the determined programming mode; In the second stage, the hardware completes programming of the first number of planes and adjusts the value of the first state variable and the value of the second state variable; Repeat the above-mentioned first and second stage operations until the programming of all planes is completed.
5. The method according to claim 4, characterized in that The state variable also includes a write request variable, the value of the write request variable is a first value or a second value, and the method further includes: After receiving the write IO request, determine the value of the write request variable, wherein if the write IO request is a new IO request, the value of the write request variable is a first value, and if the write IO request is a previous IO request, the value of the write request variable is a second value; If the value of the write request variable is the first value, the IO pressure of the flash memory device is calculated, the programming mode of the flash memory device is determined according to the IO pressure of the flash memory device, and the IO request is processed based on the programming mode.
6. The method according to claim 5, characterized in that The method further comprises: If the value of the write request variable is the second value, the programming mode of the flash memory device is determined according to the third state variable, and the programming of the remaining planes is continued based on the first state variable.
7. The method according to any one of claims 1 to 6, characterized in that: The programming granularity is a multiple of the number of planes of the flash memory device.
8. A flash memory device, characterized in that: include: at least one processor; as well as A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor so that the at least one processor can be used to execute the planar programming method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method for processing write request and mobile terminal
CN105511806A
Data processing method, controller, storage device and storage system
CN111324296A
Storage system and storage data processing method
CN112035381A
Flash memory storage device, controller thereof, and data programming method thereof
US20110191525A1
