Data processing method and system for namespace, host and storage medium

By determining the IO queue depth and the number of concurrent IO requests based on the namespace priority, the problem of lack of flow control solutions between multiple namespaces is solved, and the performance stability of flash memory devices is improved.

CN119620936AActive Publication Date: 2025-03-14DAPUSTOR CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411581425.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-03-14
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

In the prior art, there is a lack of a standard flow control scheme between multiple namespaces of solid-state drives, resulting in the performance of other namespaces being reduced when the data traffic in some namespaces is too large, thereby reducing the performance stability of flash memory devices.

Method used

By determining the IO queue depth according to the priority of the namespace and determining the number of concurrent IO requests for each namespace based on the IO queue depth, the amount of IO data sent to each block device is finally determined based on the maximum number of concurrent IO requests of the block device to prevent performance degradation caused by excessive data traffic.

Benefits of technology

It effectively prevents excessive data traffic in some namespaces from degrading performance of other namespaces, and improves the performance stability of flash memory devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119620936A_ABST
    Figure CN119620936A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses a data processing method and system of namespaces, a host and a storage medium, the method comprises the following steps: determining a first IO queue depth corresponding to each namespace one by one according to the priority of each namespace; according to the first IO queue depth corresponding to each namespace, determining a first maximum concurrent IO request number corresponding to each block device; according to the first maximum concurrent IO request quantity corresponding to each block device, the first IO data quantity issued to each block device is determined, the IO queue depth of the namespace is determined according to the priority of the namespace, and then the concurrent IO request quantity corresponding to each namespace is determined according to the IO queue depth. According to the first maximum concurrent IO request number corresponding to each block device, the first IO data volume issued to each block device is determined, and according to the method and device, the situation that the data flow of part of namespace is too large can be prevented, and the stability of the performance of the flash memory device is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing technology, and in particular, to a method, system, host and storage medium for processing namespace data. Background Art

[0002] As the capacity of SSDs increases, multiple namespaces are usually used to create multiple small namespaces for the host to use. Each namespace is reflected as an independent physical storage device on the host. For example, on Linux, each namespace corresponds to an independent block device, and on Windows, each namespace is an independent physical volume. Each namespace can meet the data storage needs of different applications on the host, but because each namespace is performing IO reading and writing, there is no good solution to achieve flow control for each namespace, resulting in the failure to apply the namespace features on the host.

[0003] At present, there is no standard flow control solution between multiple namespaces of solid-state drives. The existing technical solution is that each manufacturer provides its own unique command to configure the bandwidth and IOPS of the namespace. This solution is effective when the IO concurrency and pressure of each namespace are similar. However, when the services of each namespace are different, the IO concurrency and pressure of the IO concurrency issued are very different, that is, when the data traffic of some namespaces is too large, the performance of other namespaces will be reduced, thereby reducing the stability of the performance of the flash memory device. For example, the total number of IO resources in the SSD disk is 1024, and the business volume of the 2GB namespace is large, the IO concurrency is high, and it occupies 1000 IO resources. Even if the 4GB namespace is scheduled with high priority, the number of remaining IO resources is only 24, and the fewer resources will also affect the performance of the 4GB namespace. Summary of the invention

[0004] The embodiments of the present application provide a namespace data processing method, system, host and storage medium. The IO queue depth of the namespace is determined according to the priority of the namespace, and the number of concurrent IO requests corresponding to each namespace is determined according to the IO queue depth. The first IO data volume sent to each block device is determined according to the first maximum concurrent IO request number corresponding to each block device. The present application can prevent the data flow of some namespaces from being too large, resulting in reduced performance of other namespaces, thereby improving the stability of the performance of the flash memory device.

[0005] The embodiments of the present application provide the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a namespace data processing method, which is applied to a flash memory device, wherein the flash memory device includes at least two namespaces, each namespace corresponds to a block device, and the method includes:

[0007] Get the priority of each namespace;

[0008] According to the priority of each namespace, determine the first IO queue depth corresponding to each namespace one by one;

[0009] Determine a first maximum number of concurrent IO requests corresponding to each block device according to a first IO queue depth corresponding to each namespace;

[0010] According to the first maximum number of concurrent IO requests corresponding to each block device, a first IO data amount sent to each block device is determined, wherein the first IO data amount is less than or equal to the first maximum number of concurrent IO requests.

[0011] In some embodiments, the first maximum number of concurrent IO requests corresponding to each device is equal to the first IO queue depth corresponding to the corresponding namespace;

[0012] Before getting the priority of each namespace, the method also includes:

[0013] The priority corresponding to each namespace is set through the first configuration command.

[0014] In some embodiments, the priority of each namespace corresponds to a coefficient one by one, and according to the priority of each namespace, the first IO queue depth corresponding to each namespace is determined one by one, including:

[0015] Get the queue depth of the submission queue;

[0016] The first IO queue depth is determined according to the queue depth of the submission queue and the coefficient corresponding to the priority of the namespace, wherein the first IO queue depth=the coefficient corresponding to the priority of the namespace*the depth of the submission queue.

[0017] In some embodiments, according to the priority of each namespace, the priority of the namespace includes a first priority, a second priority, and a third priority, the first priority corresponds to the first coefficient, the second priority corresponds to the second coefficient, and the third priority corresponds to the third coefficient;

[0018] The first IO queue depth is determined according to the queue depth of the submission queue and the coefficient corresponding to the priority of the namespace, including:

[0019] If the priority of the namespace is the first priority, the first IO queue depth corresponding to the namespace is determined as the first coefficient * the queue depth of the submission queue;

[0020] If the priority of the namespace is the second priority, the first IO queue depth corresponding to the namespace is determined to be the second coefficient * the queue depth of the submission queue, where the second coefficient is less than the first coefficient;

[0021] If the priority of the namespace is the third priority, the first IO queue depth corresponding to the namespace is determined as the third coefficient*the queue depth of the submission queue, where the third coefficient is less than the second coefficient.

[0022] In some embodiments, the method further comprises:

[0023] Detect whether the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold, where the preset threshold = (the sum of concurrent IO requests corresponding to all namespaces / the total number of namespaces) * the preset coefficient;

[0024] When it is detected that the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold, the IO queue depth corresponding to the namespace is adjusted to the second IO queue depth;

[0025] According to the second IO queue depth, the maximum number of concurrent IO requests corresponding to the block device is adjusted to the second maximum number of concurrent IO requests.

[0026] In some embodiments, according to the second IO queue depth, adjusting the maximum number of concurrent IO requests corresponding to the block device to the second maximum number of concurrent IO requests includes:

[0027] After receiving the first asynchronous event notification sent by the flash memory device, sending a namespace identification command to the flash memory device to make the flash memory device return to the second IO queue depth;

[0028] According to the second IO queue depth, the maximum number of concurrent IO requests corresponding to the block device is adjusted to the second maximum number of concurrent IO requests, wherein the second maximum number of concurrent IO requests corresponding to each block device is equal to the second IO queue depth corresponding to its corresponding namespace.

[0029] In some embodiments, the method further comprises:

[0030] Sending a second configuration command to the flash memory device, wherein the second configuration command includes a changed priority corresponding to the namespace;

[0031] According to the changed priority, adjust the IO queue depth of the namespace to the third IO queue depth;

[0032] Determine the third maximum number of concurrent IO requests corresponding to each device according to the third IO queue depth;

[0033] According to the third maximum number of concurrent IO requests corresponding to each block device, a third IO data volume sent to each block device is determined, wherein the third IO data volume is less than or equal to the third maximum number of concurrent IO requests.

[0034] In some embodiments, determining a third maximum number of concurrent IO requests corresponding to each block device according to the third IO queue depth includes:

[0035] After receiving the second asynchronous event notification sent by the flash memory device, sending a namespace identification command to the flash memory device to make the flash memory device return to the third IO queue depth;

[0036] According to the third IO queue depth, a third maximum number of concurrent IO requests corresponding to each device is determined, wherein the third IO data volume is less than or equal to the third maximum number of concurrent IO requests.

[0037] In a second aspect, an embodiment of the present application provides a namespace data processing system, the system comprising:

[0038] A flash memory device is communicatively connected to a host, and the flash memory device is used to receive a first configuration command sent by the host, wherein the first configuration command includes a priority corresponding to each namespace; according to the priority of each namespace, a first IO queue depth corresponding to each namespace is determined, and a first asynchronous event notification is sent to the host, wherein one namespace corresponds to one first IO queue depth, and the priority is positively correlated with the first IO queue depth;

[0039] A host is communicatively connected to a flash memory device. The host is used to send a namespace identification command to the flash memory device after receiving a first asynchronous event notification sent by the flash memory device, so that the flash memory device returns a first IO queue depth to the host; determine a first maximum concurrent IO request number corresponding to the block device according to the first IO queue depth; and determine a first IO data amount to be sent to each block device according to the first maximum concurrent IO request number corresponding to each block device, wherein the first IO data amount is less than or equal to the first maximum concurrent IO request number.

[0040] In some embodiments, the host includes a block device driver module, which is used to determine a first maximum concurrent IO request number corresponding to the block device based on the first IO queue depth; and determine a first IO data amount to be sent to each block device based on the first maximum concurrent IO request number corresponding to each block device, wherein the first IO data amount is less than or equal to the first maximum concurrent IO request number.

[0041] In some embodiments, the flash memory device includes a firmware module, and the firmware module is used to detect whether the IO concurrent request corresponding to the current namespace exceeds a preset threshold, wherein the preset threshold=(the sum of the IO concurrent requests corresponding to all namespaces / the total number of namespaces)*preset coefficient;

[0042] The flash memory device is further configured to adjust the IO queue depth corresponding to the namespace from the first IO queue depth to the second IO queue depth when detecting that the IO concurrent request corresponding to a certain device exceeds a preset threshold, and send a second asynchronous event notification to the host;

[0043] The host is also used to send a namespace identification command to the flash memory device after receiving the second asynchronous event notification sent by the flash memory device, so that the flash memory device returns a second IO queue depth to the host; determine the second maximum concurrent IO request number corresponding to the block device according to the second IO queue depth; determine the second IO data volume sent to the block device according to the second maximum concurrent IO request number corresponding to the block device, wherein the second IO data volume is less than or equal to the second maximum concurrent IO request number.

[0044] In a third aspect, an embodiment of the present application provides a host, including:

[0045] at least one processor; and

[0046] a memory communicatively connected to at least one processor; wherein,

[0047] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the namespace data processing method according to the first aspect.

[0048] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed, a namespace data processing method as described in any one of the first aspects is implemented.

[0049] The beneficial effects of the embodiments of the present application are as follows: Different from the prior art, the embodiments of the present application provide a namespace data processing method, which is applied to a flash memory device, wherein the flash memory device includes at least two namespaces, each namespace corresponds to a block device one by one, and the method includes: obtaining the priority of each namespace; determining the first IO queue depth corresponding to each namespace one by one according to the priority of each namespace; determining the first maximum concurrent IO request number corresponding to each block device according to the first IO queue depth corresponding to each namespace; determining the first IO data volume sent to each block device according to the first maximum concurrent IO request number corresponding to each block device, wherein the first IO data volume is less than or equal to the first maximum concurrent IO request number. The present application can determine the IO queue depth of the namespace according to the priority of the namespace, and then determine the concurrent IO request number corresponding to each namespace according to the IO queue depth, and determine the first IO data volume sent to each block device according to the first maximum concurrent IO request number corresponding to each block device. The present application can prevent the data flow of some namespaces from being too large, resulting in reduced performance to other namespaces, thereby improving the stability of the performance of the flash memory device. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.

[0051] Figure 1 It is a structural diagram of a namespace data processing system provided in an embodiment of the present application;

[0052] Figure 2 It is a flowchart of a method for processing namespace data provided by an embodiment of the present application;

[0053] Figure 3 It is a flowchart of setting the priority of a namespace provided by an embodiment of the present application;

[0054] Figure 4 yes Figure 2 A detailed flow chart of step S202 in FIG.

[0055] Figure 5 yes Figure 4 A detailed flow chart of step S222 in FIG.

[0056] Figure 6 It is a flowchart of a method for detecting whether the amount of IO data corresponding to the current namespace exceeds a preset threshold value provided by an embodiment of the present application;

[0057] Figure 7 yes Figure 6 A detailed flow chart of step S605 in FIG.

[0058] Figure 8 It is a flowchart of adjusting the IO queue depth of a namespace according to a changed priority provided by an embodiment of the present application;

[0059] Fig. 9 yes Figure 8 A detailed flow chart of step S803 in FIG.

[0060] Fig.10 is an interaction timing diagram between a host and a flash memory device provided in an embodiment of the present application;

[0061] Fig.11 is another interaction timing diagram between a host and a flash memory device provided in an embodiment of the present application;

[0062] Fig.12 It is a structural diagram of a host provided in an embodiment of the present application.

[0063] Description of Figure Numbers:

[0064] DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0066] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0067] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in this specification and in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.

[0068] The technical solution of the present application is described in detail below in conjunction with the accompanying drawings:

[0069] See also Figure 1 , Figure 1 It is a structural diagram of a namespace data processing system provided in an embodiment of the present application;

[0070] like Figure 1 As shown, the data processing system 100 of the namespace includes a host 10 and a flash memory device 20, wherein the host 10 is communicatively connected to the flash memory device 20. Figure 1 Taking a host 10 and a flash memory device 20 as an example, it can be understood that the data processing system 100 of the namespace can also include multiple flash memory devices 20. For example, the host 10 is respectively connected to multiple flash memory devices 20, wherein the types of the flash memory devices 20 include but are not limited to solid state drives (Solid State Drive, SSD), key-value solid state drives (KV SSD), computational storage devices (Computational Storage Drive, CSD), graphics processing units (Graphic Processing Unit, GPU), and data processing units (Data Processing Unit, DPU).

[0071] A host 10 is connected to a flash memory device 20. The host 10 is used to send a namespace identification command to the flash memory device 20 after receiving a first asynchronous event notification sent by the flash memory device 20, so that the flash memory device 20 returns a first IO queue depth to the host 10; according to the first IO queue depth, a first maximum concurrent IO request number corresponding to the block device is determined; according to the first maximum concurrent IO request number corresponding to each block device, a first IO data volume sent to each block device is determined, wherein the first IO data volume is less than or equal to the first maximum concurrent IO request number; specifically, firstly, the host sets the priority corresponding to each namespace through a first configuration command, wherein the first configuration command refers to an NVMe Set Feature command, and the NVMe Set Feature command is a command for configuring and managing NVMe solid-state drive (SSD) features. Through the NVMe SetFeature command, the host 10 can obtain status information of the flash memory device 20, and can also modify certain settings in the flash memory device 20.

[0072] In an embodiment of the present application, the first configuration command is used to set the priority corresponding to each namespace. The host sets the priority corresponding to each namespace by sending the first configuration command to the flash memory device. For example, the priority corresponding to namespace A is set to the first priority, the priority corresponding to namespace B is set to the second priority, and the priority corresponding to namespace C is set to the third priority, wherein the first priority is higher than the second priority, and the second priority is higher than the third priority. Then, after the flash memory device receives the first configuration command, it sends a first asynchronous event notification to the host. After receiving the first asynchronous event notification sent by the flash memory device, the host sends a namespace identification command to the flash memory device, so that the flash memory device returns the first IO queue depth to the host, and according to the first IO queue depth, the first maximum concurrent IO request number corresponding to the block device, wherein the first maximum concurrent IO request number corresponding to each block device is equal to the first IO queue depth corresponding to its corresponding namespace. For example, assuming that the first IO queue depth is 128, the first maximum concurrent IO request number is determined to be 128, and according to the first maximum concurrent IO request number corresponding to each block device, the first IO data amount sent to each block device is determined, wherein the first IO data amount is less than or equal to the first maximum concurrent IO request number.

[0073] In an embodiment of the present application, the host 10 includes a block device driver module 101, and the block device driver module 101 is used to determine the first maximum concurrent IO request number corresponding to the block device according to the first IO queue depth; determine the first IO data amount sent to each block device according to the first maximum concurrent IO request number corresponding to each block device, wherein the first IO data amount is less than or equal to the first maximum concurrent IO request number; specifically, the device driver module determines the first IO data amount sent to each block device according to the first maximum concurrent IO request number corresponding to each block device, wherein the first IO data amount is less than or equal to the first maximum concurrent IO request number. Assuming that there are currently three block devices: a first block device, a second block device, and a third block device, the first maximum concurrent IO request number corresponding to the first block device is 512, the first maximum concurrent IO request number corresponding to the second block device is 256, and the first maximum concurrent IO request number corresponding to the third block device is 128. At this time, there are several situations:

[0074] (1) When the total amount of IO data that needs to be sent is greater than the sum of the first maximum concurrent IO request numbers corresponding to all block devices, for example, when the total amount of IO data that needs to be sent is 996, the first IO data amount to be sent to the first block device is determined to be 512, the first IO data amount to be sent to the second block device is 256, and the first IO data amount to be sent to the third block device is 128. The remaining IO data amount is 100. Since the current IO data amount of all block devices is equal to the first maximum concurrent IO request number corresponding to each block device, the remaining IO data will enter the waiting queue, that is, the IO data will be suspended on the host (IO It is understandable that on the Host, the input / output operation is suspended for some reason and cannot be completed in time. It is necessary to wait for the previous IO operation to be completed before the suspended IO operation can be processed. After the first 896 IO data are sent to the corresponding block device, the remaining 100 IO data will be sent to the block device with the largest number of concurrent IO requests to ensure that the IO data is sent to the block device corresponding to the namespace with the highest priority first.

[0075] (2) When the total amount of IO data that needs to be sent is equal to the sum of the first maximum concurrent IO request numbers corresponding to all block devices, first select the block device with the largest first maximum concurrent IO request number, that is, the first block device, and the first IO data amount sent to the first block device is 512. Then select the second block device, and the first IO data amount sent to the second block device is 256. Finally, select the block device with the smallest first maximum concurrent IO request number, that is, the third block device, and the first IO data amount sent to the third block device is 128.

[0076] (3) When the total amount of IO data that needs to be sent at this time is less than the sum of the first maximum concurrent IO request numbers corresponding to all block devices, for example, the total amount of IO data that needs to be sent at this time is 500, then the block device with the largest first maximum concurrent IO request number, that is, the first block device, is selected first, and the amount of first IO data sent to the first block device is 500, and there is no need to send IO data to the second block device and the third block device; for another example, if the total amount of IO data that needs to be sent at this time is 700, then the block device with the largest first maximum concurrent IO request number, that is, the first block device, is selected first, and the amount of first IO data sent to the first block device is 512. At this time, there are still 188 IO data left, and then the second block device is selected, and the amount of first IO data sent to the second block device is 188, and there is no need to send IO data to the third block device.

[0077] A flash memory device 20, the flash memory device 20 is connected to the host 10, and the flash memory device 20 is used to receive a first configuration command sent by the host, wherein the first configuration command includes a priority corresponding to each namespace; according to the priority of the namespace, a first IO queue depth of the namespace is determined, and a first asynchronous event notification is sent to the host, wherein one namespace corresponds to one first IO queue depth, and the priority is positively correlated with the first IO queue depth;

[0078] In an embodiment of the present application, the flash memory device 20 includes a firmware module 201, which is used to detect whether the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold, wherein the preset threshold = (the sum of the number of concurrent IO requests corresponding to all namespaces / the total number of namespaces) * a preset coefficient; specifically, the firmware module includes firmware (Firmware), which is a software embedded in a hardware device and is usually stored in a non-volatile memory of the device, such as a flash memory or a read-only memory (ROM). Its main functions include controlling the startup process of the device, initializing the basic functions of the device, controlling hardware operations, and communicating with other devices. In an embodiment of the present application, the firmware module (Firmware, FW) in the flash memory device detects whether the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold, wherein the preset threshold = (the sum of the number of concurrent IO requests corresponding to all namespaces / the total number of namespaces) * a preset coefficient, wherein the sum of the number of concurrent IO requests corresponding to all namespaces / the total number of namespaces is the average value of the number of concurrent IO requests corresponding to each namespace, and the preset coefficient can be set according to actual needs, for example, the preset coefficient is set to 2, which is not limited in the present application. If the number of concurrent IO requests corresponding to the detected block device does not exceed the preset threshold, it means that the number of concurrent IO requests of no block device exceeds the preset threshold, and it will not affect the bandwidth and latency of IO in other namespaces, so there is no need to adjust the IO queue depth corresponding to the namespace; if the number of concurrent IO requests corresponding to a block device exceeds the preset threshold, the IO queue depth corresponding to the block device is adjusted from the first IO queue depth to the second IO queue depth, wherein the second IO queue depth is less than the first IO queue depth. For example, assuming that the first IO queue depth is 256, the second IO queue depth can be adjusted to 128.

[0079] In an embodiment of the present application, by detecting whether the number of concurrent IO requests corresponding to a block device exceeds a preset threshold, the IO queue depth corresponding to the block device is dynamically adjusted. The present application can limit the concurrent IO requests sent to the block device from the host side. The present application can prevent the data traffic of some namespaces from being too large, and improve the stability of the performance of the flash memory device.

[0080] The flash memory device 20 is also used to adjust the IO queue depth corresponding to the namespace from the first IO queue depth to the second IO queue depth when it detects that the IO concurrent request corresponding to the namespace exceeds a preset threshold, and send a first asynchronous event notification to the host; specifically, after the flash memory device detects that the number of concurrent IO requests corresponding to the block device exceeds the preset threshold and adjusts the IO queue depth corresponding to the namespace, it sends the first asynchronous event notification to the host, so that the host sends a namespace identification command to the flash memory device after receiving the first asynchronous event notification sent by the flash memory device, wherein the first asynchronous event refers to an asynchronous event defined by the NVMe protocol, and the flash memory device can notify the host to update the IO queue depth corresponding to the namespace by sending an asynchronous event defined by the NVMe protocol to the host.

[0081] The host 10 is also used to send a namespace identification command to the flash memory device after receiving the second asynchronous event notification sent by the flash memory device, so that the flash memory device returns the second IO queue depth to the host; determine the second maximum concurrent IO request number corresponding to the block device according to the second IO queue depth; determine the second IO data amount sent to the block device according to the second maximum concurrent IO request number corresponding to the block device, wherein the second IO data amount is less than or equal to the second maximum concurrent IO request number; specifically, after receiving the first asynchronous event notification sent by the flash memory device, the host sends a namespace identification command to the flash memory device, so that the flash memory device returns the second IO queue depth to the host, and determines the second maximum concurrent IO request number corresponding to the block device according to the second IO queue depth, wherein the second IO queue depth is equal to the second maximum concurrent IO request number; finally, determine the second IO data amount sent to the block device according to the second maximum concurrent IO request number corresponding to the block device, wherein the second IO data amount is less than or equal to the second maximum concurrent IO request number, for example, when the second maximum concurrent IO request number is 128, it is determined that the second IO data amount sent to the block device can be 100.

[0082] It can be understood that the first asynchronous event notification or the second asynchronous event notification in the embodiments of the present application means that when an event occurs, the system or application does not need to wait for the operation to be completed, but instead sends a notification to related components or users through a certain mechanism (such as callback, message queue, signal, etc.). This mechanism allows the system to respond to events in a timely manner while processing other tasks, thereby improving efficiency and user experience.

[0083] See also Figure 2 , Figure 2 It is a flowchart of a method for processing namespace data provided by an embodiment of the present application;

[0084] The data processing method of the namespace is applied to a host, and the host is connected to a flash memory device, wherein the flash memory device includes a solid state drive.

[0085] like Figure 2 As shown, the data processing method of the namespace includes:

[0086] Step S201: Obtain the priority of each namespace;

[0087] Specifically, the priority of the namespace is determined by the host. The host uses different namespaces for different business types. The host can define the priority of each namespace according to the business type corresponding to each namespace. For example, assume that the host creates three namespaces: namespace A, namespace B, and namespace C, and sets the priority corresponding to each namespace. The priority corresponding to namespace A is set to the first priority, the priority corresponding to namespace B is set to the second priority, and the priority corresponding to namespace C is set to the third priority, wherein the first priority is higher than the second priority, and the second priority is higher than the third priority.

[0088] Please refer to Figure 3 , Figure 3 It is a flowchart of setting the priority of a namespace provided by an embodiment of the present application;

[0089] like Figure 3 As shown in the figure, the process of setting the priority of a namespace includes:

[0090] Step S301: Setting the priority corresponding to each namespace through a first configuration command;

[0091] Specifically, the first configuration command refers to the NVMe Set Feature command. The NVMe Set Feature command is a command used to configure and manage NVMe solid-state drive (SSD) features. Through this command, the host can obtain the status information of the flash memory device and modify certain settings in the flash memory device. In an embodiment of the present application, the first configuration command is used to set the priority corresponding to each namespace. The host sets the priority corresponding to each namespace by sending the first configuration command to the flash memory device. For example, the priority corresponding to namespace A is set to the first priority, the priority corresponding to namespace B is set to the second priority, and the priority corresponding to namespace C is set to the third priority, wherein the first priority is higher than the second priority, and the second priority is higher than the third priority.

[0092] In an embodiment of the present application, the host sends the priority corresponding to each namespace to the flash memory device through a first configuration command, so that the flash memory device sets the IO queue depth corresponding to the namespace according to the priority. The present application can control the data flow of each namespace according to the priority corresponding to the namespace sent by the host, thereby improving the flow control efficiency.

[0093] Step S202: Determine the first IO queue depth corresponding to each namespace according to the priority of each namespace;

[0094] For details, please refer to Figure 4 , Figure 4 yes Figure 2 A detailed flow chart of step S202 in FIG.

[0095] like Figure 4 As shown, step S202: according to the priority of each namespace, determining the first IO queue depth corresponding to each namespace one by one, including:

[0096] Step S221: Obtain the queue depth of the submission queue;

[0097] Specifically, the host obtains the queue depth of the submission queue. The submission queue (SQ) in the NVMe protocol is a key component in NVMe technology. It is responsible for carrying the commands submitted by the host to the NVMe controller. These commands can be I / O operations, such as reading and writing data, refreshing data, etc., or management commands, such as obtaining SSD capabilities, attribute queries, etc. The queue depth of the submission queue refers to the maximum number of commands that can exist in the submission queue at the same time. In addition, the submission queue SQ and the related completion queue (CQ) together constitute a pair of queues in the NVMe protocol, which are used to process command submission and status feedback between the host and the controller.

[0098] Step S222: Determine the first IO queue depth according to the queue depth of the submission queue and the coefficient corresponding to the priority of the namespace;

[0099] For details, please refer to Figure 5 , Figure 5 yes Figure 4 A detailed flow chart of step S222 in FIG.

[0100] like Figure 5 As shown, step S222: determining the first IO queue depth according to the queue depth of the submission queue and the coefficient corresponding to the priority of the namespace, including:

[0101] Step S2221: Obtain the priority of the namespace and the coefficient corresponding to the priority of the namespace;

[0102] Specifically, the priority of the namespace is determined by the host. The host uses different namespaces for different business types. That is, the host can define the priority of each namespace according to the business type corresponding to each namespace. For example, assume that the host creates three namespaces: namespace A, namespace B, and namespace C, and sets the priority corresponding to each namespace. The priority corresponding to namespace A is set to the first priority, the priority corresponding to namespace B is set to the second priority, and the priority corresponding to namespace C is set to the third priority, wherein the first priority is higher than the second priority, and the second priority is higher than the third priority. The host sets and obtains the priority of the namespace through the first configuration command. The priority of each namespace corresponds to a coefficient. For example, the first priority corresponds to the first coefficient, the second priority corresponds to the second coefficient, and the third priority corresponds to the third coefficient. The higher the priority, the larger the coefficient corresponding to the priority. Assuming that the first priority is higher than the second priority and the second priority is higher than the third priority, the first coefficient is greater than the second coefficient, and the second coefficient is greater than the third coefficient.

[0103] In an embodiment of the present application, the first configuration command includes an NVMe Set Feature command. The NVMe SetFeature command is a command used to configure and manage NVMe solid-state drive (SSD) features. Through this command, the host can obtain status information of the flash memory device and modify certain settings in the flash memory device. In an embodiment of the present application, the NVMe Set Feature command is used to set the priority corresponding to each namespace. The host sets the priority corresponding to each namespace by sending a first configuration command to the flash memory device. For example, the priority corresponding to namespace A is set to the first priority, the priority corresponding to namespace B is set to the second priority, and the priority corresponding to namespace C is set to the third priority, wherein the first priority is higher than the second priority, and the second priority is higher than the third priority.

[0104] Step S2222: If the priority of the namespace is the first priority, the first IO queue depth corresponding to the namespace is determined as the first coefficient * the queue depth of the submission queue;

[0105] Specifically, the priority of the namespace is divided into three priorities, namely, the first priority, the second priority and the third priority, wherein the first priority is higher than the second priority, and the second priority is higher than the third priority, that is, the priority of the namespace includes the first priority, the second priority and the third priority. If the priority of the namespace is the first priority, the first IO queue depth corresponding to the namespace is determined as the first coefficient * the queue depth of the submission queue, wherein the first coefficient can be set according to actual needs, for example, the first coefficient is set to 0.5.

[0106] Step S2223: If the priority of the namespace is the second priority, the first IO queue depth corresponding to the namespace is determined as the second coefficient * the queue depth of the submission queue;

[0107] Specifically, if the priority of the namespace is the second priority, the first IO queue depth corresponding to the namespace is determined as the second coefficient * the queue depth of the submission queue, wherein the second coefficient is less than the first coefficient. The second coefficient can be set according to actual needs. For example, when the first coefficient is 0.5, the second coefficient can be set to 0.25.

[0108] Step S2224: if the priority of the namespace is the third priority, the first IO queue depth corresponding to the namespace is determined to be the third coefficient * the queue depth of the submission queue;

[0109] Specifically, if the priority of the namespace is the third priority, the first IO queue depth corresponding to the namespace is determined as the third coefficient * the queue depth of the submission queue, wherein the second coefficient is less than the first coefficient, and the second coefficient can be set according to actual needs. For example, when the second coefficient is 0.25, the second coefficient can be set to 0.125.

[0110] In an embodiment of the present application, the first IO queue depth corresponding to the namespace is determined according to the priority of the namespace. Preferably, when the priority of the namespace is higher, the first IO queue depth is larger. For example, assuming that the queue depth of the submission queue is 1024, and the first coefficient, the second coefficient, and the third coefficient are set to 0.5, 0.25, and 0.125 respectively, the first IO queue depth of the namespace of the first priority is determined to be 0.5*1024, that is, 512, the first IO queue depth of the namespace of the second priority is determined to be 0.25*1024, that is, 256, and the first IO queue depth of the namespace of the third priority is determined to be 0.125*1024, that is, 128.

[0111] In the embodiment of the present application, there is a corresponding relationship between the priority and the coefficient, the first priority corresponds to the first coefficient, the second priority corresponds to the second coefficient, and the third priority corresponds to the third coefficient. The first coefficient, the second coefficient, and the third coefficient can all be set according to actual needs, wherein the higher the priority, the larger the corresponding coefficient, that is, the first coefficient is greater than the second coefficient, and the second coefficient is greater than the third coefficient.

[0112] In some embodiments, the priority of the namespace can also be divided into more than three, for example, the priority of the namespace can be divided into a first priority, a second priority, a third priority and a fourth priority. It can be understood that the number of priorities of the namespace can be set according to actual needs, and this application does not limit this.

[0113] It can be understood that each priority corresponds to a coefficient, and there is a corresponding relationship between the priority and the coefficient. The higher the priority, the larger the corresponding coefficient, so that a namespace with a higher priority can use a higher queue depth.

[0114] In an embodiment of the present application, the submission queue is a circular queue stored in a whole block of continuous memory space, which is used to store data that will perform I / O operations. The queue depth of the submission queue is the maximum amount of data that it can store for I / O operations. By determining the first IO queue depth based on the queue depth of the submission queue and the coefficient corresponding to the priority of the namespace, the present application can better control the data flow of the namespace.

[0115] Step S203: determining a first maximum number of concurrent IO requests corresponding to each block device according to a first IO queue depth corresponding to each namespace;

[0116] Specifically, a block device refers to a flash memory device divided into multiple independent storage units in the form of blocks. Each block device can perform read and write operations independently. This division method allows the operating system to manage storage space more effectively and improve storage efficiency and performance. The working principle of the block device is mainly based on the storage mechanism of flash memory. The controller manages the read and write operations of data to achieve high-speed data access.

[0117] In an embodiment of the present application, each namespace corresponds to a block device one by one. After the first IO queue depth corresponding to the namespace is obtained according to the priority of the namespace, the first maximum concurrent IO request number corresponding to each block device is determined according to the first IO queue depth corresponding to each namespace, wherein the first maximum concurrent IO request number corresponding to the block device refers to the maximum value of the number of IO requests that the block device can process simultaneously, and the first IO data volume is less than or equal to the first maximum concurrent IO request number. For example, assuming that the first IO queue depth corresponding to a namespace is 512, the first maximum concurrent IO request number of the block device corresponding to the namespace is determined to be 512.

[0118] Step S204: determining a first IO data volume to be sent to each block device according to a first maximum number of concurrent IO requests corresponding to each block device;

[0119] Specifically, according to the first maximum concurrent IO request number corresponding to each block device, the first IO data amount sent to each block device is determined, wherein the first IO data amount is less than or equal to the first maximum concurrent IO request number. Assume that there are currently three block devices: the first block device, the second block device, and the third block device. The first maximum concurrent IO request number corresponding to the first block device is 512, the first maximum concurrent IO request number corresponding to the second block device is 256, and the first maximum concurrent IO request number corresponding to the third block device is 128. At this time, there are several situations:

[0120] (1) When the total amount of IO data that needs to be sent is greater than the sum of the first maximum concurrent IO request numbers corresponding to all block devices, for example, when the total amount of IO data that needs to be sent is 996, the first IO data amount to be sent to the first block device is determined to be 512, the first IO data amount to be sent to the second block device is 256, and the first IO data amount to be sent to the third block device is 128. The remaining IO data amount is 100. Since the current IO data amount of all block devices is equal to the first maximum concurrent IO request number corresponding to each block device, the remaining IO data will enter the waiting queue, that is, the IO data will be suspended on the host (IO It is understandable that on the Host, the input / output operation is suspended for some reason and cannot be completed in time. It is necessary to wait for the previous IO operation to be completed before the suspended IO operation can be processed. After the first 896 IO data are sent to the corresponding block device, the remaining 100 IO data will be sent to the block device with the largest number of concurrent IO requests to ensure that the IO data is sent to the block device corresponding to the namespace with the highest priority first.

[0121] (2) When the total amount of IO data that needs to be sent is equal to the sum of the first maximum concurrent IO request numbers corresponding to all block devices, first select the block device with the largest first maximum concurrent IO request number, that is, the first block device, and the first IO data amount sent to the first block device is 512. Then select the second block device, and the first IO data amount sent to the second block device is 256. Finally, select the block device with the smallest first maximum concurrent IO request number, that is, the third block device, and the first IO data amount sent to the third block device is 128.

[0122] (3) When the total amount of IO data that needs to be sent at this time is less than the sum of the first maximum concurrent IO request numbers corresponding to all block devices, for example, the total amount of IO data that needs to be sent at this time is 500, then the block device with the largest first maximum concurrent IO request number, that is, the first block device, is selected first, and the amount of first IO data sent to the first block device is 500, and there is no need to send IO data to the second block device and the third block device; for another example, if the total amount of IO data that needs to be sent at this time is 700, then the block device with the largest first maximum concurrent IO request number, that is, the first block device, is selected first, and the amount of first IO data sent to the first block device is 512. At this time, there are still 188 IO data left, and then the second block device is selected, and the amount of first IO data sent to the second block device is 188, and there is no need to send IO data to the third block device.

[0123] Please refer to Figure 6 , Figure 6 It is a flowchart of a method for detecting whether the amount of IO data corresponding to the current namespace exceeds a preset threshold value provided by an embodiment of the present application;

[0124] like Figure 6 As shown in the figure, the process of detecting whether the IO data volume corresponding to the current namespace exceeds the preset threshold includes:

[0125] Step S601: Obtain the number of concurrent IO requests corresponding to the current namespace;

[0126] Specifically, the IO data corresponding to the current namespace is obtained, wherein the IO data corresponding to the namespace refers to the IO data currently sent to the block device corresponding to the namespace.

[0127] Step S602: Detect whether the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold;

[0128] Specifically, the firmware module (Firmware, FW) in the flash memory device detects whether the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold, where the preset threshold = (the sum of the number of concurrent IO requests corresponding to all namespaces / the total number of namespaces) * the preset coefficient, where the sum of the number of concurrent IO requests corresponding to all namespaces / the total number of namespaces is the average value of the number of concurrent IO requests corresponding to each namespace, and the preset coefficient can be set according to actual needs. For example, the preset coefficient is set to 2, and this application does not limit this. If it is detected that the number of concurrent IO requests corresponding to the current namespace exceeds the preset threshold, step S604 is entered; if it is detected that the number of concurrent IO requests corresponding to the current namespace does not exceed the preset threshold, step S603 is entered.

[0129] In an embodiment of the present application, when the firmware module detects that the number of concurrent IO requests of a certain namespace is too large, that is, the number of concurrent IO requests of a certain namespace exceeds a preset threshold, affecting the bandwidth and latency of IO in other namespaces, the IO queue depth corresponding to the namespace will be adjusted, thereby achieving flow control of IO data for the namespace. By detecting whether the amount of IO data corresponding to the current namespace exceeds the preset threshold, the IO queue depth corresponding to the namespace is dynamically adjusted. Since the larger the IO queue depth corresponding to the namespace, the higher the priority, the dynamic adjustment operation can indirectly adjust the priority of the namespace according to the current amount of IO data in the namespace.

[0130] Step S603: Do not adjust the IO queue depth corresponding to the namespace;

[0131] Specifically, if it is detected that the number of concurrent IO requests corresponding to the current namespace does not exceed the preset threshold, it means that the number of concurrent IO requests in no namespace exceeds the preset threshold, and will not affect the IO bandwidth and latency of other namespaces. Therefore, there is no need to adjust the IO queue depth corresponding to the namespace.

[0132] Step S604: adjusting the IO queue depth corresponding to the namespace to the second IO queue depth;

[0133] Specifically, if it is detected that the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold, the IO queue depth corresponding to the namespace is adjusted from the first IO queue depth to the second IO queue depth, wherein the second IO queue depth is less than the first IO queue depth. For example, assuming that the first IO queue depth is 256, the second IO queue depth can be adjusted to 128.

[0134] Step S605: According to the second IO queue depth, the maximum number of concurrent IO requests corresponding to the block device is adjusted to the second maximum number of concurrent IO requests;

[0135] For details, please refer to Figure 7 , Figure 7 yes Figure 6 A detailed flow chart of step S605 in FIG.

[0136] like Figure 7 As shown, step S605: according to the second IO queue depth, the maximum number of concurrent IO requests corresponding to the block device is adjusted to the second maximum number of concurrent IO requests, including:

[0137] Step S651: after receiving the first asynchronous event notification sent by the flash memory device, sending a namespace identification command to the flash memory device to make the flash memory device return to the second IO queue depth;

[0138] Specifically, after the flash memory device detects that the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold and adjusts the IO queue depth corresponding to the namespace, the flash memory device sends a first asynchronous event to the host. After receiving the first asynchronous event notification sent by the flash memory device, the host sends a namespace identification command to the flash memory device, so that the flash memory device returns a second IO queue depth to the host, wherein the first asynchronous event refers to an asynchronous event defined by the NVMe protocol. The flash memory device can notify the host to update the IO queue depth corresponding to the namespace by sending an asynchronous event defined by the NVMe protocol to the host, for example, notifying the host to update the IO queue depth of the namespace from the first IO queue depth to the second IO queue depth. The namespace identification command includes the nvme identify name space command in the NVMe protocol. The host sends the nvmeidentify name space command to the flash memory device, and the flash memory device returns the second IO queue depth (Ioqueue depth) of the namespace, so that the host adjusts the maximum number of concurrent IO requests corresponding to the block device to the second maximum number of concurrent IO requests (nr_requst) according to the second IO queue depth.

[0139] Step S652: According to the second IO queue depth, the maximum number of concurrent IO requests corresponding to the block device is adjusted to the second maximum number of concurrent IO requests;

[0140] Specifically, after receiving the second IO queue depth sent by the flash memory device, the host adjusts the maximum concurrent IO request number corresponding to the block device from the first maximum concurrent IO request number to the second maximum concurrent IO request number according to the second IO queue depth, wherein the second maximum concurrent IO request number is equal to the second IO queue depth. For example, assuming that the second IO queue depth is 256, the second maximum concurrent IO request number is determined to be 256.

[0141] Please refer to Figure 8 , Figure 8 It is a flowchart of adjusting the IO queue depth of a namespace according to a changed priority provided by an embodiment of the present application;

[0142] like Figure 8 As shown in the figure, the process of adjusting the IO queue depth of the namespace according to the changed priority includes:

[0143] Step S801: Send a second configuration command to the flash memory device;

[0144] Specifically, the second configuration command refers to the NVMe Set Feature command. The NVMe Set Feature command is a command used to configure and manage NVMe solid-state drive (SSD) features. Through this command, the host can obtain the status information of the flash memory device and modify certain settings in the flash memory device. In an embodiment of the present application, the NVMe SetFeature command is used to set the priority corresponding to each namespace to the changed priority. The second configuration command includes the changed priority. The host sets the priority corresponding to each namespace to the changed priority by sending the second configuration command to the flash memory device. For example, the priority of namespace A before the change is the first priority, and the priority of namespace B before the change is the second priority. If the priority of namespace A after the change is the second priority and the priority of namespace B after the change is the first priority, then namespace A is changed from the first priority to the second priority, and the priority of namespace B is changed from the second priority to the first priority.

[0145] Step S802: adjusting the IO queue depth of the namespace to a third IO queue depth according to the changed priority;

[0146] Specifically, according to the changed priority, the IO queue depth of the namespace is adjusted from the first IO queue depth to the third IO queue depth. For example, assuming that when namespace A is the first priority, the first IO queue depth corresponding to namespace A is 512, and when namespace B is the second priority, the first IO queue depth corresponding to namespace B is 256, through the second configuration command, the priority of namespace A is changed to the second priority, the priority of namespace B is changed to the first priority, and the first IO queue depth corresponding to namespace A is adjusted to 256, and the first IO queue depth corresponding to namespace B is adjusted to 512.

[0147] Step S803: determining a third maximum number of concurrent IO requests corresponding to each block device according to the third IO queue depth;

[0148] For details, please refer to Fig. 9 , Fig. 9 yes Figure 8 A detailed flow chart of step S803 in FIG.

[0149] like Fig. 9 As shown, step S803: determining the third maximum number of concurrent IO requests corresponding to each block device according to the third IO queue depth, including:

[0150] Step S831: after receiving the second asynchronous event notification sent by the flash memory device, sending a namespace identification command to the flash memory device to make the flash memory device return to the third IO queue depth;

[0151] Specifically, after the flash memory device adjusts the IO queue depth of the namespace to the third IO queue depth according to the changed priority, the second asynchronous event notification is sent to the host. After receiving the second asynchronous event notification sent by the flash memory device, the host sends a namespace identification command to the flash memory device, so that the flash memory device returns the third IO queue depth to the host, wherein the second asynchronous event refers to an asynchronous event defined by the NVMe protocol. The flash memory device can notify the host to update the IO queue depth corresponding to the namespace by sending an asynchronous event defined by the NVMe protocol to the host, for example, notifying the host to update the IO queue depth of the namespace from the first IO queue depth to the third IO queue depth, the namespace identification command includes the nvme identify name space command in the NVMe protocol, the host sends the nvme identify name space command to the flash memory device, and the flash memory device returns the third IO queue depth (Io queue depth) of the namespace, so that the host adjusts the maximum number of concurrent IO requests corresponding to the block device to the third maximum number of concurrent IO requests (nr_requst) according to the third IO queue depth.

[0152] Step S832: determining a third maximum number of concurrent IO requests corresponding to the block device according to the third IO queue depth;

[0153] Specifically, after receiving the third IO queue depth sent by the flash memory device, the host adjusts the maximum concurrent IO request number corresponding to the block device from the first maximum concurrent IO request number to the third maximum concurrent IO request number according to the third IO queue depth, wherein the third maximum concurrent IO request number is equal to the third IO queue depth. For example, assuming that the third IO queue depth is 512, the third maximum concurrent IO request number is determined to be 512.

[0154] Step S804: determining the third IO data volume sent to each block device according to the third maximum concurrent IO request quantity corresponding to each block device;

[0155] Specifically, according to the third maximum number of concurrent IO requests corresponding to each block device, the third IO data volume sent to each block device is determined, wherein the third IO data volume is less than or equal to the third maximum number of concurrent IO requests. Assume that there are currently three block devices: the first block device, the second block device, and the third block device. The third maximum number of concurrent IO requests corresponding to the first block device is 512, the third maximum number of concurrent IO requests corresponding to the second block device is 256, and the third maximum number of concurrent IO requests corresponding to the third block device is 128. At this time, there are several situations:

[0156] (1) When the total amount of IO data that needs to be sent is greater than the sum of the third maximum concurrent IO request numbers corresponding to all block devices, for example, when the total amount of IO data that needs to be sent is 996, it is determined that the third IO data amount sent to the first block device is 512, the third IO data amount sent to the second block device is 256, and the third IO data amount sent to the third block device is 128. The remaining IO data amount is 100. Since the current IO data amount of all block devices is equal to the third maximum concurrent IO request number corresponding to each block device, the remaining IO data will enter the waiting queue, that is, the IO data will be suspended on the host (IO It is understandable that on the Host, the input / output operation is suspended for some reason and cannot be completed in time. It is necessary to wait for the previous IO operation to be completed before the suspended IO operation can be processed. After the first 896 IO data are sent to the corresponding block device, the remaining 100 IO data will be sent to the block device with the third largest number of concurrent IO requests to ensure that the IO data is sent to the block device corresponding to the namespace with the highest priority first.

[0157] (2) When the total amount of IO data that needs to be sent is equal to the sum of the third maximum concurrent IO request numbers corresponding to all block devices, first select the block device with the largest third maximum concurrent IO request number, that is, the first block device, and send 512 of the third IO data to the first block device. Then select the second block device, and send 256 of the third IO data to the second block device. Finally, select the block device with the smallest third maximum concurrent IO request number, that is, the third block device, and send 128 of the third IO data to the third block device.

[0158] (3) When the total amount of IO data that needs to be sent at this time is less than the sum of the third maximum concurrent IO request numbers corresponding to all block devices, for example, the total amount of IO data that needs to be sent at this time is 500, then the block device with the largest third maximum concurrent IO request number, that is, the first block device, is selected first, and the third IO data amount sent to the first block device is 500, and there is no need to send IO data to the second block device and the third block device; for another example, if the total amount of IO data that needs to be sent at this time is 700, then the block device with the largest third maximum concurrent IO request number, that is, the first block device, is selected first, and the third IO data amount sent to the first block device is 512. At this time, there are still 188 IO data left, and then the second block device is selected, and the third IO data amount sent to the second block device is 188, and there is no need to send IO data to the third block device.

[0159] In an embodiment of the present application, the host changes the priority of the namespace, thereby adjusting the IO queue depth corresponding to the block device. The host does not need to make major modifications and adaptations, and the host's upper-level applications do not need to perform flow control. The present application can control the data flow of the namespace in real time and improve the flexibility of the system.

[0160] Please refer to Fig.10 , Fig.10 is an interaction timing diagram between a host and a flash memory device provided in an embodiment of the present application;

[0161] like Fig.10 As shown in the figure, the interaction sequence between the host and the flash device includes:

[0162] Step S1001: the host sends a second configuration command to the flash memory device;

[0163] Specifically, the second configuration command refers to the NVMe Set Feature command. The NVMe Set Feature command is a command used to configure and manage NVMe solid-state drive (SSD) features. Through this command, the host can obtain the status information of the flash memory device and modify certain settings in the flash memory device. In an embodiment of the present application, the NVMe SetFeature command is used to set the priority corresponding to each namespace to the changed priority. The second configuration command includes the changed priority. The host sets the priority corresponding to each namespace to the changed priority by sending the second configuration command to the flash memory device. For example, the priority of namespace A before the change is the first priority, and the priority of namespace B before the change is the second priority. If the priority of namespace A after the change is the second priority and the priority of namespace B after the change is the first priority, then namespace A is changed from the first priority to the second priority, and the priority of namespace B is changed from the second priority to the first priority.

[0164] Step S1002: adjusting the IO queue depth of the namespace to a third IO queue depth according to the changed priority;

[0165] Specifically, after receiving the second configuration command sent by the host, the flash memory device adjusts the IO queue depth of the namespace from the first IO queue depth to the third IO queue depth according to the changed priority. For example, assuming that when namespace A is the first priority, the first IO queue depth corresponding to namespace A is 512, and when namespace B is the second priority, the first IO queue depth corresponding to namespace B is 256, through the second configuration command, the priority of namespace A is changed to the second priority, the priority of namespace B is changed to the first priority, and the first IO queue depth corresponding to namespace A is adjusted to 256, and the first IO queue depth corresponding to namespace B is adjusted to 512.

[0166] Step S1003: the flash memory device sends a second asynchronous event notification to the host;

[0167] Specifically, after the flash memory device adjusts the IO queue depth of the namespace to the third IO queue depth according to the changed priority, the second asynchronous event notification is sent to the host.

[0168] Step S1004: the host sends a namespace identification command to the flash memory device;

[0169] Specifically, after receiving the second asynchronous event notification sent by the flash memory device, the host sends a namespace identification command to the flash memory device, so that the flash memory device returns the third IO queue depth to the host.

[0170] Step S1005: the flash memory device sends a third IO queue depth to the host;

[0171] Specifically, the namespace identification command includes the nvme identify name space command in the NVMe protocol. The host sends the nvme identify name space command to the flash memory device, and the flash memory device returns the third IO queue depth (Io queue depth) of the namespace, so that the host adjusts the maximum concurrent IO request number corresponding to the block device to the third maximum concurrent IO request number (nr_requst) according to the third IO queue depth. For example, assuming that the third IO queue depth is 512, the third maximum concurrent IO request number is determined to be 512.

[0172] Step S1006: Generate a block device according to the third IO queue depth;

[0173] Specifically, after receiving the third IO queue depth sent by the flash memory device, the host generates a block device according to the third IO queue depth, wherein generating the block device refers to generating the maximum number of concurrent IO requests for the block device (nr_requst field), the nr_requst field, the nr_requests field is a parameter for controlling the number of requests that can be queued for each IO operation of the block device, that is, the maximum number of concurrent IO requests, and the maximum number of concurrent IO requests corresponding to the block device is adjusted from the first maximum number of concurrent IO requests to the third maximum number of concurrent IO requests, wherein the third maximum number of concurrent IO requests is equal to the third IO queue depth.

[0174] Please refer to Fig.11 , Fig.11 is another interaction timing diagram between a host and a flash memory device provided in an embodiment of the present application;

[0175] like Fig.11 As shown in the figure, the interaction sequence between the host and the flash device includes:

[0176] Step S1101: Detect whether the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold;

[0177] Specifically, the firmware module (Firmware, FW) in the flash memory device detects whether the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold. When it is detected that the number of concurrent IO requests corresponding to the current namespace exceeds the preset threshold, step S1002 is entered, wherein the preset threshold = (the sum of the number of concurrent IO requests corresponding to all namespaces / the total number of namespaces) * the preset coefficient, wherein the sum of the number of concurrent IO requests corresponding to all namespaces / the total number of namespaces is the average value of the number of concurrent IO requests corresponding to each namespace. The preset coefficient can be set according to actual needs. For example, the preset coefficient is set to 2, and this application does not limit this.

[0178] Step S1102: adjusting the IO queue depth corresponding to the namespace to the second IO queue depth;

[0179] Specifically, if the flash memory device detects that the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold, the IO queue depth corresponding to the namespace is adjusted from the first IO queue depth to the second IO queue depth, wherein the second IO queue depth is less than the first IO queue depth. For example, assuming that the first IO queue depth is 256, the second IO queue depth can be adjusted to 128.

[0180] Step S1103: the flash memory device sends a first asynchronous event notification to the host;

[0181] Specifically, after the flash memory device adjusts the IO queue depth of the namespace to the second IO queue depth according to the changed priority, the first asynchronous event notification is sent to the host.

[0182] Step S1104: the host sends a namespace identification command to the flash memory device;

[0183] Specifically, after receiving the second asynchronous event notification sent by the flash memory device, the host sends a namespace identification command to the flash memory device, so that the flash memory device returns the third IO queue depth to the host.

[0184] Step S1105: the flash memory device sends a second IO queue depth to the host;

[0185] Specifically, the namespace identification command includes the nvme identify name space command in the NVMe protocol. The host sends the nvme identify name space command to the flash memory device, and the flash memory device returns the second IO queue depth (Io queue depth) of the namespace, so that the host adjusts the maximum concurrent IO request number corresponding to the block device to the second maximum concurrent IO request number (nr_requst) according to the second IO queue depth.

[0186] Step S1106: Generate a block device according to the second IO queue depth;

[0187] Specifically, after receiving the second IO queue depth sent by the flash memory device, the host generates a block device according to the second IO queue depth, wherein generating the block device refers to generating the maximum concurrent IO request number (nr_requst field) of the block device, the nr_requst field, the nr_requests field is a parameter that controls the number of requests that can be queued for each IO operation of the block device, that is, the maximum number of concurrent IO requests, and adjusts the maximum concurrent IO request number corresponding to the block device from the first maximum concurrent IO request number to the second maximum concurrent IO request number, wherein the second maximum concurrent IO request number is equal to the second IO queue depth. For example, assuming that the second IO queue depth is 256, the second maximum concurrent IO request number is determined to be 256.

[0188] In an embodiment of the present application, the present application provides a namespace data processing method, which is applied to a flash memory device, wherein the flash memory device includes at least two namespaces, each namespace corresponds to a block device one by one, and the method includes: obtaining the priority of each namespace; determining the first IO queue depth corresponding to each namespace one by one according to the priority of each namespace; determining the first maximum concurrent IO request number corresponding to each block device according to the first IO queue depth corresponding to each namespace; determining the first IO data volume sent to each block device according to the first maximum concurrent IO request number corresponding to each block device, wherein the first IO data volume is less than or equal to the first maximum concurrent IO request number. The present application can determine the IO queue depth of the namespace according to the priority of the namespace, and then determine the concurrent IO request number corresponding to each namespace according to the IO queue depth, and determine the first IO data volume sent to each block device according to the first maximum concurrent IO request number corresponding to each block device. The present application can prevent the data flow of some namespaces from being too large, resulting in reduced performance to other namespaces, thereby improving the stability of the performance of the flash memory device.

[0189] Please refer to Fig.12 , Fig.12 It is a structural schematic diagram of a host provided in an embodiment of the present application;

[0190] like Fig.12 As shown, the host 10 includes one or more processors 11 and a memory 12. Fig.12 A processor 11 is taken as an example.

[0191] The processor 11 and the memory 12 may be connected via a bus or other means. Fig.12The example of connecting through bus is taken in the following.

[0192] The processor 11 is used to provide computing and control capabilities to control the host 10 to perform corresponding tasks, for example, to control the host 10 to perform the namespace data processing method in any one of the above method embodiments, the namespace data processing method,, is applied to a flash memory device, the flash memory device includes at least two namespaces, each namespace corresponds to a block device, and the method includes: obtaining the priority of each namespace; determining the first IO queue depth corresponding to each namespace according to the priority of each namespace; determining the first maximum concurrent IO request number corresponding to each block device according to the first IO queue depth corresponding to each namespace; determining the first IO data amount sent to each block device according to the first maximum concurrent IO request number corresponding to each block device, wherein the first IO data amount is less than or equal to the first maximum concurrent IO request number.

[0193] According to the priority of the namespace, the IO queue depth of the namespace is determined, and then according to the IO queue depth, the number of concurrent IO requests corresponding to each namespace is determined. According to the first maximum concurrent IO request number corresponding to each block device, the first IO data volume sent to each block device is determined. This application can prevent the data flow of some namespaces from being too large, resulting in reduced performance of other namespaces, thereby improving the stability of the performance of the flash memory device.

[0194] The processor 11 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.

[0195] The memory 12, 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 program instructions / modules corresponding to the namespace data processing method in the embodiment of the present application. The processor 11 can implement the namespace data processing method in any of the above method embodiments by running the non-transitory software programs, instructions and modules stored in the memory 12. Specifically, the memory 12 may include a volatile memory (VM), such as a random access memory (RAM); the memory 12 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD) or other non-transitory solid-state storage device; the memory 12 may also include a combination of the above types of memories.

[0196] The memory 12 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 devices. In some embodiments, the memory 12 may optionally include a memory remotely arranged relative to the processor 11, and these remote memories may be connected to the processor 11 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.

[0197] One or more modules are stored in the memory 12, and when executed by one or more processors 11, the namespace data processing method in any of the above method embodiments is executed, for example, the above described Figure 2 The steps shown.

[0198] In the embodiment of the present application, the host 10 may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output. The host 10 may also include other components for realizing device functions, which will not be described in detail here.

[0199] The embodiment of the present application also provides a non-volatile 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 namespace data processing method in the above embodiment. For example, the non-volatile 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.

[0200] The embodiment of the present application also provides a non-volatile 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 data processing method of the namespace in the above embodiment. For example, the non-volatile 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.

[0201] The present application also provides a computer program product, which includes one or more program codes, which are stored in a non-volatile computer-readable storage medium. The processor of the flash memory device reads the program code from the non-volatile computer-readable storage medium, and the processor executes the program code to complete the method steps of the namespace data processing method provided in the above embodiment.

[0202] 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 non-volatile computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0203] Through the description of the above implementation methods, a person of ordinary skill in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, can also be implemented by hardware. A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile 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.

[0204] 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 method for processing namespace data, characterized in that: Applied to a flash memory device, the flash memory device includes at least two namespaces, each of the namespaces corresponds to a block device, the method includes: Get the priority of each of the namespaces; Determine, according to the priority of each of the namespaces, a first IO queue depth corresponding to each of the namespaces; Determine a first maximum number of concurrent IO requests corresponding to each of the block devices according to a first IO queue depth corresponding to each of the namespaces; According to the first maximum number of concurrent IO requests corresponding to each of the block devices, a first IO data amount to be sent to each of the block devices is determined, wherein the first IO data amount is less than or equal to the first maximum number of concurrent IO requests.

2. The method according to claim 1, characterized in that The first maximum number of concurrent IO requests corresponding to each of the block devices is equal to the first IO queue depth corresponding to the corresponding namespace; Before obtaining the priority of each of the namespaces, the method further includes: The priority corresponding to each of the namespaces is set through a first configuration command.

3. The method according to claim 1, characterized in that: The priority of each namespace corresponds to a coefficient one by one, and determining the first IO queue depth corresponding to each namespace according to the priority of each namespace includes: Get the queue depth of the submission queue; The first IO queue depth is determined according to the queue depth of the submission queue and the coefficient corresponding to the priority of the namespace, wherein the first IO queue depth=the coefficient corresponding to the priority of the namespace*the depth of the submission queue.

4. The method according to claim 3, characterized in that The priority of the namespace includes a first priority, a second priority and a third priority, the first priority corresponds to a first coefficient, the second priority corresponds to a second coefficient, and the third priority corresponds to a third coefficient; The determining the first IO queue depth according to the queue depth of the submission queue and a coefficient corresponding to the priority of the namespace includes: If the priority of the namespace is the first priority, determining the first IO queue depth corresponding to the namespace as the first coefficient * the queue depth of the submission queue; If the priority of the namespace is the second priority, determining the first IO queue depth corresponding to the namespace as the second coefficient*the queue depth of the submission queue, wherein the second coefficient is less than the first coefficient; If the priority of the namespace is the third priority, the first IO queue depth corresponding to the namespace is determined as a third coefficient*a queue depth of the submission queue, wherein the third coefficient is smaller than the second coefficient.

5. The method according to claim 1, characterized in that The method further comprises: Detect whether the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold, wherein the preset threshold=(the sum of concurrent IO requests corresponding to all namespaces / the total number of namespaces)*preset coefficient; When it is detected that the number of concurrent IO requests corresponding to the current namespace exceeds a preset threshold, the IO queue depth corresponding to the namespace is adjusted to a second IO queue depth; According to the second IO queue depth, the maximum number of concurrent IO requests corresponding to the block device is adjusted to the second maximum number of concurrent IO requests.

6. The method according to claim 5, characterized in that The step of adjusting the maximum number of concurrent IO requests corresponding to the block device to the second maximum number of concurrent IO requests according to the second IO queue depth includes: After receiving the first asynchronous event notification sent by the flash memory device, sending a namespace identification command to the flash memory device to make the flash memory device return to the second IO queue depth; According to the second IO queue depth, the maximum number of concurrent IO requests corresponding to the block device is adjusted to the second maximum number of concurrent IO requests, wherein the second maximum number of concurrent IO requests corresponding to each block device is equal to the second IO queue depth corresponding to its corresponding namespace.

7. The method according to claim 4, characterized in that The method further comprises: Sending a second configuration command to the flash memory device, wherein the second configuration command includes a changed priority corresponding to the namespace; According to the changed priority, adjusting the IO queue depth of the namespace to a third IO queue depth; Determine a third maximum number of concurrent IO requests corresponding to each device according to the third IO queue depth; According to the third maximum number of concurrent IO requests corresponding to each of the block devices, a third IO data volume sent to each of the block devices is determined.

8. The method according to claim 7, characterized in that The determining, according to the third IO queue depth, a third maximum number of concurrent IO requests corresponding to each device includes: After receiving the second asynchronous event notification sent by the flash memory device, sending a namespace identification command to the flash memory device to make the flash memory device return to a third IO queue depth; According to the third IO queue depth, a third maximum number of concurrent IO requests corresponding to each device is determined, wherein the third IO data volume is less than or equal to the third maximum number of concurrent IO requests.

9. A namespace data processing system, characterized in that: The system comprises: A flash memory device, communicatively connected to a host, the flash memory device being used to receive a first configuration command sent by the host, wherein the first configuration command includes a priority corresponding to each namespace; determining a first IO queue depth corresponding to each namespace according to the priority of each namespace, and sending a first asynchronous event notification to the host, wherein one namespace corresponds to one first IO queue depth, and the priority is positively correlated with the first IO queue depth; A host is communicatively connected to the flash memory device, and the host is used to send a namespace identification command to the flash memory device after receiving a first asynchronous event notification sent by the flash memory device, so that the flash memory device returns a first IO queue depth to the host; determine a first maximum concurrent IO request number corresponding to the block device according to the first IO queue depth; and determine a first IO data amount to be sent to each block device according to the first maximum concurrent IO request number corresponding to each block device, wherein the first IO data amount is less than or equal to the first maximum concurrent IO request number.

10. The system according to claim 9, characterized in that The host includes a block device driver module, which is used to determine a first maximum concurrent IO request number corresponding to the block device according to the first IO queue depth; and determine a first IO data amount sent to each block device according to the first maximum concurrent IO request number corresponding to each block device, wherein the first IO data amount is less than or equal to the first maximum concurrent IO request number.

11. The system according to claim 9, characterized in that The flash memory device includes a firmware module, and the firmware module is used to detect whether the IO concurrent request corresponding to the current namespace exceeds a preset threshold, wherein the preset threshold=(the sum of the IO concurrent requests corresponding to all namespaces / the total number of namespaces)*preset coefficient; The flash memory device is further configured to adjust the IO queue depth corresponding to the namespace from the first IO queue depth to the second IO queue depth when detecting that the IO concurrent request corresponding to a certain device exceeds a preset threshold, and send a second asynchronous event notification to the host; The host is further used to send a namespace identification command to the flash memory device after receiving a second asynchronous event notification sent by the flash memory device, so that the flash memory device returns the second IO queue depth to the host; determine the second maximum concurrent IO request number corresponding to the block device according to the second IO queue depth; determine the second IO data amount to be sent to the block device according to the second maximum concurrent IO request number corresponding to the block device, wherein the second IO data amount is less than or equal to the second maximum concurrent IO request number.

12. A host, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the namespace data processing method according to any one of claims 1 to 8.

13. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer storage medium stores a computer program or instruction, and when the computer program or instruction is executed, the namespace data processing method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Methods and device for implementing QoS (Quality of Service)

    CN107346265A

  • Storage system based on NVMe equipment

    CN111722786A

  • VF dynamic scheduling method and device based on solid state disk and medium

    CN116627339A

  • Dynamic queue depth management with non-volatile memory controllers

    US20200225988A1