File system request processing method and device, chip, equipment, storage medium and program product
By directly sending FUSE requests to distributed storage devices using the RDMA network in the transport layer module of the host device, the problem of high performance overhead for user-state file systems based on the FUSE framework when processing requests is solved, and more efficient file system performance is achieved.
Patent Information
- Application Number
- CN202411698037.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-18
AI Technical Summary
When processing file system requests for a user-state file system based on the FUSE framework, it is necessary to perform multiple user-state and kernel-state context switching, resulting in increased performance overhead and reduced file system performance.
By using the RDMA network in the transport layer module of the host device, FUSE requests are sent directly to the FUSE target module in the distributed storage device, avoiding context switching between the user state and the kernel state.
This method reduces the computational overhead, avoids the replication overhead of IO data, shortens the data transmission path, and significantly improves the performance of the user-state file system.
Smart Images

Figure CN119645928A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip technology, and in particular to a method, apparatus, chip, device, storage medium and program product for processing a file system request. Background Art
[0002] The file system is usually implemented in the kernel state of the operating system and is one of the core components of the operating system. The development and debugging efficiency of the kernel state file system is low, and a failure may cause the entire operating system to be unavailable. Compared with the kernel state file system, the user state file system can implement and run the file system logic in the user space, which has the advantages of high development and debugging efficiency and small failure range.
[0003] In the related art, the user-mode file system can be implemented through the Files system in Userspace (FUSE) framework, which includes two core components, namely the FUSE kernel module and the file system userspace library (FUSE Library, LIBFUSE). The FUSE kernel module is used to encapsulate the file system request and forward it to the user-mode file system service process, and LIBFUSE is used to provide various interfaces for the development of user-mode file system services.
[0004] However, based on the user-mode file system of the FUSE framework, after the FUSE kernel module encapsulates the file system request as a FUSE request, it is necessary to wake up the user-mode file system service to read the FUSE request and process the FUSE request. After the processing is completed, the user-mode file system service can wake up the FUSE kernel module to process the response message of the FUSE request and return the response message to the application. Since at least two context switching overheads are required between the user mode (user-mode file system service) and kernel mode (FUSE kernel module), additional performance overhead is generated, which reduces the performance of the file system. Summary of the invention
[0005] Based on this, it is necessary to provide a method, device, chip, equipment, storage medium and program product for processing file system requests that can improve the performance of the file system in response to the above technical problems.
[0006] In a first aspect, the present application provides a method for processing a file system request, which is applied to a host device, wherein the host device includes a user space file system FUSE kernel module and a transport layer module; the method for processing a file system request includes:
[0007] The FUSE kernel module obtains a file system request initiated by an application, and encapsulates the file system request according to the FUSE protocol to generate a FUSE request;
[0008] The transport layer module obtains the FUSE request from the FUSE kernel module, and sends the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network. The FUSE target module is used to process the FUSE request through the file system service.
[0009] In one of the embodiments, after sending the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network, the method further includes:
[0010] The transport layer module receives a response message of the FUSE request sent by the FUSE target module through the RDMA network;
[0011] The transport layer module sends the response message to the FUSE kernel module.
[0012] In one embodiment, the method further comprises:
[0013] The transport layer module receives a mount command, wherein the mount command includes an Internet Protocol IP address and a port number of the FUSE target module;
[0014] The transport layer module establishes an RDMA network connection with the FUSE target module according to the IP address and the port number.
[0015] In one of the embodiments, the transport layer module establishes an RDMA network connection with the FUSE target module according to the IP address and the port number, including:
[0016] The transport layer module creates a management message queue corresponding to the RDMA network;
[0017] The transport layer module sends a connection request to the FUSE target module through the management message queue according to the IP address and the port number;
[0018] The transport layer module receives a connection response message sent by the FUSE target module, wherein the connection response message includes connection result information, and the connection result information is used to indicate that the transport layer module successfully establishes an RDMA network connection with the FUSE target module, or the connection result information is used to indicate a connection failure type;
[0019] Among them, the connection request includes at least one of the following initial negotiation information: the byte order of the central processing unit CPU of the host device, the architecture type of the CPU of the host device and the inline data size of the transport layer module, and the inline data size of the transport layer module is used to characterize the maximum receiving memory of the transport layer module.
[0020] In one embodiment, the method further comprises:
[0021] The transport layer module sends a disconnect instruction to the FUSE target module through the management message queue;
[0022] The transport layer module releases the resources occupied by the management message queue.
[0023] In one of the embodiments, after the transport layer module receives the mount command, the method further includes:
[0024] The transport layer module creates a request message queue, a notification message queue and a priority message queue corresponding to the RDMA network;
[0025] Among them, the priority message queue is used to transmit FUSE requests with a priority greater than or equal to a preset level and response messages to FUSE requests, the request message queue is used to transmit FUSE requests with a priority less than the preset level and response messages to FUSE requests, and the notification message queue is used to transmit event notification messages corresponding to notification operations.
[0026] In one embodiment, sending the FUSE request to a FUSE target module in a distributed storage device through a remote direct data access (RDMA) network includes:
[0027] The transport layer module communicates with the FUSE target module via the RDMA network through the request message queue or the priority message queue to send the FUSE request to the FUSE target module.
[0028] In one embodiment, the method further comprises:
[0029] The transport layer module obtains the memory capacity information of the host device and the service capacity planning information of the file system;
[0030] The transport layer module determines the maximum receiving memory of the transport layer module according to the memory capacity information and service capacity planning information of the host device;
[0031] The transport layer module sends the maximum receive memory of the transport layer module to the FUSE target module.
[0032] In one embodiment, sending the FUSE request to a FUSE target module in a distributed storage device through a remote direct data access (RDMA) network includes:
[0033] The transport layer module determines whether the memory occupied by the FUSE request is less than or equal to the maximum receiving memory of the FUSE target module;
[0034] If the memory occupied by the FUSE request is less than or equal to the maximum receiving memory of the FUSE target module, the transport layer module sends the FUSE request to the FUSE target module through a sending operation corresponding to the RDMA network.
[0035] In one of the embodiments, after determining whether the memory occupied by the FUSE request is less than or equal to the maximum receiving memory of the FUSE target module, the method further includes:
[0036] If the memory occupied by the FUSE request is larger than the maximum receiving memory of the FUSE target module, the transport layer module registers the memory occupied by the FUSE request as the first RDMA memory area;
[0037] The transport layer module sends an operation instruction including a read instruction to the FUSE target module, wherein the read instruction includes identification information of the first RDMA memory area, and the read instruction is used to instruct the FUSE target module to read the FUSE request from the first RDMA memory area.
[0038] In one of the embodiments, the transport layer module receives a response message of the FUSE request sent by the FUSE target module through the RDMA network, including:
[0039] If the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module, the transport layer module receives the response message sent by the FUSE target module through the sending operation corresponding to the RDMA network.
[0040] In one of the embodiments, the transport layer module receives a response message of the FUSE request sent by the FUSE target module through the RDMA network, further comprising:
[0041] If the memory occupied by the response message is greater than the maximum receiving memory of the transport layer module, the transport layer module registers the memory occupied by the response message as a second RDMA memory area;
[0042] The transport layer module sends an operation instruction including a write instruction to the FUSE target module, wherein the write instruction includes identification information of the second RDMA memory area, and the write instruction is used to instruct the FUSE target module to write the response message into the second RDMA memory area.
[0043] In a second aspect, the present application provides a method for processing a file system request, which is applied to a distributed storage device, wherein the distributed storage device includes a FUSE target module and a storage module, and the method for processing a file system request includes:
[0044] The FUSE target module receives a FUSE request sent by a transport layer module of a host device through an RDMA network;
[0045] The FUSE target module processes the FUSE request through a file system service according to the data of the file system stored in the storage module.
[0046] In one embodiment, after processing the FUSE request by the file system service, the method further includes:
[0047] The FUSE target module sends a response message of the FUSE request to the transport layer module through the RDMA network.
[0048] In one embodiment, the method further comprises:
[0049] The FUSE target module creates a management message queue corresponding to the RDMA network;
[0050] The FUSE target module receives the connection request sent by the transport layer module through the management message queue;
[0051] The FUSE target module determines whether to establish an RDMA network connection with the transport layer module according to the initial negotiation information in the connection request and generates connection result information corresponding to the connection request, wherein the connection result information is used to indicate that the transport layer module successfully establishes an RDMA network connection with the FUSE target module, or the connection result information is used to indicate a connection failure type;
[0052] The FUSE target module sends a connection response message to the transport layer module through the management message queue, wherein the connection response message includes connection result information;
[0053] Among them, the connection request includes at least one of the following initial negotiation information: the byte order of the central processing unit CPU of the host device, the architecture type of the CPU of the host device and the inline data size of the transport layer module, and the inline data size of the transport layer module is used to characterize the maximum receiving memory of the transport layer module.
[0054] In one embodiment, the method further comprises:
[0055] The FUSE target module creates a request message queue, a notification message queue and a priority message queue corresponding to the RDMA network;
[0056] Among them, the priority message queue is used to transmit FUSE requests with a priority greater than or equal to a preset level and response messages to FUSE requests, the request message queue is used to transmit FUSE requests with a priority less than the preset level and response messages to FUSE requests, and the notification message queue is used to transmit event notification messages corresponding to notification operations.
[0057] In one embodiment, the method further comprises:
[0058] The FUSE target module obtains the memory capacity information of the distributed storage device and the service capacity planning information of the file system;
[0059] The FUSE target module determines the maximum receiving memory of the FUSE target module according to the memory capacity information and service capacity planning information of the distributed storage device;
[0060] The FUSE target module sends the maximum receive memory of the FUSE target module to the transport layer module.
[0061] In one of the embodiments, the FUSE target module receives a FUSE request sent by the transport layer module of the host device through the RDMA network, including:
[0062] If the received operation instruction sent by the transport layer module includes a read instruction, the FUSE target module reads the FUSE request in the first RDMA memory area according to the identification information of the first RDMA memory area in the read instruction;
[0063] If the received operation instruction sent by the transport layer module does not include a read instruction, the FUSE target module receives a FUSE request sent by the transport layer module through a sending operation corresponding to the RDMA network.
[0064] In one of the embodiments, the FUSE target module sends a response message of the FUSE request to the transport layer module through the RDMA network, including:
[0065] The FUSE target module determines whether the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module;
[0066] If the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module, the FUSE target module sends the response message to the transport layer module through the sending operation corresponding to the RDMA network.
[0067] In one of the embodiments, after the FUSE target module determines whether the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module, the method further includes:
[0068] If the memory occupied by the response message is larger than the maximum receiving memory of the transport layer module, the FUSE target module writes the response message in the second RDMA memory area according to the write instruction in the operation instruction sent by the transport layer module, and the write instruction includes the identification information of the second RDMA memory area.
[0069] In a third aspect, the present application provides a device for processing a file system request, which is applied to a host device, and the device for processing a file system request includes:
[0070] The FUSE kernel module is used to obtain the file system request initiated by the application, and encapsulate the file system request according to the FUSE protocol to generate a FUSE request;
[0071] The transport layer module is used to obtain the FUSE request from the FUSE kernel module and send the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network. The FUSE target module is used to process the FUSE request through the file system service.
[0072] In a fourth aspect, the present application provides a device for processing a file system request, which is applied to a distributed storage device, and the device for processing a file system request includes:
[0073] Storage module, used to store file system data;
[0074] The FUSE target module is used to receive a FUSE request sent by a transport layer module of a host device through an RDMA network; and process the FUSE request through a file system service according to the data of the file system stored in the storage module.
[0075] In a fifth aspect, the present application provides a chip comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method described in the first aspect or the second aspect when executing the computer program.
[0076] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect or the second aspect above are implemented.
[0077] In a seventh aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method described in the first aspect or the second aspect above.
[0078] The embodiments of the present application provide a method, apparatus, chip, device, storage medium and program product for processing file system requests. The method for processing file system requests is applied to a host device, and the host device includes a user space file system FUSE kernel module and a transport layer module. The FUSE kernel module first obtains the file system request initiated by the application, and encapsulates the file system request according to the FUSE protocol to generate a FUSE request. Subsequently, the transport layer module obtains the FUSE request from the FUSE kernel module, and sends the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network. The FUSE target module is used to process the FUSE request through the file system service. Since the transport layer module of the operating system directly sends the FUSE request to the FUSE target module in the distributed storage device through the RDMA network, there is no need to perform user-mode kernel-mode context switching when processing the FUSE request, thereby reducing the computing overhead and improving the performance of the file system. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0080] Figure 1 is a schematic diagram of a FUSE framework in the related art;
[0081] Figure 2 A schematic diagram of a system for processing file system requests provided in an embodiment of the present application;
[0082] Figure 3 A flowchart of a method for processing a file system request provided in an embodiment of the present application;
[0083] Figure 4 A flowchart of another method for processing a file system request provided in an embodiment of the present application;
[0084] Figure 5 A flowchart of another method for processing a file system request provided in an embodiment of the present application;
[0085] Figure 6 A flowchart of another method for processing a file system request provided in an embodiment of the present application;
[0086] Figure 7 A signaling interaction diagram of a method for processing a file system request provided in an embodiment of the present application;
[0087] Figure 8 A structural block diagram of a file system request processing device provided in an embodiment of the present application;
[0088] Fig. 9 A structural block diagram of another file system request processing device provided in an embodiment of the present application;
[0089] Fig.10 An internal block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0090] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0091] First, the related technology will be described below.
[0092] The file system is usually implemented in the kernel state of the operating system and is one of the core components of the operating system. The development and debugging efficiency of the kernel state file system is low, and a failure may cause the entire operating system to be unavailable. Compared with the kernel state file system, the user state file system can implement and run the file system logic in the user space, and has the following advantages:
[0093] First, developing a new kernel-mode file system requires writing complex kernel code, while a user-mode file system can be implemented in user mode, which has high development and debugging efficiency. In addition, the user-mode file system can more conveniently apply various high-performance technologies to implement user-mode file system logic, including user-mode network protocol stacks, coroutines, etc.
[0094] Secondly, the failure range of the user-mode file system is small. Even if the user-mode file system service process crashes during the operation of the user-mode file system, it will not affect the kernel of the user-mode file system.
[0095] Finally, with the widespread application of big data scenarios such as artificial intelligence (AI), various distributed storage systems continue to emerge. User-mode file systems can provide file system services based on Portable Operating System Interface (POSIX) semantics in the computing nodes of distributed storage systems.
[0096] In the related art, the user-mode file system can be implemented through the Files system in Userspace (FUSE) framework. The FUSE framework includes two core components, namely the FUSE kernel module and the file system userspace library (FUSE Library, LIBFUSE). The FUSE kernel module is used to encapsulate the file system request and forward it to the user-mode file system service process. LIBFUSE is used to provide various interfaces for the development of user-mode file system services. Through the FUSE framework, the development efficiency of the user-mode file system can be greatly improved.
[0097] Figure 1 is a schematic diagram of a FUSE framework in the related art, such as Figure 1 As shown, the host device is connected to the distributed storage device, and there is a gateway device between the host device and the distributed storage device. The host device includes a user space (Userspace) and an operating system kernel (OS Kernel). Multiple applications and a user-mode file system based on LIBFUSE run in the user space. The OS Kernel includes a FUSE kernel module and a virtual file system (Virtual FileSystem, VFS), and VFS can be a component in the operating system kernel.
[0098] The application can submit a file system request on the FUSE mount point. The FUSE kernel module obtains the file system request through VFS, and then encapsulates the file system request into a FUSE request based on the FUSE protocol. Subsequently, the FUSE kernel module wakes up the user-mode file system service to read the FUSE request and processes the FUSE request. After the user-mode file system service processes the FUSE request, a response message for the FUSE request is generated. Finally, the user-mode file system service wakes up the FUSE kernel module to process the response message for the FUSE request, and returns the processing result to the application. It can be seen that when processing each FUSE request, at least two user-mode (user-mode file system service) and kernel-mode (FUSE kernel module) context switching overheads are performed, resulting in additional performance overhead (especially for small-scale input or output requests), thereby reducing the performance of the file system.
[0099] In addition, when the user-mode file system service obtains a FUSE request from the FUSE kernel module, the input and output (IO) data will be copied to the user-mode file system service, resulting in additional overhead. In the related art, for read requests or write requests in FUSE requests, the FUSE kernel module and LIBFUSE can use the Splice system call for optimization, however, other FUSE requests still need to be copied to the user-mode file system service for processing. Moreover, the Splice system call saves the data of the FUSE request in the pipeline, which can only be accessed in the kernel mode. If the user-mode file system service needs to perform processing operations such as encryption on the data of the read request or the write request, the data still needs to be copied to the user-mode file system service.
[0100] In addition, when the FUSE-based user-mode file system service acts as an agent of the distributed storage system on the computing node, the data of the user-mode file system is stored on the distributed storage system, and the user-mode file system service still needs to send the data to the remote distributed storage system through the network, which is also not conducive to the performance of the file system.
[0101] To solve the above problems, the embodiments of the present application provide a method, device, chip, equipment, storage medium and program product for processing file system requests. After the transport layer module of the operating system obtains the FUSE request from the FUSE kernel module, it directly sends the FUSE request to the FUSE target module in the distributed storage device through the RDMA network, thereby eliminating the need to perform user-mode kernel-mode context switching when processing the FUSE request, reducing computing overhead. At the same time, it also avoids the copy overhead of IO data, shortens the data transmission path, and fully utilizes the performance advantages of the RDMA network, thereby greatly improving the performance of the user-mode file system.
[0102] Figure 2 A schematic diagram of a system for processing file system requests provided in an embodiment of the present application is shown in FIG. Figure 2 , the host device interacts with the distributed storage device. The host device includes the user space (Userspace), the operating system kernel (OSKernel) and the hardware layer. Multiple applications run in the Userspace; the OS Kernel includes VFS, FUSE kernel module, transport layer module, RDMA kernel module; the hardware layer includes the RDMA network controller. The distributed storage device includes the FUSE target module and the storage module. The user-mode file system service is deployed on the FUSE target module, and the storage module stores the user-mode file system data.
[0103] The transport layer module may be a FUSE (FUSE over RDMA) module based on RDMA, which may use the RDMA network as the transport layer for the FUSE request. Exemplarily, the transport layer module may interact with the RDMA kernel module, call the RDMA network controller to directly transmit the FUSE request from the transport layer module to the FUSE target module in the remote distributed storage device, and directly obtain the response message of the FUSE request from the FUSE target module.
[0104] It should be understood that since the FUSE request and the response message of the FUSE request can be directly transmitted between the transport layer module and the FUSE target module through the RDMA network, the FUSE request and the response message of the FUSE request do not need to pass through the user-mode file system service of the same computing node (such as the host device), thereby improving the performance of the file system.
[0105] In some embodiments, the FUSE target module may also serve as a gateway for the distributed storage device.
[0106] In an exemplary embodiment, Figure 3 As shown, a method for processing a file system request is provided, and the method is applied to Figure 3 The host device in is taken as an example to illustrate, the host device includes a user space file system FUSE kernel module and a transport layer module, and the processing method of the file system request includes S201-S202:
[0107] S201. The FUSE kernel module obtains a file system request initiated by an application, and encapsulates the file system request according to the FUSE protocol to generate a FUSE request.
[0108] In some embodiments, the application can initiate a file system request, and the FUSE kernel module obtains the file system request through the FUSE mount point. Subsequently, the FUSE kernel module can encapsulate the file system request according to the FUSE protocol to generate a FUSE request.
[0109] The file system request may be any type of operation request for the file system, such as a write request, a read request, a modification request, etc., and the embodiment of the present application does not impose any limitation on this.
[0110] It should be understood that the above-mentioned FUSE protocol can be a protocol that allows a custom file system to be implemented in user mode. In some embodiments, the FUSE protocol can define a plurality of different types of FUSE requests, and the formats and request lengths of the various types of FUSE requests are different. After obtaining the file system request, the FUSE kernel module can determine the type of FUSE request corresponding to the file system request, and then encapsulate the file system request based on the format and request length defined in the FUSE protocol for the type of the corresponding FUSE request to generate a FUSE request.
[0111] S202, the transport layer module obtains the FUSE request from the FUSE kernel module, and sends the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network. The FUSE target module is used to process the FUSE request through the file system service.
[0112] Among them, the above-mentioned Remote Direct Memory Access (RDMA) network is an efficient data transmission technology that can be applied to network communications in scenarios such as high-performance computing, cloud computing, and big data processing, thereby significantly reducing processor load and increasing data throughput to speed up the running speed of applications.
[0113] Exemplarily, the transport layer module may be an RDMAFS kernel module, which is an RDMA-based FUSE module that is built into the operating system kernel and may use the RDMA network as the transport layer for FUSE requests.
[0114] Exemplarily, a user-mode file system service is deployed in the above-mentioned FUSE target module. Through the RDMA network, the FUSE target module and the transport layer module can be set on different computing nodes, and there is no need to perform user-mode kernel-mode context switching when processing FUSE requests, which reduces computing overhead and avoids IO data replication overhead, thereby reducing the length of the data link. For example, the transport layer module is located on the host device, and the FUSE target module is located on a remote distributed storage device.
[0115] It should be noted that the above-mentioned FUSE target module can be based on the LIBFUSE library when implementing the file system service. In order to realize the transmission of the RDMA network, the LIBFUSE library can add the RDMA function accordingly.
[0116] In some embodiments, after the FUSE kernel module encapsulates the file system request and generates a FUSE request, the transport layer module can obtain the FUSE request from the FUSE kernel module, and send the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network. Among them, the transport layer module can actively obtain the FUSE request from the FUSE kernel module, or the transport layer module can also passively obtain the FUSE request from the FUSE kernel module, that is, the transport layer module receives the FUSE request sent from the FUSE kernel module, or other methods of obtaining the FUSE request from the FUSE kernel module.
[0117] In some embodiments, after the transport layer module sends the FUSE request to the FUSE target module in the distributed storage device through the RDMA network, the FUSE target module can process the FUSE request through the file system service according to the data of the file system stored in the storage module. Subsequently, the FUSE target module sends a response message of the FUSE request to the transport layer module through the RDMA network. The transport layer module sends the response message to the FUSE kernel module.
[0118] Among them, the FUSE target module can send the response message to the transport layer module through a send operation (RDMA_SEND) or a write operation (RDMA_WRITE).
[0119] It should be understood that the embodiments of the present application do not limit how FUSE request and response messages are transmitted between the transport layer module and the FUSE target module through the RDMA network. In some embodiments, the transport layer module can interact with the RDMA kernel module and call the RDMA network controller to directly transmit the FUSE request from the transport layer module to the FUSE target module in the remote distributed storage device, and directly obtain the response message of the FUSE request from the FUSE target module.
[0120] In the present application, the transport layer module is set on the host device side, and the FUSE target module is set on the distributed storage device side. The transport layer module and the FUSE target module communicate through the RDMA network, utilizing the advantages of the RDMA network such as high throughput, low latency, bypassing the kernel network stack, and low CPU overhead, avoiding the user-mode kernel-mode context switching and the copying overhead of input and output data, and setting the FUSE target module on the distributed storage device side can reduce the data link length, thereby improving the performance of the user-mode file system service.
[0121] In some embodiments, the transport layer module may create multiple message queues to transmit different types of request messages.
[0122] Exemplarily, the transport layer module may create an administration message queue (ADMIN RDMA QP), a request message queue (REQUESTS RDMA QP), a notification message queue (NOTIFICATION RDMA QP), and a priority message queue (HIPRI RDMA QP) corresponding to the RDMA network.
[0123] Among them, the management message queue is used to transmit initial negotiation information, which is used to mount or unmount the file system; the priority message queue is used to transmit FUSE requests with a priority greater than or equal to a preset level and response messages to FUSE requests; the request message queue is used to transmit FUSE requests with a priority less than a preset level and response messages to FUSE requests; the notification message queue is used to transmit event notification messages corresponding to notification operations.
[0124] Among them, the above-mentioned preset levels can be specifically set according to actual conditions, and the embodiments of the present application do not limit this. For example, the priority message queue can transmit a release request (FUSE_FORGET) or an interrupt request (FUSE_INTERRUPT).
[0125] It should be understood that the event notification message transmitted by the above notification message queue is an event notification message actively sent by the FUSE target module to the transport layer module, and the transport layer module does not need to send a FUSE request in advance.
[0126] It should be noted that the above-mentioned multiple message queues can be created by the transport layer module when mounting the file system. Correspondingly, the FUSE target module can create the above-mentioned multiple message queues accordingly, so as to match the multiple message queues created by the transport layer module for RDMA network communication. That is, the FUSE target module can also create management message queues, request message queues, notification message queues and priority message queues corresponding to the RDMA network.
[0127] The following describes how to mount and unmount the file system.
[0128] It should be understood that since the file system is configured in the FUSE target module, the mounting of the file system is used to establish a connection between the transport layer module and the FUSE target module. Correspondingly, the unmounting of the file system is used to disconnect the transport layer module from the FUSE target module.
[0129] In some embodiments, the transport layer module receives a mount command including an Internet Protocol (IP) address and a port number of the FUSE target module. Subsequently, the transport layer module establishes an RDMA network connection with the FUSE target module according to the IP address and the port number.
[0130] The above IP address and port number are used to indicate the network address of the FUSE target module.
[0131] It should be understood that the embodiments of the present application do not limit how the transport layer module establishes an RDMA network connection with the FUSE target module. In some embodiments, the transport layer module may first create a management message queue corresponding to the RDMA network. Subsequently, the transport layer module sends a connection request to the FUSE target module through the management message queue according to the IP address and port number. Finally, the transport layer module receives a connection response message sent by the FUSE target module, and the connection response message includes connection result information. The connection result information is used to indicate that the transport layer module successfully establishes an RDMA network connection with the FUSE target module, or the connection result information is used to indicate the type of connection failure.
[0132] The connection request includes at least one of the following initial negotiation information: the CPU byte order of the host device, the CPU architecture type of the host device, and the inline data size of the transport layer module. The inline data size of the transport layer module is used to represent the maximum receiving memory of the transport layer module.
[0133] Exemplarily, the connection request may include an administration instruction (fuse_rdma_admin_command), which may include an instruction code (opcode), and different instruction codes may indicate different instruction operations. When the instruction code indicates to establish an RDMA network connection with the FUSE target module, the FUSE target module may determine whether a file system service can be provided and generate connection result information based on the initial negotiation information therein. Finally, the FUSE target module feeds back the connection result information to the transport layer module through the completion instruction (fuse_rdma_admin_completion) of the connection request.
[0134] Exemplarily, if the FUSE target module determines that it can provide file system services, the status field in the connection result information can be set to 0, thereby indicating that the transport layer module and the FUSE target module have successfully established an RDMA network connection. If the FUSE target module determines that it cannot provide file system services, the status field can be set to a corresponding error code based on the reason why the file system services cannot be provided to indicate the type of connection failure. For example, if the file system service cannot be provided due to the CPU architecture type, the status field can be set to an error code corresponding to the CPU architecture type; if the file system service cannot be provided due to the CPU byte order, the status field can be set to an error code corresponding to the CPU byte order.
[0135] In some embodiments, the transport layer module may also create a request message queue, a notification message queue, and a priority message queue corresponding to the RDMA network.
[0136] Among them, the priority message queue is used to transmit FUSE requests with a priority greater than or equal to the preset level and response messages to FUSE requests, the request message queue is used to transmit FUSE requests with a priority less than the preset level and response messages to FUSE requests, and the notification message queue is used to transmit event notification messages corresponding to notification operations.
[0137] In some embodiments, the transport layer module may send a disconnection instruction to the FUSE target module via the management message queue. Subsequently, the transport layer module releases the resources occupied by the management message queue.
[0138] The following describes how to transmit FUSE request and response messages between the transport layer module and the FUSE target module.
[0139] In some embodiments, the transport layer module communicates with the FUSE target module via the RDMA network through a request message queue or a priority message queue to send the FUSE request to the FUSE target module.
[0140] Exemplarily, after the file system is mounted, the transport layer module and the FUSE target module create multiple message queues accordingly. For message queues with higher priority, the transport layer module can communicate with the FUSE target module via the priority message queue to send the FUSE request to the FUSE target module. For message queues with lower priority, the transport layer module can communicate with the FUSE target module via the request message queue to send the FUSE request to the FUSE target module.
[0141] Among them, the RDMA network can support multiple operation types to transmit FUSE request and response messages, including send operation (RDMA_SEND), read operation (RDMA_READ) and write operation (REMA_WRITE).
[0142] It should be understood that the embodiment of the present application does not limit the data format of the FUSE request and response message. For example, Table 1 is a data format of a FUSE request provided in an embodiment of the present application. As shown in Table 1, the FUSE request includes an input and output operation instruction (fuse_rdma_io_command) and a FUSE protocol standard message. For example, Table 2 is a data format of a response message provided in an embodiment of the present application. As shown in Table 2, the response message includes an input and output completion instruction (fuse_rdma_io_completion) and a FUSE protocol standard message.
[0143] Table 1
[0144] fuse_rdma_io_command FUSE protocol standard message
[0145] Table 2
[0146] fuse_rdma_io_completion FUSE protocol standard message
[0147] Among them, fuse_rdma_io_command is added to the message header of the FUSE protocol standard message to expand to form a complete FUSE request message. fuse_rdma_io_completion is added to the message header of the FUSE protocol standard message to expand to form a complete FUSE request response message message.
[0148] It should be noted that in the present application, in order to reduce the problem of reserving too much receive memory due to pre-registered receive memory, when mounting the file system, the transport layer module and the FUSE target module can respectively select the maximum receive memory and send it to the other party, so that when transmitting FUSE request and response messages, the corresponding transmission method can be selected based on the maximum receive memory.
[0149] In some embodiments, the transport layer module obtains the memory capacity information of the host device and the service capacity planning information of the file system. Subsequently, the transport layer module determines the maximum receiving memory of the transport layer module according to the memory capacity information and the service capacity planning information of the host device. Finally, the transport layer module adds the maximum receiving memory of the transport layer module to fuse_rdma_admin_command to send to the FUSE target module.
[0150] Similarly, the FUSE target module can obtain the memory capacity information of the distributed storage device and the service capacity planning information of the file system. Subsequently, the FUSE target module determines the maximum receiving memory of the FUSE target module based on the memory capacity information and service capacity planning information of the distributed storage device. Finally, the FUSE target module adds the maximum receiving memory of the FUSE target module to fuse_rdma_admin_completion and sends it to the transport layer module.
[0151] The memory capacity information and the service capacity planning information may be pre-configured information, and the transport layer module and the FUSE target module may be extracted from a preset storage location.
[0152] It should be understood that the above maximum receive memory can be carried in the inline data size (inline_data_size) field, the inline data size field of the transport layer module is carried in the management instruction (fuse_rdma_admin_command), and the inline data size field of the FUSE target module is carried in the completion instruction (fuse_rdma_admin_completion) of the connection request. The transport layer module can allocate the receive memory of the response message based on the maximum receive memory, and the FUSE target module can also allocate the receive memory of the FUSE request based on the maximum receive memory.
[0153] For FUSE requests, in some embodiments, the transport layer module determines whether the memory occupied by the FUSE request is less than or equal to the maximum receiving memory of the FUSE target module. If the memory occupied by the FUSE request is less than or equal to the maximum receiving memory of the FUSE target module, the transport layer module sends the FUSE request to the FUSE target module through a sending operation (RDMA_SEND) corresponding to the RDMA network.
[0154] If the memory occupied by the FUSE request is larger than the maximum receiving memory of the FUSE target module, the transport layer module registers the memory occupied by the FUSE request as the first RDMA memory area. Subsequently, the transport layer module sends an operation instruction including a read instruction to the FUSE target module, wherein the read instruction includes identification information of the first RDMA memory area, and the read instruction is used to instruct the FUSE target module to read the FUSE request from the first RDMA memory area. After receiving the read instruction, the FUSE target module reads the FUSE request in the first RDMA memory area according to the identification information of the first RDMA memory area in the read instruction.
[0155] For the response message, if the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module, the transport layer module receives the response message sent by the FUSE target module through the corresponding sending operation of the RDMA network.
[0156] If the memory occupied by the response message is larger than the maximum receiving memory of the transport layer module, the transport layer module registers the memory occupied by the response message as the second RDMA memory area. The transport layer module sends an operation instruction including a write instruction to the FUSE target module, the write instruction including the identification information of the second RDMA memory area, and the write instruction is used to instruct the FUSE target module to write the response message into the second RDMA memory area.
[0157] In the embodiment of the present application, the transport layer module and the FUSE target module can flexibly allocate the receiving memory, and a maximum receiving memory can serially process multiple FUSE request or response messages. In this way, the performance of small-scale input and output requests can be taken into account, and a flexible memory management strategy can be implemented.
[0158] The method for processing file system requests provided in an embodiment of the present application is applied to a host device, and the host device includes a user space file system FUSE kernel module and a transport layer module. The FUSE kernel module first obtains the file system request initiated by the application, and encapsulates the file system request according to the FUSE protocol to generate a FUSE request. Subsequently, the transport layer module obtains the FUSE request from the FUSE kernel module, and sends the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network, and the FUSE target module is used to process the FUSE request through the file system service. Since the transport layer module of the operating system directly sends the FUSE request to the FUSE target module in the distributed storage device through the RDMA network, there is no need to perform user-mode kernel-mode context switching when processing the FUSE request, thereby reducing the computing overhead and improving the performance of the file system.
[0159] The following describes how the distributed storage device processes a FUSE request. Figure 4 A flowchart of another method for processing a file system request provided in an embodiment of the present application is shown as follows: Figure 4 As shown, the method for processing the file system request is applied to a distributed storage device, the distributed storage device includes a FUSE target module and a storage module, and the method for processing the file system request includes S301-S303:
[0160] S301. A FUSE target module receives a FUSE request sent by a transport layer module of a host device through an RDMA network.
[0161] In some embodiments, before the FUSE target module receives the FUSE request sent by the transport layer module of the host device through the RDMA network, the FUSE target module creates a management message queue corresponding to the RDMA network. Secondly, the FUSE target module receives the connection request sent by the transport layer module through the management message queue. Thirdly, the FUSE target module determines whether to establish an RDMA network connection with the transport layer module based on the initial negotiation information in the connection request and generates connection result information corresponding to the connection request. The connection result information is used to indicate that the transport layer module and the FUSE target module have successfully established an RDMA network connection, or the connection result information is used to indicate the type of connection failure. Finally, the FUSE target module sends a connection response message to the transport layer module through the management message queue, and the connection response message includes the connection result information.
[0162] The connection request includes at least one of the following initial negotiation information: the CPU byte order of the host device, the CPU architecture type of the host device, and the inline data size of the transport layer module. The inline data size of the transport layer module is used to represent the maximum receiving memory of the transport layer module.
[0163] In some embodiments, the FUSE target module may also create a request message queue, a notification message queue, and a priority message queue corresponding to the RDMA network.
[0164] Among them, the priority message queue is used to transmit FUSE requests with a priority greater than or equal to the preset level and response messages to FUSE requests, the request message queue is used to transmit FUSE requests with a priority less than the preset level and response messages to FUSE requests, and the notification message queue is used to transmit event notification messages corresponding to notification operations.
[0165] In some embodiments, the FUSE target module may also obtain the memory capacity information of the distributed storage device and the service capacity planning information of the file system. Subsequently, the FUSE target module determines the maximum receiving memory of the FUSE target module according to the memory capacity information and the service capacity planning information of the distributed storage device. Finally, the FUSE target module adds the maximum receiving memory of the FUSE target module to fuse_rdma_admin_completion and sends it to the transport layer module.
[0166] S302. The FUSE target module processes the FUSE request through the file system service according to the data of the file system stored in the storage module, and generates a response message of the FUSE request.
[0167] In some embodiments, if the received operation instruction sent by the transport layer module includes a read instruction, the FUSE target module reads the FUSE request in the first RDMA memory area according to the identification information of the first RDMA memory area in the read instruction. If the received operation instruction sent by the transport layer module does not include a read instruction, the FUSE target module receives the FUSE request sent by the transport layer module through the corresponding send operation of the RDMA network.
[0168] S303. The FUSE target module sends a response message of the FUSE request to the transport layer module through the RDMA network.
[0169] In some embodiments, the FUSE target module determines whether the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module; if the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module, the FUSE target module sends a response message of the FUSE request to the transport layer module through a sending operation corresponding to the RDMA network.
[0170] If the memory occupied by the response message is larger than the maximum receiving memory of the transport layer module, the FUSE target module writes the response message in the second RDMA memory area according to the write instruction in the operation instruction sent by the transport layer module, and the write instruction includes the identification information of the second RDMA memory area. Subsequently, the FUSE target module writes the response message in the second RDMA memory area.
[0171] Figure 5 A flowchart of another method for processing a file system request provided in an embodiment of the present application is shown as follows: Figure 5 As shown, the method for processing the file system request is applied to a host device, the host device includes a user space file system FUSE kernel module and a transport layer module, and the method for processing the system request includes S401-S408:
[0172] S401. The transport layer module obtains memory capacity information of a host device and service capacity planning information of a file system.
[0173] S402: The transport layer module determines the maximum receiving memory of the transport layer module according to the memory capacity information and service capacity planning information of the host device. S403: The FUSE kernel module obtains the file system request initiated by the application, and encapsulates the file system request according to the FUSE protocol to generate a FUSE request.
[0174] S404: The transport layer module obtains a FUSE request from the FUSE kernel module.
[0175] S405. The transport layer module determines whether the memory occupied by the FUSE request is less than or equal to the maximum receiving memory of the FUSE target module.
[0176] If yes, execute S406, if no, execute S407.
[0177] S406: The transport layer module sends the FUSE request to the FUSE target module through a sending operation corresponding to the RDMA network.
[0178] S407: The transport layer module registers the memory occupied by the FUSE request as the first RDMA memory area.
[0179] S408. The transport layer module sends an operation instruction including a read instruction to the FUSE target module through a send operation corresponding to the RDMA network. The read instruction includes identification information of the first RDMA memory area. The read instruction is used to instruct the FUSE target module to read the FUSE request from the first RDMA memory area.
[0180] Figure 6 A flowchart of another method for processing a file system request provided in an embodiment of the present application is shown as follows: Figure 6 As shown, the method for processing the file system request is applied to a distributed storage device, the distributed storage device includes a FUSE target module and a storage module, and the method for processing the file system request includes S501-S508:
[0181] S501. The FUSE target module obtains memory capacity information of a distributed storage device and service capacity planning information of a file system.
[0182] S502. The FUSE target module determines the maximum receiving memory of the FUSE target module according to the memory capacity information and service capacity planning information of the distributed storage device.
[0183] S503. The FUSE target module sends the maximum receiving memory of the FUSE target module to the transport layer module.
[0184] S504: The FUSE target module processes the FUSE request through the file system service according to the data of the file system stored in the storage module, and generates a response message of the FUSE request.
[0185] S505. The FUSE target module determines whether the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module.
[0186] If yes, execute S506, if no, execute S507.
[0187] S506. The FUSE target module sends a response message of the FUSE request to the transport layer module through a sending operation corresponding to the RDMA network.
[0188] S507. The FUSE target module writes a response message of the FUSE request in the second RDMA memory area of the transport layer module according to the operation instruction including the write instruction sent by the transport layer module, wherein the write instruction includes identification information of the second RDMA memory area of the transport layer module.
[0189] S508: The FUSE target module writes a response message in the second RDMA memory area.
[0190] The following describes the interaction process between the host device and the distributed storage device. Figure 7 A signaling interaction diagram of a method for processing a file system request provided in an embodiment of the present application, such as Figure 7 As shown, the method for processing the file system request includes S601-S605:
[0191] S601. The FUSE kernel module obtains a file system request initiated by an application program, and encapsulates the file system request according to a FUSE protocol to generate a FUSE request.
[0192] S602: The transport layer module obtains a FUSE request from the FUSE kernel module.
[0193] S603: The transport layer module sends the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network.
[0194] S604: The FUSE target module processes the FUSE request through the file system service according to the data of the file system stored in the storage module.
[0195] S605. The FUSE target module sends a response message of the FUSE request to the transport layer module through the RDMA network.
[0196] The method for processing file system requests provided in an embodiment of the present application is applied to a host device, and the host device includes a user space file system FUSE kernel module and a transport layer module. The FUSE kernel module first obtains the file system request initiated by the application, and encapsulates the file system request according to the FUSE protocol to generate a FUSE request. Subsequently, the transport layer module obtains the FUSE request from the FUSE kernel module, and sends the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network, and the FUSE target module is used to process the FUSE request through the file system service. Since the transport layer module of the operating system directly sends the FUSE request to the FUSE target module in the distributed storage device through the RDMA network, there is no need to perform user-mode kernel-mode context switching when processing the FUSE request, thereby reducing the computing overhead and improving the performance of the file system.
[0197] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0198] Based on the same inventive concept, the embodiment of the present application also provides a file system request processing device for implementing the file system request processing method involved above. The implementation scheme for solving the problem provided by the file system request processing device is similar to the implementation scheme recorded in the above method, so the specific limitations in the file system request processing device embodiment provided below can refer to the limitations of the file system request processing method above, and will not be repeated here.
[0199] In an exemplary embodiment, Figure 8 As shown, a file system request processing device 700 is provided, which is applied to a host device and includes: a FUSE kernel module 701 and a transport layer module 702, wherein:
[0200] The FUSE kernel module 701 is used to obtain a file system request initiated by an application, and encapsulate the file system request according to the FUSE protocol to generate a FUSE request.
[0201] The transport layer module 702 is used to obtain the FUSE request from the FUSE kernel module and send the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network. The FUSE target module is used to process the FUSE request through the file system service.
[0202] In some embodiments, the transport layer module 702 is further used to receive a response message of a FUSE request sent by the FUSE target module through the RDMA network; and send the response message to the FUSE kernel module.
[0203] In some embodiments, the transport layer module 702 is further used to receive a mount command, which includes an Internet Protocol IP address and a port number of a FUSE target module; and to establish an RDMA network connection with the FUSE target module according to the IP address and the port number.
[0204] In some embodiments, the transport layer module 702 is also used to create a management message queue corresponding to the RDMA network; send a connection request to the FUSE target module through the management message queue according to the IP address and port number; receive a connection response message sent by the FUSE target module, the connection response message includes connection result information, and the connection result information is used to indicate that the transport layer module and the FUSE target module successfully establish an RDMA network connection, or the connection result information is used to indicate the type of connection failure.
[0205] The connection request includes at least one of the following initial negotiation information: the CPU byte order of the host device, the CPU architecture type of the host device, and the inline data size of the transport layer module. The inline data size of the transport layer module is used to represent the maximum receiving memory of the transport layer module.
[0206] In some embodiments, the transport layer module 702 is further used to send a disconnect instruction to the FUSE target module through the management message queue; and release the resources occupied by the management message queue.
[0207] In some embodiments, the transport layer module 702 is further used to create a request message queue, a notification message queue, and a priority message queue corresponding to the RDMA network.
[0208] Among them, the priority message queue is used to transmit FUSE requests with a priority greater than or equal to the preset level and response messages to FUSE requests, the request message queue is used to transmit FUSE requests with a priority less than the preset level and response messages to FUSE requests, and the notification message queue is used to transmit event notification messages corresponding to notification operations.
[0209] In some embodiments, the transport layer module 702 is further used to communicate with the FUSE target module via the RDMA network through a request message queue or a priority message queue to send the FUSE request to the FUSE target module.
[0210] In some embodiments, the transport layer module 702 is also used to obtain the memory capacity information of the host device and the service capacity planning information of the file system; determine the maximum receiving memory of the transport layer module based on the memory capacity information and the service capacity planning information of the host device; and send the maximum receiving memory of the transport layer module to the FUSE target module.
[0211] In some embodiments, the transport layer module 702 is also used to determine whether the memory occupied by the FUSE request is less than or equal to the maximum receiving memory of the FUSE target module; if the memory occupied by the FUSE request is less than or equal to the maximum receiving memory of the FUSE target module, the FUSE request is sent to the FUSE target module through the corresponding sending operation of the RDMA network.
[0212] In some embodiments, the transport layer module 702 is also used to register the memory occupied by the FUSE request as a first RDMA memory area if the memory occupied by the FUSE request is larger than the maximum receiving memory of the FUSE target module; send an operation including a read instruction to the FUSE target module, the read instruction including identification information of the first RDMA memory area, and the read instruction is used to instruct the FUSE target module to read the FUSE request from the first RDMA memory area.
[0213] In some embodiments, the transport layer module 702 is further used to receive a response message sent by the FUSE target module through a sending operation corresponding to the RDMA network if the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module.
[0214] In some embodiments, the transport layer module 702 is also used to register the memory occupied by the response message as a second RDMA memory area if the memory occupied by the response message is larger than the maximum receiving memory of the transport layer module; and send an operation instruction including a write instruction to the FUSE target module, wherein the write instruction includes identification information of the second RDMA memory area, and the write instruction is used to instruct the FUSE target module to write the response message into the second RDMA memory area.
[0215] In an exemplary embodiment, Fig. 9 As shown, a file system request processing device 800 is provided, which is applied to a distributed storage device, including: a storage module 801 and a FUSE target module 802, wherein:
[0216] The storage module 801 is used to store file system data.
[0217] The FUSE target module 802 is used to receive a FUSE request sent by the transport layer module of the host device through the RDMA network; and process the FUSE request through the file system service according to the data of the file system stored in the storage module.
[0218] In some embodiments, the FUSE target module 802 is further used to send a response message of the FUSE request to the transport layer module through the RDMA network.
[0219] In some embodiments, the FUSE target module 802 is also used to create a management message queue corresponding to the RDMA network; receive a connection request sent by the transport layer module through the management message queue; determine whether to establish an RDMA network connection with the transport layer module based on the initial negotiation information in the connection request and generate connection result information corresponding to the connection request, the connection result information is used to indicate that the transport layer module and the FUSE target module successfully establish an RDMA network connection, or the connection result information is used to indicate the type of connection failure; send a connection response message to the transport layer module through the management message queue, and the connection response message includes the connection result information.
[0220] The connection request includes at least one of the following initial negotiation information: the CPU byte order of the host device, the CPU architecture type of the host device, and the inline data size of the transport layer module. The inline data size of the transport layer module is used to represent the maximum receiving memory of the transport layer module.
[0221] In some embodiments, the FUSE target module 802 is also used to create a request message queue, a notification message queue, and a priority message queue corresponding to the RDMA network.
[0222] Among them, the priority message queue is used to transmit FUSE requests with a priority greater than or equal to the preset level and response messages to FUSE requests, the request message queue is used to transmit FUSE requests with a priority less than the preset level and response messages to FUSE requests, and the notification message queue is used to transmit event notification messages corresponding to notification operations.
[0223] In some embodiments, the FUSE target module 802 is also used to obtain the memory capacity information of the distributed storage device and the service capacity planning information of the file system; determine the maximum receiving memory of the FUSE target module based on the memory capacity information and the service capacity planning information of the distributed storage device; and send the maximum receiving memory of the FUSE target module to the transport layer module.
[0224] In some embodiments, the FUSE target module 802 is also used to read the FUSE request in the first RDMA memory area according to the identification information of the first RDMA memory area in the read instruction if the operation instruction received from the transport layer module includes a read instruction; if the operation instruction received from the transport layer module does not include a read instruction, then receive the FUSE request sent by the transport layer module through the sending operation corresponding to the RDMA network.
[0225] In some embodiments, the FUSE target module 802 is also used to determine whether the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module; if the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module, the response message is sent to the transport layer module through the corresponding sending operation of the RDMA network.
[0226] In some embodiments, the FUSE target module 802 is also used to write the response message in the second RDMA memory area according to the write instruction in the operation instruction sent by the transport layer module if the memory occupied by the response message is larger than the maximum receiving memory of the transport layer module, and the write instruction includes the identification information of the second RDMA memory area; and write the response message in the RDMA memory area.
[0227] Each module in the above-mentioned file system request processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0228] In one embodiment, a computer device is provided, which may be a host device or a remote service device. The computer device includes a chip, and the computer device can implement the above-mentioned method for processing file system requests on the host device or remote service device side. The internal structure diagram of the computer device can be as follows: Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a message reordering method is implemented. Those skilled in the art can understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0229] In one embodiment, a chip is provided. The chip includes a memory and a processor, and the memory stores a computer program. When the processor executes the computer program, the processing method of the file system request is implemented. The chip may be a data processing unit (DPU) chip.
[0230] In one embodiment, a network interface card is provided, the network interface card includes the above chip and multiple interfaces, and the chip communicates with the outside through the interface. The interface includes a PCI / PCIE interface, a network interface, and the like.
[0231] In one embodiment, an electronic device is provided. The electronic device includes a processor and the above-mentioned network interface card. The network interface card is used to dispatch messages to the processor or the network interface card itself for processing, and the processor is used to process the messages dispatched by the network interface card.
[0232] In one embodiment, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method for processing a file system request is implemented.
[0233] In one embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned method for processing file system requests when executed by a processor.
[0234] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0235] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0236] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for processing a file system request, characterized in that: Applied to a host device, the host device includes a user space file system FUSE kernel module and a transport layer module; The method for processing the file system request includes: The FUSE kernel module obtains a file system request initiated by an application, and encapsulates the file system request according to the FUSE protocol to generate a FUSE request; The transport layer module obtains the FUSE request from the FUSE kernel module, and sends the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network. The FUSE target module is used to process the FUSE request through the file system service.
2. The method according to claim 1, characterized in that After sending the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network, the method further includes: The transport layer module receives a response message of the FUSE request sent by the FUSE target module through the RDMA network; The transport layer module sends the response message to the FUSE kernel module.
3. The method according to claim 2, characterized in that The method further comprises: The transport layer module receives a mount command, wherein the mount command includes an Internet Protocol IP address and a port number of the FUSE target module; The transport layer module establishes an RDMA network connection with the FUSE target module according to the IP address and the port number.
4. The method according to claim 3, characterized in that The transport layer module establishes an RDMA network connection with the FUSE target module according to the IP address and the port number, including: The transport layer module creates a management message queue corresponding to the RDMA network; The transport layer module sends a connection request to the FUSE target module through the management message queue according to the IP address and the port number; The transport layer module receives a connection response message sent by the FUSE target module, wherein the connection response message includes connection result information, and the connection result information is used to indicate that the transport layer module successfully establishes an RDMA network connection with the FUSE target module, or the connection result information is used to indicate a connection failure type; Among them, the connection request includes at least one of the following initial negotiation information: the byte order of the central processing unit CPU of the host device, the architecture type of the CPU of the host device and the inline data size of the transport layer module, and the inline data size of the transport layer module is used to characterize the maximum receiving memory of the transport layer module.
5. The method according to claim 4, characterized in that The method further comprises: The transport layer module sends a disconnect instruction to the FUSE target module through the management message queue; The transport layer module releases the resources occupied by the management message queue.
6. The method according to claim 3, characterized in that After the transport layer module receives the mount command, the method further includes: The transport layer module creates a request message queue, a notification message queue and a priority message queue corresponding to the RDMA network; Among them, the priority message queue is used to transmit FUSE requests with a priority greater than or equal to a preset level and response messages to FUSE requests, the request message queue is used to transmit FUSE requests with a priority less than the preset level and response messages to FUSE requests, and the notification message queue is used to transmit event notification messages corresponding to notification operations.
7. The method according to claim 6, characterized in that The method of sending the FUSE request to a FUSE target module in a distributed storage device through a remote direct data access (RDMA) network includes: The transport layer module communicates with the FUSE target module via the RDMA network through the request message queue or the priority message queue to send the FUSE request to the FUSE target module.
8. The method according to claim 4, characterized in that The method further comprises: The transport layer module obtains the memory capacity information of the host device and the service capacity planning information of the file system; The transport layer module determines the maximum receiving memory of the transport layer module according to the memory capacity information and service capacity planning information of the host device; The transport layer module sends the maximum receive memory of the transport layer module to the FUSE target module.
9. The method according to claim 8, characterized in that The method of sending the FUSE request to a FUSE target module in a distributed storage device through a remote direct data access (RDMA) network includes: The transport layer module determines whether the memory occupied by the FUSE request is less than or equal to the maximum receiving memory of the FUSE target module; If the memory occupied by the FUSE request is less than or equal to the maximum receiving memory of the FUSE target module, the transport layer module sends the FUSE request to the FUSE target module through a sending operation corresponding to the RDMA network.
10. The method according to claim 9, characterized in that After determining whether the memory occupied by the FUSE request is less than or equal to the maximum receiving memory of the FUSE target module, the method further includes: If the memory occupied by the FUSE request is larger than the maximum receiving memory of the FUSE target module, the transport layer module registers the memory occupied by the FUSE request as the first RDMA memory area; The transport layer module sends an operation instruction including a read instruction to the FUSE target module, wherein the read instruction includes identification information of the first RDMA memory area, and the read instruction is used to instruct the FUSE target module to read the FUSE request from the first RDMA memory area.
11. The method according to claim 8, characterized in that The transport layer module receives a response message of the FUSE request sent by the FUSE target module through the RDMA network, including: If the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module, the transport layer module receives the response message sent by the FUSE target module through the sending operation corresponding to the RDMA network.
12. The method according to claim 11, characterized in that The transport layer module receives a response message of the FUSE request sent by the FUSE target module through the RDMA network, and further includes: if the memory occupied by the response message is greater than the maximum receiving memory of the transport layer module, the transport layer module registers the memory occupied by the response message as a second RDMA memory area; The transport layer module sends an operation instruction including a write instruction to the FUSE target module, wherein the write instruction includes identification information of the second RDMA memory area, and the write instruction is used to instruct the FUSE target module to write the response message into the second RDMA memory area.
13. A method for processing a file system request, characterized in that: Applied to a distributed storage device, the distributed storage device includes a FUSE target module and a storage module, and the method for processing a file system request includes: The FUSE target module receives a FUSE request sent by a transport layer module of a host device through an RDMA network; The FUSE target module processes the FUSE request through a file system service according to the data of the file system stored in the storage module.
14. The method according to claim 13, characterized in that After processing the FUSE request by the file system service, the method further includes: The FUSE target module sends a response message of the FUSE request to the transport layer module through the RDMA network.
15. The method according to claim 13, characterized in that The method further comprises: The FUSE target module creates a management message queue corresponding to the RDMA network; The FUSE target module receives the connection request sent by the transport layer module through the management message queue; The FUSE target module determines whether to establish an RDMA network connection with the transport layer module according to the initial negotiation information in the connection request and generates connection result information corresponding to the connection request, wherein the connection result information is used to indicate that the transport layer module successfully establishes an RDMA network connection with the FUSE target module, or the connection result information is used to indicate a connection failure type; The FUSE target module sends a connection response message to the transport layer module through the management message queue, wherein the connection response message includes connection result information; Among them, the connection request includes at least one of the following initial negotiation information: the byte order of the central processing unit CPU of the host device, the architecture type of the CPU of the host device and the inline data size of the transport layer module, and the inline data size of the transport layer module is used to characterize the maximum receiving memory of the transport layer module.
16. The method according to claim 13, characterized in that The method further comprises: The FUSE target module creates a request message queue, a notification message queue and a priority message queue corresponding to the RDMA network; Among them, the priority message queue is used to transmit FUSE requests with a priority greater than or equal to a preset level and response messages to FUSE requests, the request message queue is used to transmit FUSE requests with a priority less than the preset level and response messages to FUSE requests, and the notification message queue is used to transmit event notification messages corresponding to notification operations.
17. The method according to claim 14, characterized in that The method further comprises: The FUSE target module obtains the memory capacity information of the distributed storage device and the service capacity planning information of the file system; The FUSE target module determines the maximum receiving memory of the FUSE target module according to the memory capacity information and service capacity planning information of the distributed storage device; The FUSE target module sends the maximum receive memory of the FUSE target module to the transport layer module.
18. The method according to claim 17, characterized in that The FUSE target module receives a FUSE request sent by the transport layer module of the host device through the RDMA network, including: If the received operation instruction sent by the transport layer module includes a read instruction, the FUSE target module reads the FUSE request in the first RDMA memory area according to the identification information of the first RDMA memory area in the read instruction; If the received operation instruction sent by the transport layer module does not include a read instruction, the FUSE target module receives a FUSE request sent by the transport layer module through a sending operation corresponding to the RDMA network.
19. The method according to claim 17, characterized in that The FUSE target module sends a response message of the FUSE request to the transport layer module through the RDMA network, including: The FUSE target module determines whether the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module; If the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module, the FUSE target module sends the response message to the transport layer module through the sending operation corresponding to the RDMA network.
20. The method according to claim 19, characterized in that After the FUSE target module determines whether the memory occupied by the response message is less than or equal to the maximum receiving memory of the transport layer module, the method further includes: If the memory occupied by the response message is larger than the maximum receiving memory of the transport layer module, the FUSE target module writes the response message in the second RDMA memory area according to the write instruction in the operation instruction sent by the transport layer module, and the write instruction includes the identification information of the second RDMA memory area.
21. A device for processing file system requests, characterized in that: Applied to a host device, the file system request processing device comprises: The FUSE kernel module is used to obtain the file system request initiated by the application, and encapsulate the file system request according to the FUSE protocol to generate a FUSE request; The transport layer module is used to obtain the FUSE request from the FUSE kernel module and send the FUSE request to the FUSE target module in the distributed storage device through the remote direct data access RDMA network. The FUSE target module is used to process the FUSE request through the file system service.
22. A device for processing file system requests, characterized in that: Applied to a distributed storage device, the file system request processing device comprises: Storage module, used to store file system data; The FUSE target module is used to receive a FUSE request sent by a transport layer module of a host device through an RDMA network; and process the FUSE request through a file system service according to the data of the file system stored in the storage module.
23. A chip, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method according to any one of claims 1 to 20 when executing the computer program.
24. A computer device comprising a processor and the chip according to claim 23, characterized in that: The chip is used to dispatch the message to the processor or the chip itself for processing, and the processor is used to process the message dispatched by the chip.
25. A network interface card, characterized in that: It comprises the chip and the interface as claimed in claim 23, and the chip communicates externally through the interface.
26. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 20 are implemented.
27. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 20 are implemented.
Citation Information
Cited By
Acceleration system and method under user mode file system unloading device
CN122111681A
An acceleration system and method under a user mode file system offload apparatus
CN122111681B