SPDK performance optimization thread method, device, equipment and storage medium
By creating two poller pollers in the SPDK thread model to realize CPU core sharing of NVMe-oF module and RBD module, the existing SPDK thread model has solved the problem of poor performance and excessive CPU consumption when scheduling across CPU cores. , achieving more efficient storage performance.
Patent Information
- Application Number
- CN202410014338.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-04
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-01-04
AI Technical Summary
The existing SPDK threading model has context switching when scheduling across CPU cores, which increases latency, resulting in poor performance and excessive CPU consumption.
By detecting that the NVMe-oF module creates SPDK threads on the target CPU core at initialization and creates two poller pollers on each SPDK thread, the CPU core sharing of NVMe-oF module and RBD module is realized, reducing cross-CPU cores Call overhead.
It effectively reduces CPU consumption, reduces latency, improves the performance of storage devices and the speed and efficiency of SPDK optimization threads.
Smart Images

Figure CN117931434B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage technology, and in particular to an SPDK performance optimization thread method, device, equipment and storage medium. Background Art
[0002] With the continuous development of storage technology, solid-state storage devices are gradually entering data centers. The current new generation of solid-state storage has significant advantages in performance, power consumption and rack density compared to traditional disk devices. However, compared with traditional disks, solid-state disks are expensive and cannot be used as the main storage medium in large-scale data centers. Therefore, flash storage device caching technology has become the focus of current big data storage optimization research.
[0003] The thread model of the current Storage Performance Development Kit (SPDK) is that the NVMe (Non Volatile Memory Express) over Fabrics (NVMe-oF) module and the Reliable Autonomic Distributed Object Store Block Device (RADOS Block Device, Reliable Autonomic Distributed Object Store Block Device, RBD) module use independent thread models; this solution is the native method of SPDK and is widely used in the storage field; this solution has the following defects: 1. It takes up more CPU; 2. The performance is relatively poor; Defect 1 is caused by the NVMe-oF module using a part of the CPU cores and the RBD module using another part of the CPU cores; the two parts of the CPU cores will not overlap, so the total usage of the CPU cores is the superposition of the two; Defect 2 is caused by the fact that when processing commands, the NVMe-oF module and the RBD module are scheduled across CPU cores, there is context switching, and the delay is increased. Summary of the invention
[0004] The main purpose of the present invention is to provide an SPDK performance optimization thread method, device, equipment and storage medium, aiming to solve the technical problems in the prior art that the original sound of the SPDK thread needs to occupy more CPU, the performance is relatively poor, there is context switching when scheduling across CPU cores, the delay is increased, and the thread processing efficiency is low.
[0005] In a first aspect, the present invention provides an SPDK performance optimization thread method, the SPDK performance optimization thread method comprising the following steps:
[0006] When the NVMe-oF module is detected and initialized, an SPDK thread is created on the target CPU core, and two pollers are created on each SPDK thread;
[0007] After receiving the execution command through the first poller, the execution command is handed over to the autonomous distributed object storage block device RBD module for processing;
[0008] The RBD module is polled by a second poller to pull the processed commands that have been processed in the RBD module, and the processed commands are sent to the NVMe-oF module for thread processing.
[0009] Optionally, when the NVMe-oF module is detected to be initialized, an SPDK thread is created on the target CPU core, and two pollers are created on each SPDK thread, including:
[0010] When the NVMe-oF module is detected to be initialized, the initialization interface of the data plane development kit DPDK is called;
[0011] When the initialization interface is executed, an SPDK thread is created on each specified target CPU core;
[0012] Create two pollers on each SPDK thread.
[0013] Optionally, when the initialization interface is executed, after creating an SPDK thread on each specified target CPU core, the SPDK performance optimization thread method further includes:
[0014] Modify the affinity parameter of the SPDK thread and bind the thread to the corresponding target CPU core for execution.
[0015] Optionally, two pollers are created on each SPDK thread, including:
[0016] Call the SPDK_POLLER_REGISTER interface of each SPDK, and obtain the execution function and test cycle of the poller from the interface parameters of the SPDK_POLLER_REGISTER interface;
[0017] Two pollers are created on each SPDK thread according to the execution function and the test cycle.
[0018] Optionally, after receiving the execution command through the first poller, handing the execution command to the autonomous distributed object storage block device RBD module for processing includes:
[0019] Polling the verbs interface or the socket interface through the first poller, and processing the execution instruction received by the network card through the verbs interface or the socket interface;
[0020] Sending the execution instruction to the NVMe-oF module so that the NVMe-oF module unpacks the execution instruction to obtain an unpacked instruction;
[0021] The unpacked instructions are handed over to the autonomous distributed object storage block device RBD module for processing.
[0022] Optionally, delivering the unpacked instruction to an autonomous distributed object storage block device (RBD) module for processing includes:
[0023] The unpacked instruction is sent to an autonomous distributed object storage block device (RBD) module, so that the RBD module performs a corresponding disk operation according to the unpacked instruction.
[0024] Optionally, polling the RBD module through a second poller, pulling the processed commands that have been processed in the RBD module, and sending the processed commands to the NVMe-oF module for thread processing includes:
[0025] Polling the RBD module through a second poller to pull processed commands that have been processed in the RBD module;
[0026] The processed command is sent to the NVMe-oF module to re-encapsulate the processed command through the NVMe-oF module, obtain the encapsulated command response, and call the verbs interface or socket interface to reply the command response to the host through the network card.
[0027] In a second aspect, to achieve the above-mentioned purpose, the present invention further proposes an SPDK performance optimization thread device, wherein the SPDK performance optimization thread device comprises:
[0028] Create a module to detect when the NVMe-oF module is initialized, create an SPDK thread on the target CPU core, and create two pollers on each SPDK thread;
[0029] The RBD processing module is used to hand over the execution command to the autonomous distributed object storage block device RBD module for processing after receiving the execution command through the first poller;
[0030] The thread processing module is used to poll the RBD module through a second poller, pull the processed commands that have been processed in the RBD module, and send the processed commands to the NVMe-oF module for thread processing.
[0031] In a third aspect, to achieve the above-mentioned purpose, the present invention also proposes an SPDK performance optimization thread device, wherein the SPDK performance optimization thread device comprises: a memory, a processor, and an SPDK performance optimization thread program stored in the memory and executable on the processor, wherein the SPDK performance optimization thread program is configured to implement the steps of the SPDK performance optimization thread method as described above.
[0032] In a fourth aspect, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which an SPDK performance optimization thread program is stored, and when the SPDK performance optimization thread program is executed by a processor, the steps of the SPDK performance optimization thread method described above are implemented.
[0033] The SPDK performance optimization thread method proposed in the present invention creates an SPDK thread on the target CPU core when the NVMe-oF module is detected to be initialized, and creates two pollers on each SPDK thread; after receiving the execution command through the first poller, the execution command is handed over to the autonomous distributed object storage block device RBD module for processing; the RBD module is polled by the second poller to pull the processed commands that have been processed in the RBD module, and the processed commands are sent to the NVMe-oF module for thread processing; the NVMe-oF module and the RBD module can share the CPU core, reduce the CPU consumption, reduce the overhead caused by cross-CPU core calls, reduce the delay, improve the performance of the storage device, and improve the speed and efficiency of the SPDK optimization thread. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;
[0035] Figure 2 It is a flowchart of the first embodiment of the SPDK performance optimization thread method of the present invention;
[0036] Figure 3 A schematic diagram of polling processing based on SPDK in the SPDK performance optimization thread method of the present invention;
[0037] Figure 4 A schematic diagram of the flow chart of the second embodiment of the SPDK performance optimization thread method of the present invention;
[0038] Figure 5 A schematic diagram of a flow chart of a third embodiment of the SPDK performance optimization thread method of the present invention;
[0039] Figure 6 A schematic diagram of a flow chart of a fourth embodiment of a method for optimizing thread performance of SPDK according to the present invention;
[0040] Figure 7 A schematic diagram of a flow chart of a fifth embodiment of a method for optimizing thread performance of SPDK according to the present invention;
[0041] Figure 8 This is a functional module diagram of the first embodiment of the SPDK performance optimization thread device of the present invention.
[0042] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0043] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0044] The solution of the embodiment of the present invention is mainly: by detecting that the NVMe-oF module is initialized, an SPDK thread is created on the target CPU core, and two pollers are created on each SPDK thread; after receiving the execution command through the first poller, the execution command is handed over to the autonomous distributed object storage block device RBD module for processing; the RBD module is polled by the second poller to pull the processed commands that have been processed in the RBD module, and the processed commands are sent to the NVMe-oF module for thread processing; the NVMe-oF module and the RBD module can share the CPU core, reduce the CPU consumption, reduce the overhead caused by cross-CPU core calls, reduce the delay, improve the performance of the storage device, and improve the speed and efficiency of the SPDK optimization thread, which solves the technical problems in the prior art that the original sound of the SPDK thread needs to occupy more CPU, the performance is relatively poor, there is context switching when scheduling across CPU cores, the delay is increased, and the thread processing efficiency is low.
[0045] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0046] like Figure 1As shown, the device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (Non-Volatile Memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
[0047] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0048] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating device, a network communication module, a user interface module, and an SPDK performance optimization thread program.
[0049] The device of the present invention calls the SPDK performance optimization thread program stored in the memory 1005 through the processor 1001, and performs the following operations:
[0050] When the NVMe-oF module is detected and initialized, an SPDK thread is created on the target CPU core, and two pollers are created on each SPDK thread;
[0051] After receiving the execution command through the first poller, the execution command is handed over to the autonomous distributed object storage block device RBD module for processing;
[0052] The RBD module is polled by a second poller to pull the processed commands that have been processed in the RBD module, and the processed commands are sent to the NVMe-oF module for thread processing.
[0053] The device of the present invention calls the SPDK performance optimization thread program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0054] When the NVMe-oF module is detected to be initialized, the initialization interface of the data plane development kit DPDK is called;
[0055] When the initialization interface is executed, an SPDK thread is created on each specified target CPU core;
[0056] Create two pollers on each SPDK thread.
[0057] The device of the present invention calls the SPDK performance optimization thread program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0058] Modify the affinity parameter of the SPDK thread and bind the thread to the corresponding target CPU core for execution.
[0059] The device of the present invention calls the SPDK performance optimization thread program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0060] Call the SPDK_POLLER_REGISTER interface of each SPDK, and obtain the execution function and test cycle of the poller from the interface parameters of the SPDK_POLLER_REGISTER interface;
[0061] Two pollers are created on each SPDK thread according to the execution function and the test cycle.
[0062] The device of the present invention calls the SPDK performance optimization thread program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0063] Polling the verbs interface or the socket interface through the first poller, and processing the execution instruction received by the network card through the verbs interface or the socket interface;
[0064] Sending the execution instruction to the NVMe-oF module so that the NVMe-oF module unpacks the execution instruction to obtain an unpacked instruction;
[0065] The unpacked instructions are handed over to the autonomous distributed object storage block device RBD module for processing.
[0066] The device of the present invention calls the SPDK performance optimization thread program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0067] The unpacked instruction is sent to an autonomous distributed object storage block device (RBD) module, so that the RBD module performs a corresponding disk operation according to the unpacked instruction.
[0068] The device of the present invention calls the SPDK performance optimization thread program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0069] Polling the RBD module through a second poller to pull processed commands that have been processed in the RBD module;
[0070] The processed command is sent to the NVMe-oF module to re-encapsulate the processed command through the NVMe-oF module, obtain the encapsulated command response, and call the verbs interface or socket interface to reply the command response to the host through the network card.
[0071] Through the above scheme, this embodiment creates an SPDK thread on the target CPU core by detecting that the NVMe-oF module is initialized, and creates two pollers on each SPDK thread; after receiving the execution command through the first poller, the execution command is handed over to the autonomous distributed object storage block device RBD module for processing; the second poller polls the RBD module to pull the processed commands that have been processed in the RBD module, and sends the processed commands to the NVMe-oF module for thread processing; the NVMe-oF module and the RBD module can share the CPU core, reduce CPU consumption, reduce the overhead caused by cross-CPU core calls, reduce latency, improve the performance of the storage device, and improve the speed and efficiency of the SPDK optimization thread.
[0072] Based on the above hardware structure, an embodiment of the SPDK performance optimization thread method of the present invention is proposed.
[0073] Reference Figure 2 , Figure 2 It is a flowchart of the first embodiment of the SPDK performance optimization thread method of the present invention.
[0074] In a first embodiment, the SPDK performance optimization thread method includes the following steps:
[0075] Step S10: When the NVMe-oF module is detected to be initialized, an SPDK thread is created on the target CPU core, and two pollers are created on each SPDK thread.
[0076] It should be noted that when the NVMe-oF module is initialized, it can create an SPDK thread on the corresponding target CPU core, and then create two pollers on each SPDK thread.
[0077] Step S20: After receiving the execution command through the first poller, the execution command is handed over to the autonomous distributed object storage block device RBD module for processing.
[0078] It should be understood that after receiving a command, a poller can pass the command to the RBD module for processing.
[0079] Step S30: poll the RBD module through the second poller, pull the processed commands that have been processed in the RBD module, and send the processed commands to the NVMe-oF module for thread processing.
[0080] It is understandable that another poller is responsible for polling the RBD module, pulling the commands that have been processed by the module, and returning them to the NVMe-oF module for processing.
[0081] In the specific implementation, Figure 3 As shown, Figure 3 This is a schematic diagram of polling processing based on SPDK in the SPDK performance optimization thread method of the present invention, see Figure 3 , using the NVMe-oF module and the RBD module to share the CPU core. When the NVMe-oF module is initialized, it creates an SPDK thread on each CPU core (core0 and core1), and then creates two pollers on each SPDK thread. One poller is responsible for polling the verbs interface. After receiving the command, it hands the command to the RBD module for processing. The other poller is responsible for polling the RBD module, pulling the commands that have been processed by the module, and returning them to the NVMe-oF module for processing. The NVMe-oF module and the RBD module use the same SPDK thread corresponding to the same CPU core. Two pollers are used on this thread to receive commands and reply responses respectively. The NVMe-oF module and the RBD module share the CPU core, which reduces the CPU consumption. The NVMe-oF module and the RBD module share the CPU core, reducing the overhead caused by cross-CPU core calls and reducing latency.
[0082] Through the above scheme, this embodiment creates an SPDK thread on the target CPU core by detecting that the NVMe-oF module is initialized, and creates two pollers on each SPDK thread; after receiving the execution command through the first poller, the execution command is handed over to the autonomous distributed object storage block device RBD module for processing; the second poller polls the RBD module to pull the processed commands that have been processed in the RBD module, and sends the processed commands to the NVMe-oF module for thread processing; the NVMe-oF module and the RBD module can share the CPU core, reduce CPU consumption, reduce the overhead caused by cross-CPU core calls, reduce latency, improve the performance of the storage device, and improve the speed and efficiency of the SPDK optimization thread.
[0083] Further, Figure 4 FIG. 1 is a flow chart of a second embodiment of the SPDK performance optimization thread method of the present invention. Figure 4 As shown, a second embodiment of the SPDK performance optimization thread method of the present invention is proposed based on the first embodiment. In this embodiment, the step S10 specifically includes the following steps:
[0084] Step S11: When the NVMe-oF module is detected to be initialized, the initialization interface of the data plane development kit DPDK is called.
[0085] It should be noted that when the NVMe-oF module is initialized, the initialization interface of DPDK will be called, that is, when the NVMe-oF module is detected to be initialized, the initialization interface of the data plane development kit (Data Plane Development Kit, DPDK) can be called.
[0086] Step S12: When the initialization interface is executed, create an SPDK thread on each designated target CPU core.
[0087] It can be understood that when the initialization interface is executed, a thread will be created on the specified CPU core, that is, an SPDK thread will be created on each specified target CPU core.
[0088] Furthermore, the step S12 specifically includes the following steps:
[0089] Modify the affinity parameter of the SPDK thread and bind the thread to the corresponding target CPU core for execution.
[0090] It should be understood that the SPDK thread can be bound to the corresponding CPU core for execution by modifying the thread affinity parameter.
[0091] Step S13: Create two pollers on each SPDK thread.
[0092] It should be understood that an SPDK thread is created on each CPU core, and then two pollers are created on each SPDK thread.
[0093] Through the above scheme, this embodiment detects that the NVMe-oF module is initialized and calls the initialization interface of the data plane development kit DPDK; when the initialization interface is executed, an SPDK thread is created on each specified target CPU core; two pollers are created on each SPDK thread, so that the NVMe-oF module and the RBD module can share the CPU core, reduce CPU consumption, and improve the speed and efficiency of the SPDK optimization thread.
[0094] Further, Figure 5 FIG. 4 is a flow chart of a third embodiment of the SPDK performance optimization thread method of the present invention. Figure 5 As shown, a third embodiment of the SPDK performance optimization thread method of the present invention is proposed based on the second embodiment. In this embodiment, the step S13 specifically includes the following steps:
[0095] Step S131: call the SPDK_POLLER_REGISTER interface of each SPDK, and obtain the execution function and the test cycle of the poller from the interface parameters of the SPDK_POLLER_REGISTER interface.
[0096] It should be noted that the SPDK_POLLER_REGISTER interface is called to register spdk_poller. The interface parameters include the poller's execution function and test cycle.
[0097] Step S132: Create two pollers on each SPDK thread according to the execution function and the test cycle.
[0098] It can be understood that two pollers can be created on each SPDK thread according to the execution function and the test cycle.
[0099] In the specific implementation, each registered spdk_poller is stored in the red-black tree structure of "spdk_thread->timed_pol lers" or the "spdk_thread->active_pollers" linked list.
[0100] Through the above scheme, this embodiment calls the SPDK_POLLER_REGISTER interface of each SPDK to obtain the execution function and the test cycle of the poller from the interface parameters of the SPDK_POLLER_REGISTER interface; two pollers are created on each SPDK thread according to the execution function and the test cycle, so that the NVMe-oF module and the RBD module can share the CPU core, reduce CPU consumption, and improve the speed and efficiency of the SPDK optimization thread.
[0101] Further, Figure 6 FIG. 4 is a flow chart of a fourth embodiment of the SPDK performance optimization thread method of the present invention. Figure 6 As shown, a fourth embodiment of the SPDK performance optimization thread method of the present invention is proposed based on the first embodiment. In this embodiment, step S20 specifically includes the following steps:
[0102] Step S21: polling the verbs interface or the socket interface through the first poller, and processing the execution instruction received by the network card through the verbs interface or the socket interface.
[0103] It should be noted that the verbs interface or the socket interface is polled to process the command received by the network card, and the verbs interface or the socket interface is polled by the first poller, and the execution instruction received by the network card is processed by the verbs interface or the socket interface.
[0104] In a specific implementation, if a cq request or an event occurs, it means that a new command has been received, and the execution instructions include but are not limited to commands such as read / readv / write / writev / discard / flush / write_zeros.
[0105] Step S22: Send the execution instruction to the NVMe-oF module, so that the NVMe-oF module unpacks the execution instruction to obtain the unpacked instruction.
[0106] It can be understood that after the received command is handed over to the NVMe-oF module for unpacking, the unpacked instruction can be obtained.
[0107] Step S23: Submit the unpacked instruction to the autonomous distributed object storage block device RBD module for processing.
[0108] It should be understood that the unpacked instructions are ultimately handed over to the autonomous distributed object storage block device RBD module for processing.
[0109] Furthermore, the step S23 specifically includes the following steps:
[0110] The unpacked instruction is sent to an autonomous distributed object storage block device (RBD) module, so that the RBD module performs a corresponding disk operation according to the unpacked instruction.
[0111] It can be understood that the unpacked instruction is sent to the autonomous distributed object storage block device RBD module, and the RBD module can perform corresponding disk operation actions according to the unpacked instruction. The RBD performs operations such as reading and writing disks according to the received commands.
[0112] Through the above scheme, this embodiment polls the verbs interface or the socket interface through the first poller, processes the execution instruction received by the network card through the verbs interface or the socket interface; sends the execution instruction to the NVMe-oF module, so that the NVMe-oF module unpacks the execution instruction to obtain the unpacked instruction; and hands the unpacked instruction to the autonomous distributed object storage block device RBD module for processing, so that the NVMe-oF module and the RBD module can share the CPU core, reduce CPU consumption, reduce the overhead caused by cross-CPU core calls, reduce latency, and improve the performance of the storage device.
[0113] Further, Figure 7 FIG. 5 is a flow chart of a fifth embodiment of the SPDK performance optimization thread method of the present invention. Figure 7 As shown, a fifth embodiment of the SPDK performance optimization thread method of the present invention is proposed based on the first embodiment. In this embodiment, step S30 specifically includes the following steps:
[0114] Step S31: poll the RBD module through a second poller to pull the processed commands that have been processed in the RBD module.
[0115] It should be noted that, by polling the RBD module through the second poller, commands that have been processed by the module can be pulled.
[0116] Step S32: Send the processed command to the NVMe-oF module to re-encapsulate the processed command through the NVMe-oF module, obtain the encapsulated command response, and call the verbs interface or socket interface to reply the command response to the host through the network card.
[0117] It can be understood that after pulling the commands that have been processed by the module, they are returned to the NVMe-oF module for processing. That is, after receiving the command completion message through the NVMe-oF module, the command will be re-encapsulated, and the verbs interface or socket interface will be called to reply the command response to the host through the network card.
[0118] Through the above scheme, this embodiment polls the RBD module through the second poller to pull the processed commands that have been processed in the RBD module; sends the processed commands to the NVMe-oF module, so that the processed commands are repackaged through the NVMe-oF module to obtain the packaged command response, and calls the verbs interface or the socket interface to reply the command response to the host through the network card, so that the NVMe-oF module and the RBD module can share the CPU core, reduce the CPU consumption, reduce the overhead caused by cross-CPU core calls, reduce the delay, improve the performance of the storage device, and improve the speed and efficiency of the SPDK optimization thread.
[0119] Accordingly, the present invention further provides an SPDK performance optimization thread device.
[0120] Reference Figure 8 , Figure 8 This is a functional module diagram of the first embodiment of the SPDK performance optimization thread device of the present invention.
[0121] In the first embodiment of the SPDK performance optimization thread device of the present invention, the SPDK performance optimization thread device includes:
[0122] The creation module 10 is used to detect that the NVMe-oF module is initialized, create an SPDK thread on the target CPU core, and create two pollers on each SPDK thread.
[0123] The RBD processing module 20 is used to hand over the execution command to the autonomous distributed object storage block device RBD module for processing after receiving the execution command through the first poller.
[0124] The thread processing module 30 is used to poll the RBD module through a second poller, pull the processed commands that have been processed in the RBD module, and send the processed commands to the NVMe-oF module for thread processing.
[0125] The creation module 10 is also used to detect that the NVMe-oF module is initialized and call the initialization interface of the data plane development kit DPDK; when the initialization interface is executed, create an SPDK thread on each specified target CPU core; and create two pollers on each SPDK thread.
[0126] The creation module 10 is also used to modify the affinity parameters of the SPDK thread and bind the thread to the corresponding target CPU core for execution.
[0127] The creation module 10 is further used to call the SPDK_POLLER_REGISTER interface of each SPDK, obtain the execution function and the test cycle of the poller from the interface parameters of the SPDK_POLLER_REGISTER interface; and create two pollers on each SPDK thread according to the execution function and the test cycle.
[0128] The RBD processing module 20 is also used to poll the verbs interface or the socket interface through the first poller, and process the execution instruction received by the network card through the verbs interface or the socket interface; send the execution instruction to the NVMe-oF module, so that the NVMe-oF module unpacks the execution instruction to obtain the unpacked instruction; and hand over the unpacked instruction to the autonomous distributed object storage block device RBD module for processing.
[0129] The RBD processing module 20 is further configured to send the unpacked instruction to the autonomous distributed object storage block device RBD module, so that the RBD module performs corresponding disk operation actions according to the unpacked instruction.
[0130] The thread processing module 30 is also used to poll the RBD module through a second poller to pull the processed commands that have been processed in the RBD module; send the processed commands to the NVMe-oF module to re-encapsulate the processed commands through the NVMe-oF module, obtain the encapsulated command response, and call the verbs interface or the socket interface to reply the command response to the host through the network card.
[0131] Among them, the steps implemented by each functional module of the SPDK performance optimization thread device can refer to the various embodiments of the SPDK performance optimization thread method of the present invention, and will not be repeated here.
[0132] In addition, an embodiment of the present invention further provides a storage medium, on which an SPDK performance optimization thread program is stored. When the SPDK performance optimization thread program is executed by a processor, the following operations are implemented:
[0133] When the NVMe-oF module is detected and initialized, an SPDK thread is created on the target CPU core, and two pollers are created on each SPDK thread;
[0134] After receiving the execution command through the first poller, the execution command is handed over to the autonomous distributed object storage block device RBD module for processing;
[0135] The RBD module is polled by a second poller to pull the processed commands that have been processed in the RBD module, and the processed commands are sent to the NVMe-oF module for thread processing.
[0136] Furthermore, when the SPDK performance optimization thread program is executed by the processor, the following operations are also implemented:
[0137] When the NVMe-oF module is detected to be initialized, the initialization interface of the data plane development kit DPDK is called;
[0138] When the initialization interface is executed, an SPDK thread is created on each specified target CPU core;
[0139] Create two pollers on each SPDK thread.
[0140] Furthermore, when the SPDK performance optimization thread program is executed by the processor, the following operations are also implemented:
[0141] Modify the affinity parameter of the SPDK thread and bind the thread to the corresponding target CPU core for execution.
[0142] Furthermore, when the SPDK performance optimization thread program is executed by the processor, the following operations are also implemented:
[0143] Call the SPDK_POLLER_REGISTER interface of each SPDK, and obtain the execution function and test cycle of the poller from the interface parameters of the SPDK_POLLER_REGISTER interface;
[0144] Two pollers are created on each SPDK thread according to the execution function and the test cycle.
[0145] Furthermore, when the SPDK performance optimization thread program is executed by the processor, the following operations are also implemented:
[0146] Polling the verbs interface or the socket interface through the first poller, and processing the execution instruction received by the network card through the verbs interface or the socket interface;
[0147] Sending the execution instruction to the NVMe-oF module so that the NVMe-oF module unpacks the execution instruction to obtain an unpacked instruction;
[0148] The unpacked instructions are handed over to the autonomous distributed object storage block device RBD module for processing.
[0149] Furthermore, when the SPDK performance optimization thread program is executed by the processor, the following operations are also implemented:
[0150] The unpacked instruction is sent to an autonomous distributed object storage block device (RBD) module, so that the RBD module performs a corresponding disk operation according to the unpacked instruction.
[0151] Furthermore, when the SPDK performance optimization thread program is executed by the processor, the following operations are also implemented:
[0152] Polling the RBD module through a second poller to pull processed commands that have been processed in the RBD module;
[0153] The processed command is sent to the NVMe-oF module to re-encapsulate the processed command through the NVMe-oF module, obtain the encapsulated command response, and call the verbs interface or socket interface to reply the command response to the host through the network card.
[0154] Those skilled in the art will appreciate that all or part of the steps in the above-mentioned implementation method can be accomplished by instructing related hardware through a program, and the program is stored in a storage medium, including a number of instructions for enabling a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each implementation method of the present application; and the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0155] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0156] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0157] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A SPDK performance optimization thread method, characterized in that: The SPDK performance optimization thread method includes: When the NVMe-oF module is detected and initialized, an SPDK thread is created on the target CPU core, and two pollers are created on each SPDK thread; After receiving the execution command through the first poller, the execution command is handed over to the autonomous distributed object storage block device RBD module for processing; Polling the RBD module through a second poller, pulling the processed commands that have been processed in the RBD module, and sending the processed commands to the NVMe-oF module for thread processing; When the NVMe-oF module is detected to be initialized, an SPDK thread is created on the target CPU core, and two pollers are created on each SPDK thread, including: When the NVMe-oF module is detected to be initialized, the initialization interface of the data plane development kit DPDK is called; When the initialization interface is executed, an SPDK thread is created on each specified target CPU core; Create two pollers on each SPDK thread.
2. The SPDK performance optimization thread method according to claim 1, characterized in that: When the initialization interface is executed, after creating an SPDK thread on each specified target CPU core, the SPDK performance optimization thread method further includes: Modify the affinity parameter of the SPDK thread and bind the thread to the corresponding target CPU core for execution.
3. The SPDK performance optimization thread method according to claim 1, characterized in that: The two pollers are created on each SPDK thread, including: Call the SPDK_POLLER_REGISTER interface of each SPDK, and obtain the execution function and test cycle of the poller from the interface parameters of the SPDK_POLLER_REGISTER interface; Two pollers are created on each SPDK thread according to the execution function and the test cycle.
4. The SPDK performance optimization thread method according to claim 1, characterized in that: After receiving the execution command through the first poller, the execution command is handed over to the autonomous distributed object storage block device RBD module for processing, including: Polling the verbs interface or the socket interface through the first poller, and processing the execution instruction received by the network card through the verbs interface or the socket interface; Sending the execution instruction to the NVMe-oF module so that the NVMe-oF module unpacks the execution instruction to obtain an unpacked instruction; The unpacked instructions are handed over to the autonomous distributed object storage block device RBD module for processing.
5. The SPDK performance optimization thread method according to claim 4, characterized in that: The step of delivering the unpacked instruction to an autonomous distributed object storage block device (RBD) module for processing includes: The unpacked instruction is sent to an autonomous distributed object storage block device (RBD) module, so that the RBD module performs a corresponding disk operation according to the unpacked instruction.
6. The SPDK performance optimization thread method according to claim 1, characterized in that: The polling the RBD module by the second poller, pulling the processed commands that have been processed in the RBD module, and sending the processed commands to the NVMe-oF module for thread processing includes: Polling the RBD module through a second poller to pull processed commands that have been processed in the RBD module; The processed command is sent to the NVMe-oF module to re-encapsulate the processed command through the NVMe-oF module, obtain the encapsulated command response, and call the verbs interface or socket interface to reply the command response to the host through the network card.
7. A SPDK performance optimization thread device, characterized in that: The SPDK performance optimization thread device includes: Create a module to detect when the NVMe-oF module is initialized, create an SPDK thread on the target CPU core, and create two pollers on each SPDK thread; The RBD processing module is used to hand over the execution command to the autonomous distributed object storage block device RBD module for processing after receiving the execution command through the first poller; A thread processing module, used to poll the RBD module through a second poller, pull the processed commands that have been processed in the RBD module, and send the processed commands to the NVMe-oF module for thread processing; The creation module is also used to detect that the NVMe-oF module is initialized and call the initialization interface of the data plane development kit DPDK; when the initialization interface is executed, create an SPDK thread on each specified target CPU core; and create two pollers on each SPDK thread.
8. An SPDK performance optimization thread device, characterized in that: The SPDK performance optimization thread device includes: a memory, a processor, and an SPDK performance optimization thread program stored in the memory and executable on the processor, wherein the SPDK performance optimization thread program is configured to implement the steps of the SPDK performance optimization thread method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores an SPDK performance optimization thread program, and when the SPDK performance optimization thread program is executed by the processor, the steps of the SPDK performance optimization thread method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Communication method and device used for virtual machine and host and system
CN108845863A