User space file system, file operation method and computing equipment

By using shared memory on computing devices to realize two-way communication between the kernel module and the user space daemon, the problem of frequent switching and data copying of user states and kernel states is solved, and the performance of the file system is improved.

CN120196590APending Publication Date: 2025-06-24HUAWEI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311775024.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

The existing user space file system frequently switches and copys data between user state and kernel state, resulting in large file access overhead and latency and lower performance.

Method used

By introducing shared memory on computing devices, the kernel module and user space daemon can communicate directly in shared memory, reducing switching and data copying between user state and kernel state.

Benefits of technology

Reduces the overhead and latency of file access and improves the performance of user space file system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120196590A_ABST
    Figure CN120196590A_ABST
Patent Text Reader

Abstract

The invention discloses a user space file system, a file operation method and computing equipment, and belongs to the technical field of computers. The user space file system is applied to the computing device, the computing device comprises a shared memory, the user space file system comprises a kernel module and a user space daemon process, the kernel module runs in a kernel mode, and the user space daemon process runs in a user mode. The kernel module and the user space daemon process can access the shared memory so as to realize bidirectional communication between a user mode and a kernel mode. According to the user space file system, the user mode and the kernel mode can share the same memory, and then messages and data in the memory can be shared, so that frequent switching and data copying between the user mode and the kernel mode can be reduced, the overhead and time delay of file access are reduced, and the performance of the user space file system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technologies, and particularly to a user-space file system, a file operation method, and a computing device. Background Art

[0002] A Filesystem in Userspace (FUSE) is a file system framework implemented in user space, which includes a FUSE kernel module and a user-space daemon (FUSE daemon). The core implementation of the file system is included in these modules, shielding complex operations from users. Users only need to implement specific file operations according to the interfaces provided by FUSE, which can facilitate users' file operations.

[0003] In related technologies, the FUSE kernel module registers a block device / dev / fuse and a FUSE driver in kernel space. The block device / dev / fuse is a communication interface between the FUSE driver and the FUSE daemon. When a user process initiates a file operation request, the operating system sends the file operation request to the virtual file system (VFS) in kernel space through a system call. The VFS sends the file operation request to the message queue of the FUSE driver; the FUSE driver suspends the file operation request, and at this time the user process is in a waiting state; the FUSE daemon obtains the operation request in the message queue through / dev / fuse and executes the operation corresponding to the file operation request. After the operation is completed, the FUSE daemon writes the response message of the file operation request into the message queue of the FUSE driver through / dev / fuse; the FUSE driver wakes up the user process and returns the response message to the user process through the VFS.

[0004] However, in the above method, the access path of the user process to the file is long, and it is necessary to frequently switch between the user state and the kernel state and perform data copying, resulting in large overhead and latency for file access and low FUSE performance. Summary of the Invention

[0005] Embodiments of this application provide a user-space file system, a file operation method, and a computing device, which can reduce the frequent switching and data copying between the user state and the kernel state, reduce the overhead and latency of file access, and improve the performance of the user-space file system. The technical solution is as follows.

[0006] In a first aspect, a user-space file system is provided, which is applied to a computing device. The computing device includes a shared memory. The user-space file system includes a kernel module and a user-space daemon. The kernel module runs in kernel mode, and the user-space daemon runs in user mode. The kernel module and the user-space daemon can access the shared memory to achieve two-way communication between user mode and kernel mode.

[0007] Through the above user-space file system, user mode and kernel mode can share the same piece of memory, and thus can share the messages and data in this memory, thereby reducing the frequent switching and data copying between user mode and kernel mode, reducing the overhead and latency of file access, and improving the performance of the user-space file system.

[0008] Optionally, the kernel module is used for:

[0009] In response to a file operation request initiated by a user process, write the file operation request into the shared memory;

[0010] The user-space daemon is used for:

[0011] Read the file operation request from the shared memory and execute the file operation corresponding to the file operation request;

[0012] Write the response message corresponding to the file operation request into the shared memory;

[0013] The kernel module is further used to read the response message from the shared memory and send the read response message to the user process.

[0014] Among them, the user process can be a local user process or a remote user process. A local user process refers to a user process running on the same computing device as the user-space file system, and a remote user process refers to a user process running on a different computing device from the user-space file system.

[0015] Among them, the file operation request includes an operation request for metadata and read / write requests for data. The operation request for metadata is, for example, a file creation request, a file link request, a file view request, a file deletion request, a file open request, and a file close request, etc.; the read / write requests for data include a data read request and a data write request. The above user-space file system can be applied to scenarios where a user process performs metadata operations, scenarios where a user process reads data, and scenarios where a user process writes data.

[0016] Optionally, the shared memory stores a first message queue and a second message queue;

[0017] The kernel module is used to: in response to a file operation request initiated by a user process, write the file operation request into the first message queue;

[0018] The user space daemon process is used to:

[0019] Read the file operation request from the first message queue and execute the file operation corresponding to the file operation request;

[0020] Write the response message corresponding to the file operation request into the second message queue;

[0021] The kernel module is further used to read the response message from the second message queue and send the read response message to the user process.

[0022] Wherein, the first message queue is used to cache the file operation requests corresponding to the user process, and the second message queue is used to cache the response messages corresponding to the user process. In some embodiments, the first message queue is called the sending queue, and the second message queue is called the receiving queue. The embodiments of the present application do not make any limitations in this regard. In some embodiments, after the kernel module determines the first memory block from the shared memory, it marks the status of the first memory block as occupied by the user process.

[0023] By storing the first message queue and the second message queue in the shared memory respectively through the above user space file system, the throughput capacity of the shared memory for file operation requests can be improved, thereby further enhancing the performance of the user space file system.

[0024] Optionally, the user space daemon process is used to:

[0025] Read the file operation request from the shared memory in a polling manner.

[0026] Wherein, polling refers to periodically querying the status of an asynchronous task to determine whether the asynchronous task has been completed and obtaining the result after the asynchronous task is completed. The user space daemon process reads the file operation request from the first message queue in a polling manner means that the user space daemon process periodically queries the first message queue, and when there is a file operation request in the first message queue, the user space daemon process reads the file operation request from the first message queue.

[0027] Through the above user space file system, the user space daemon process obtains the file operation request from the message queue in a polling manner, without the need to establish an additional communication mechanism between the kernel module and the user space daemon process, which can simplify the communication process between the kernel module and the user space daemon process.

[0028] Optionally, the kernel module is used to:

[0029] Read the response message from the shared memory in a polling manner.

[0030] Among them, the kernel module reads the response message from the second message queue in a polling manner means that the kernel module periodically queries the second message queue. When there is a file operation request in the second message queue, the kernel module reads the response message from the second message queue.

[0031] Through the above user space file system, the kernel module obtains messages from the message queue in a polling manner, without the need to establish an additional communication mechanism between the kernel module and the user space daemon process, which can simplify the communication process between the kernel module and the user space daemon process.

[0032] Optionally, the user process is a remote user process, and the kernel module is used for:

[0033] In response to the user process initiating a file operation request through a remote procedure call, write the file operation request into the shared memory.

[0034] In a second aspect, a file operation method is provided, which is applied to a computing device. The computing device is configured with a user space file system and a shared memory. The user space file system includes a kernel module and a user space daemon process. The kernel module runs in the kernel state, and the user space daemon process runs in the user state. The kernel module and the user space daemon process can access the shared memory;

[0035] The method includes: in response to a file operation request initiated by a user process, the kernel module writes the file operation request into the shared memory; the user space daemon process reads the file operation request from the shared memory and executes the file operation corresponding to the file operation request; the user space daemon process writes the response message corresponding to the file operation request into the shared memory; the kernel module reads the response message from the shared memory and sends the read response message to the user process.

[0036] Optionally, the shared memory stores a first message queue and a second message queue;

[0037] In response to a file operation request initiated by a user process, the kernel module writes the file operation request into the shared memory, including: in response to a file operation request initiated by a user process, the kernel module writes the file operation request into the first message queue;

[0038] The user space daemon process reads the file operation request from the shared memory and executes the file operation corresponding to the file operation request, including: the user space daemon process reads the file operation request from the first message queue and executes the file operation corresponding to the file operation request;

[0039] The user space daemon process writes the response message corresponding to the file operation request into the shared memory, including: the user space daemon process writes the response message corresponding to the file operation request into the second message queue;

[0040] The kernel module reads the response message from the shared memory and sends the read response message to the user process, including: the kernel module reads the response message from the second message queue and sends the read response message to the user process.

[0041] Optionally, the user space daemon process reads the file operation request from the shared memory, including: the user space daemon process reads the file operation request from the shared memory in a polling manner.

[0042] Optionally, the kernel module reads the response message from the shared memory, including: the kernel module reads the response message from the shared memory in a polling manner.

[0043] Optionally, the user process is a remote user process;

[0044] In response to a file operation request initiated by a user process, the kernel module writes the file operation request into the shared memory, including: in response to the user process initiating a file operation request through a remote procedure call, writing the file operation request into the shared memory.

[0045] In a third aspect, a file operation device is provided, which is applied to a kernel module in a user space file system. The user space file system further includes a user space daemon process. The device includes at least one functional module, and the at least one functional module is used to execute the functions of the kernel module in the user space file system provided in the foregoing first aspect or any optional manner in the first aspect.

[0046] In a fourth aspect, a file operation device is provided, which is applied to a user space daemon process in a user space file system. The user space file system further includes a kernel module. The device includes at least one functional module, and the at least one functional module is used to execute the functions of the user space daemon process in the user space file system provided in the foregoing first aspect or any optional manner in the first aspect.

[0047] In a fifth aspect, a computing device is provided. The computing device includes a shared memory, and the user space file system as shown in the foregoing first aspect or any optional manner of the first aspect runs on the computing device.

[0048] In a sixth aspect, a storage system is provided. The storage system includes at least one computing device and a storage device. The computing device includes a shared memory, and a user space file system as shown in the first aspect or any optional implementation manner of the first aspect runs on the computing device to implement operations on files in the storage device.

[0049] In a seventh aspect, a storage medium is provided, characterized in that the storage medium is used to store at least one segment of program code, and the at least one segment of program code is used to implement the user space file system as shown in the first aspect or any optional implementation manner of the first aspect.

[0050] Based on the implementation manners provided in the above aspects of the present application, further combinations can be made to provide more implementation manners. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 is a schematic structural diagram of a storage system provided by an embodiment of the present application;

[0052] Figure 2 is a schematic structural diagram of a storage system provided by an embodiment of the present application;

[0053] Figure 3 is a schematic structural diagram of a storage system provided by an embodiment of the present application;

[0054] Figure 4 is a schematic structural diagram of a computing device 101 provided by an embodiment of the present application;

[0055] Figure 5 is a flowchart of a file operation method provided by an embodiment of the present application;

[0056] Figure 6 is a flowchart of a file operation method provided by an embodiment of the present application;

[0057] Figure 7 is a flowchart of a file operation method provided by an embodiment of the present application;

[0058] Figure 8 is a flowchart of a file operation method provided by an embodiment of the present application;

[0059] Figure 9 is a schematic flowchart of a file operation method provided by an embodiment of the present application;

[0060] Figure 10 is a schematic structural diagram of a file operation device provided by an embodiment of the present application;

[0061] Figure 11 is a schematic structural diagram of a file operation device provided by an embodiment of the present application. Detailed implementation manners

[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following will further describe the implementation manners of this application in detail with reference to the accompanying drawings.

[0063] First, the implementation environment of the embodiments of this application will be introduced.

[0064] Figure 1 is a schematic structural diagram of a storage system provided by an embodiment of this application. As Figure 1 shown, the storage system 100 includes a computing device 101 and a storage device 102. The computing device 101 and the storage device 102 are communicatively connected by wire or wirelessly.

[0065] Among them, the computing device 101 is a computing server, an application server, etc. The computing device 101 can generally refer to one of multiple computing devices. In the embodiments of the present application, only the computing device 101 is used as an example for illustration. Those skilled in the art can know that in some embodiments, the number of the above-mentioned computing devices 101 is more or less. The embodiments of the present application do not limit the type and number of the computing devices 101. A user program and a user space file system are running on the computing device 101. Among them, the user program is at least one of various application programs such as a key value file system (KVFS), an artificial intelligence (AI) application, an office application, or a database application, etc. The embodiments of the present application do not limit the type of the user program. The user program can mount the user space file system, and the user process corresponding to the user program can initiate a file operation request. Then, the user space file system executes the operation corresponding to the file operation request on the storage device 102 and returns the response message corresponding to the file operation request to the user process. The user space file system includes a kernel module and a user space daemon process. The kernel module runs in the kernel state, and the user space daemon process runs in the user state. The user space daemon process is used to execute the operation corresponding to the file operation request on the storage device 102; the kernel module is used to transfer the file operation request and the response message corresponding to the file operation request between the user process and the user space daemon process. Among them, the computing device 101 includes a shared memory. The kernel module realizes the transfer of the file operation request and the response message based on the shared memory. The shared memory can be accessed by the kernel module and the user space daemon process to realize two-way communication between the kernel state and the user state. Exemplarily, in response to the user process initiating a file operation request, the kernel module writes the file operation request into the shared memory; the user space daemon process reads the file operation request from the shared memory, executes the operation corresponding to the file operation request on the storage device 102, and writes the corresponding response message into the shared memory; the kernel module reads the response message from the shared memory and sends the response message to the user process. In some embodiments, the kernel module registers a FUSE driver in the kernel space, and the FUSE driver transfers the file operation request and the corresponding response message between the user process and the user space daemon process.A virtual file system also runs on the computing device 101. The virtual file system runs in kernel mode and is used to transfer file operation requests and corresponding reply messages of file operation requests between user processes and kernel modules. In some other embodiments, in response to a user process initiating a file operation request, the virtual file system sends the file operation request to a kernel module, and the kernel module transfers the file operation request to a user space daemon process through shared memory; the kernel module sends the reply message corresponding to the file operation request read from the shared memory to the virtual file system, and the virtual file system sends the reply message to the user process.

[0066] The storage device 102 is a distributed storage device, a centralized storage device, etc. The storage device 102 can generally refer to one of multiple storage devices. Only the storage device 102 is used as an example in the embodiments of the present application. Those skilled in the art can understand that in some embodiments, the number of the storage devices 102 is more or less. The embodiments of the present application do not limit the type and number of the storage devices 102. Exemplarily, when the storage device 102 is a distributed storage device, the structure of the storage system 100 can be schematically shown by Figure 2 for illustration. Figure 2 is a schematic structural diagram of a storage system provided by an embodiment of the present application. As Figure 2 shown, the storage system 100 includes a computing device 101 and a storage device 102. A user program and a user space file system run on the computing device 101, and the storage device 102 includes multiple distributed storage servers. When the storage device 102 is a centralized storage device, the structure of the storage system 100 can be schematically shown by Figure 3 for illustration. Figure 3 is a schematic structural diagram of a storage system provided by an embodiment of the present application. As Figure 3 shown, the storage system 100 includes a computing device 101 and a storage device 102. A user program and a user space file system run on the computing device 101, and the storage device 102 includes multiple flash memory storage controllers and an external disk frame. It should be noted that the above description of the storage device 102 is only exemplary, and the embodiments of the present application do not limit the storage device 102.

[0067] It should be noted that the above Figures 1 to 3This is illustrated by taking a storage system including a computing device and a storage device as an example. In some embodiments, the storage system may be a single computing device, such as a server or a terminal, and the terminal may be, for example, a smart phone or a tablet computer, etc. The storage system includes a host and a memory. The host includes a shared memory. A user program and a user space file system are running on the host. The user program can mount the user space file system. The user process corresponding to the user program can initiate a file operation request. Then, the user space file system performs an operation corresponding to the file operation request on the memory and returns a response message corresponding to the file operation request to the user process. The process by which the host realizes two-way communication between the kernel state and the user state based on the shared memory is the same as that described above Figure 1 and will not be elaborated here.

[0068] In some embodiments, wired or wireless networks use standard communication technologies and / or protocols. The network is usually the Internet, but can also be any network, including but not limited to any combination of a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or a virtual private network. In some embodiments, technologies and / or formats including hyper text markup language (HTML), extensible markup language (XML), etc. are used to represent data exchanged through the network. In addition, conventional encryption technologies such as secure socket layer (SSL), transport layer security (TLS), virtual private network (VPN), internet protocol security (IPsec), etc. can also be used to encrypt all or some of the links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.

[0069] The structure of the above computing device 101 will be introduced below.

[0070] As Figure 4 shown, Figure 4 is a schematic structural diagram of a computing device 101 provided by an embodiment of the present application. The computing device 101 can be a host, a server or a personal computer, etc. The computing device 101 can be implemented by a general bus architecture.

[0071] The computing device 101 includes at least one processor 401, a communication bus 402, a memory 403, and at least one communication interface 404.

[0072] The processor 401 is, for example, a general-purpose central processing unit (CPU), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of this application. For example, the processor 401 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0073] The communication bus 402 is used to transmit information between the above components. The communication bus 402 can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 4 only one line is used to represent it, but it does not mean that there is only one bus or one type of bus.

[0074] The memory 403 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, such as a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, such as an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 403 is, for example, standalone and connected to the processor 401 via the communication bus 402. The memory 403 can also be integrated with the processor 401.

[0075] The communication interface 404 uses any device such as a transceiver for communicating with other devices or communication networks. The communication interface 404 includes a wired communication interface and may also include a wireless communication interface. Among them, the wired communication interface can be, for example, an Ethernet interface. The Ethernet interface can be an optical interface, an electrical interface or a combination thereof. The wireless communication interface can be a wireless local area networks (WLAN) interface, a cellular network communication interface or a combination thereof, etc.

[0076] As an example, the processor 401 can include one or more CPUs.

[0077] As an example, the computing device 101 can include multiple processors, each of which can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processors here can refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0078] As an example, the computing device 101 may further include an output device and an input device. The output device communicates with the processor 401 and can display information in various ways. For example, the output device may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device communicates with the processor 401 and can receive user input in various ways. For example, the input device may be a mouse, a keyboard, a touch screen device, or a sensing device, etc.

[0079] In some embodiments, the memory 403 is used to store program code for executing the solution of this application, and the processor 401 can execute the program code stored in the memory 403. That is, the computing device 101 can implement the file operation method provided in the method embodiment through the processor 401 and the program code in the memory 403.

[0080] An embodiment of this application provides a file operation method, which is applied to a computing device. The computing device is configured with a user space file system and a shared memory. The user space file system includes a kernel module running in the kernel state and a user space daemon process running in the user state. The kernel module and the user space daemon process can access the shared memory. In this method, the kernel module writes the file operation request initiated by the user process into the shared memory in response to the file operation request. The user space daemon process obtains the file operation request from the shared memory and executes it, and then writes the corresponding response message into the shared memory. The kernel module then obtains the response message from the shared memory and returns it to the user process. Through the above method, it is possible to reduce the frequent switching and data copying between the user state and the kernel state, reduce the overhead and latency of file access, and improve the performance of the user space file system.

[0081] Among them, the file operation request includes an operation request for metadata and read / write requests for data. The operation request for metadata is, for example, a file creation request, a file link request, a file view request, a file deletion request, a file open request, and a file close request, etc.; the read / write requests for data include a data read request and a data write request. The above method can be applied to scenarios where the user process performs metadata operations, scenarios where the user process reads data, and scenarios where the user process writes data. The flow of the file operation method in the above three scenarios will be introduced below.

[0082] The above file operation method will be introduced below by taking the scenario where the user process performs metadata operations as an example. Figure 5 is a flowchart of a file operation method provided by an embodiment of this application, asFigure 5 As shown, the method includes the following steps 501 to 509.

[0083] 501. The user process initiates a memory allocation request to the kernel module.

[0084] Among them, a user program is running on the computing device, and the user program can mount the user space file system. When the user program is running, the user process corresponding to the user program can initiate a file operation request. The user program runs in user mode, and the user program can be at least one of various types of applications such as a KVFS client, an AI application, an office application, or a database application. The embodiment of the present application does not limit the type of user program.

[0085] The user process can be a local user process or a remote user process. A local user process refers to a user process that runs on the same computing device as the user space file system, and a remote user process refers to a user process that runs on a different computing device from the user space file system. When the user process is a remote user process, the remote user process initiates a memory allocation request to the user space file system through a remote procedure call (RPC).

[0086] 502. The kernel module determines a first memory block from the shared memory in response to the memory allocation request, where the first memory block stores a first message queue and a second message queue.

[0087] The first message queue is used to cache the file operation request corresponding to the user process, and the second message queue is used to cache the response message corresponding to the user process. In some embodiments, the first message queue is called a send queue, and the second message queue is called a receive queue, which is not limited in the embodiments of the present application. In some embodiments, after the kernel module determines the first memory block from the shared memory, the state of the first memory block is marked as occupied by the user process.

[0088] In the above method, the kernel module allocates a memory block in the shared memory to the user process to cache the file operation request and response message corresponding to the user process, that is, different user processes correspond to different memory blocks in the shared memory, and different user processes correspond to their own message queues, so that the message queues of different user processes are isolated in the shared memory, and then data can be written or read in parallel between different memory blocks, which can improve the processing efficiency of file operation requests, reduce the delay of file access, and improve the performance of the user space file system; and, storing the first message queue and the second message queue respectively in the first memory block can improve the throughput capacity of the shared memory for file operation requests, thereby further improving the performance of the user space file system.

[0089] In some embodiments, the first memory block is a dirty memory, which refers to the memory that has been released but not initialized. After the kernel module determines the first memory block from the shared memory, it sends the logical address of the first memory block to the user process, and the local user process initializes the first memory block. In other embodiments, the first memory block is a clean memory, which refers to the memory that has been released and initialized, and the user process does not need to initialize the first memory block.

[0090] It should be noted that the above steps 501 to 502 are preparatory steps. In some embodiments, the user process can perform multiple file operations based on the first memory block allocated by the kernel module. That is, the user process only needs to send a memory allocation request to the kernel module once, and multiple subsequent file operation requests initiated by the user process can reuse the first memory block, without having to apply for memory from the kernel module before each file operation request is initiated, which can simplify the operation process of the user process and thus improve the efficiency of the user process in initiating file operation requests.

[0091] 503. The user process initiates a file operation request, and the file operation request is an operation request for metadata.

[0092] Among them, the file operation request includes information of the user process. In some embodiments, the user program provides a user interaction interface. In response to detecting an operation on the metadata in the user interaction interface, the user process initiates a file operation request corresponding to the operation. For example, the user interaction interface includes a file creation control, and in response to a trigger operation on the file creation control, the user process initiates a file creation request. It should be noted that the above description of the process of the user process initiating a file operation request is only exemplary, and the embodiments of the present application are not limited thereto.

[0093] 504. In response to the file operation request, the kernel module writes the file operation request into the first message queue in the first memory block.

[0094] Among them, the process of the kernel module writing the file operation request into the first message queue in the first memory block in response to the file operation request includes: the kernel module writes the file operation request into the first message queue in the memory block corresponding to the user process in the shared memory based on the information of the user process carried in the file operation request.

[0095] Among them, after the kernel module writes the file operation request into the first message queue, it blocks the user process, causing the user process to wait.

[0096] It should be noted that the above steps 503 to 504 are an implementation manner in which the kernel module writes the file operation request into the shared memory in response to the file operation request initiated by the user process. In some embodiments, this process is implemented based on other methods, and the embodiments of the present application do not limit this.

[0097] 505. The user space daemon process reads the file operation request from the first message queue.

[0098] Among them, the user space daemon process reads the file operation request from the first message queue in a polling manner. Polling refers to periodically querying the status of an asynchronous task to determine whether the asynchronous task has been completed and obtaining the result after the asynchronous task is completed. The user space daemon process reads the file operation request from the first message queue in a polling manner means that the user space daemon process periodically queries the first message queue, and when there is a file operation request in the first message queue, the user space daemon process reads the file operation request from the first message queue.

[0099] 506. The user space daemon process executes the operation corresponding to the file operation request.

[0100] Among them, in some embodiments, the user program registers the processing function corresponding to the file operation request with the user space daemon process in advance, and then the user space daemon process calls back the processing function corresponding to the file operation request to execute the operation corresponding to the file operation request.

[0101] It should be noted that the above steps 505 and 506 are described by taking the user space daemon process reading and executing one file operation request from the first message queue each time as an example. In some embodiments, after the user space daemon process reads the file operation request from the first message queue, if the first message queue is not empty, the user space daemon process continues to read the file operation request from the first message queue until the first message queue is empty. Then, the user space daemon process calls back the processing functions corresponding to the read file operation requests respectively to execute the operations corresponding to the read file operation requests respectively. In the above embodiments, the user space daemon process first reads multiple file operation requests from the first message queue and then executes the operations corresponding to the multiple file operation requests in parallel, which can improve the efficiency of file operations and enhance the performance of the user space file system.

[0102] It should be noted that the above steps 505 to 506 are an implementation manner in which the user space daemon process reads the file operation request from the shared memory and executes the file operation corresponding to the file operation request. In some embodiments, this process is implemented based on other methods, and the embodiments of the present application do not limit this.

[0103] 507. The user space daemon writes the response message corresponding to the file operation request into the second message queue in the first memory block.

[0104] Among them, the response message corresponding to the file operation request indicates that the operation corresponding to the file operation request has been completed. The response message includes information of the user process.

[0105] It should be noted that the above step 505 is an implementation manner for the user space daemon to write the response message corresponding to the file operation request into the shared memory. In some embodiments, this process is implemented based on other methods, and the embodiments of the present application do not limit this.

[0106] 508. The kernel module reads the response message from the second message queue and sends the response message to the user process.

[0107] Among them, the kernel module reads the response message from the second message queue in a polling manner. The kernel module reads the response message from the second message queue in a polling manner means that the kernel module periodically queries the second message queue. When the file operation request exists in the second message queue, the kernel module reads the response message from the second message queue.

[0108] Among them, based on the information of the user process carried in the read response message, the kernel module wakes up the corresponding user process and sends the response message to the user process.

[0109] It should be noted that the above step 508 is an implementation manner for the kernel module to read the response message from the shared memory and send the read response message to the user process. In some embodiments, this process is implemented based on other methods, and the embodiments of the present application do not limit this.

[0110] 509. The kernel module releases the first memory block.

[0111] Among them, the kernel module releases the memory block corresponding to the file operation request that has been executed in the shared memory, so as to facilitate the kernel module to write a new unexecuted file operation request into the memory block. In some embodiments, after the kernel module releases the first memory block, it also initializes the released first memory block, so that the first memory block is clean memory, and the user process does not need to initialize the first memory block first and then initiate a file operation request, thereby simplifying the operation process of the user process.

[0112] It should be noted that the above step 509 is an optional step. In some embodiments, this step 509 may not be executed, and the embodiments of the present application do not limit this.

[0113] Next, through Figure 6An example of the process shown in Steps 501 to 509 above is given below. Figure 6 is a flowchart of a file operation method provided by an embodiment of the present application. As Figure 6 shown, the remote user process (io_rpc_kernel_client) initiates a memory allocation request to the kernel module through RPC. The unit ukc_kernel_client in the kernel module determines the first memory block from the shared memory (global_memory), and returns the logical address of the first memory block to the io_rpc_kernel_client; the io_rpc_kernel_client initializes the first memory block; the io_rpc_kernel_client initiates a file operation request; the ukc_kernel_client writes the file operation request into the first message queue in the first memory block; the IOD polling unit in the user space daemon polls the first message queue to obtain the file operation request; when the first message queue is not empty, the ukc_kernel_server in the user space daemon calls back the processing function corresponding to the file operation request; the io_rpc_user_server in the user space daemon asynchronously processes the file operation request by cutting threads, and writes the response message corresponding to the file operation request into the second message queue in the first memory block; the ukc_kernel_server releases the first memory block.

[0114] In the above method, in response to the file operation request initiated by the user process, the kernel module writes the file operation request into the shared memory. The user space daemon obtains the file operation request from the shared memory and executes it, and then writes the corresponding response message into the shared memory. The kernel module then obtains the response message from the shared memory and returns it to the user process. Through the above method, the user space and the kernel space (user process, kernel module, and user space daemon) can share the same piece of memory, and thus can share the messages and data in the memory, so as to reduce the frequent switching and data copying between the user space and the kernel space, reduce the overhead and latency of file access, and improve the performance of the user space file system; further, by storing the first message queue and the second message queue in the shared memory respectively, the throughput capacity of the shared memory for file operation requests can be improved, thereby further improving the performance of the user space file system; in addition, both the kernel module and the user space daemon use the polling method to obtain messages from the message queue, and there is no need to establish an additional communication mechanism between the kernel module and the user space daemon, which can simplify the communication process between the kernel module and the user space daemon.

[0115] It should be noted that the above Figure 5The illustrated embodiment is described by taking the scenario of a user process performing metadata operations as an example. In some embodiments, the user process performs data reading. In this scenario, the file operation request is a data reading request, and the data reading request includes the logical address and length of the data to be read. The shared memory is used to cache messages (including data reading requests and response messages) and data. The following introduces the file operation method in the scenario of a user process performing data reading. Figure 7 is a flowchart of a file operation method provided by an embodiment of the present application, such as Figure 7 As shown, the method includes the following steps 701 to 709.

[0116] 701. The user process initiates a memory allocation request to the kernel module.

[0117] 702. In response to the memory allocation request, the kernel module determines a first memory block from the shared memory, where the first memory block stores a first message queue and a second message queue, and the first memory block also includes a data cache area.

[0118] The above steps 701 to 702 are similar to the above steps 501 to 502, except that in step 702, the first memory block also includes a data cache area, and similarities are not repeated here.

[0119] 703. The user process initiates a file operation request, which is a data read request.

[0120] Among them, step 703 is the same as the above step 503, the difference is that in step 703, the file operation request is a data read request, and the data read request includes information of the user process, the logical address and length of the data to be read; the similarities are not repeated here.

[0121] 704. The kernel module writes the file operation request into the first message queue in the first memory block in response to the file operation request.

[0122] 705. The user space daemon reads the file operation request from the first message queue.

[0123] 706. The user space daemon executes the operation corresponding to the file operation request.

[0124] Step 704 to step 706 are the same as the above-mentioned steps 504 to step 506 and are not described in detail.

[0125] 707. The user space daemon writes the first data into the data cache area in the first memory block, and writes the response message corresponding to the file operation request into the second message queue in the first memory block, the first data being the data corresponding to the file operation request.

[0126] Among them, the response message of the file operation request indicates that the operation corresponding to the file operation request has been completed and the logical address corresponding to the first data. In some embodiments, the user space daemon process converts the logical address corresponding to the first data into a physical address, and the address indicated by the response message is the physical address corresponding to the first data.

[0127] 708. The kernel module polls the second message queue, reads the response message from the second message queue, obtains the first data from the data cache area in the first memory block, and sends the response message and the first data to the user process.

[0128] Among them, the process by which the kernel module obtains the first data from the data cache area in the first memory block includes: the kernel module converts the logical address corresponding to the first data indicated by the response message into a physical address, and obtains the first data from the physical address. In some embodiments, if the address indicated by the response message is the physical address corresponding to the first data, the kernel module directly obtains the first data from the physical address based on the physical address.

[0129] 709. The kernel module releases the first memory block.

[0130] This step 709 is the same as step 509 above and will not be elaborated.

[0131] In the above method, the kernel module, in response to a file operation request initiated by a user process, writes the file operation request into the shared memory. The user space daemon process obtains the file operation request from the shared memory and executes it, then writes the corresponding response message into the shared memory. The kernel module then obtains the response message from the shared memory and returns it to the user process. Through the above method, the user space and the kernel space can share the same piece of memory, and thus can share the messages and data in the memory, thereby reducing the frequent switching and data copying between the user space and the kernel space, reducing the overhead and latency of file access, and improving the performance of the user space file system; further, storing the first message queue and the second message queue in the shared memory respectively can improve the throughput capacity of the shared memory for file operation requests, thereby further improving the performance of the user space file system; in addition, both the kernel module and the user space daemon process use the polling method to obtain messages from the message queue, and there is no need to establish an additional communication mechanism between the kernel module and the user space daemon process, which can simplify the communication process between the kernel module and the user space daemon process; and, in the data reading scenario, the shared memory can cache the data read by the user space daemon process, so that the kernel module can directly read the data from the shared memory and send it to the user process without data copying, and when the amount of data read is large, it can save CPU resources.

[0132] In some other embodiments, when the user process performs data writing, in this scenario, the file operation request is a data writing request, and the data writing request carries the data to be written and the address and length for performing the data writing; the shared memory is used to cache messages (including data reading requests and response messages) and data. The file operation method in the scenario where the user process performs data writing is introduced below. Figure 8 is a flowchart of a file operation method provided by an embodiment of the present application, as Figure 8 shown, the method includes the following steps 801 to step 809.

[0133] 801. The user process sends a memory allocation request to the kernel module.

[0134] 802. In response to the memory allocation request, the kernel module determines a first memory block from the shared memory. The first memory block stores a first message queue and a second message queue, and the first memory block further includes a data cache area.

[0135] The above steps 801 to 802 are the same as the above steps 501 to 502. The difference is that in step 802, the first memory block further includes a data cache area, and the same reasons will not be elaborated.

[0136] 803. The user process sends a file operation request, and the file operation request is a data writing request, and the data writing request carries second data, and the second data is the data to be written.

[0137] This step 803 is the same as the above step 503. The difference is that in this step 803, the file operation request is a data writing request, and the data writing request carries second data, and the data writing request includes information of the user process, the address and length of the second data; the same reasons will not be elaborated.

[0138] 804. In response to the file operation request, the kernel module writes the file operation request into the first message queue in the first memory block, and writes the second data into the data cache area in the first memory block.

[0139] 805. The user space daemon polls the first message queue, reads the file operation request from the first message queue, and reads the second data from the data cache area.

[0140] 806. The user space daemon performs the operation corresponding to the file operation request based on the second data.

[0141] 807. The user space daemon writes the response message corresponding to the file operation request into the second message queue in the first memory block.

[0142] 808. The kernel module polls the second message queue, reads the response message from the second message queue, and sends the response message to the user process.

[0143] 809. The kernel module releases the first memory block.

[0144] Steps 806 to 809 are the same as steps 506 and 509 described above, and will not be elaborated here.

[0145] In the above method, the kernel module responds to the file operation request initiated by the user process, writes the file operation request into the shared memory. The user space daemon process obtains the file operation request from the shared memory and executes it, then writes the corresponding response message into the shared memory. The kernel module then obtains the response message from the shared memory and returns it to the user process. Through the above method, the user space and the kernel space can share the same piece of memory, and thus can share the messages and data in this memory, so as to reduce the frequent switching and data copying between the user space and the kernel space, reduce the overhead and latency of file access, and improve the performance of the user space file system. Further, by storing the first message queue and the second message queue in the shared memory respectively, the throughput capacity of the shared memory for file operation requests can be improved, thus further improving the performance of the user space file system. In addition, both the kernel module and the user space daemon process use the polling method to obtain messages from the message queue, without the need to establish an additional communication mechanism between the kernel module and the user space daemon process, which can simplify the communication process between the kernel module and the user space daemon process. And, in the data writing scenario, the shared memory can cache the data to be written, so that the user space daemon process can directly read the data from the shared memory and write it without data copying. When the amount of data to be written is large, CPU resources can be saved.

[0146] It should be noted that in the above Figure 7 and Figure 8 illustrated embodiments, the storage locations of the messages and data corresponding to different user processes in the shared memory are isolated from each other. In some embodiments, the messages corresponding to different user processes in the shared memory are isolated from each other, while the data corresponding to different user processes can be stored in the same data cache area, that is, different user processes share the data cache area. The embodiments of the present application do not make any limitations in this regard.

[0147] It should be noted that although the above Figure 5 、 Figure 7 and Figure 8These are embodiments in different scenarios divided based on the type of file operation request. However, it doesn't mean that the file operation method provided by this application can only be applied to the above-mentioned single scenario alone. In some embodiments, the type of file operation request is two or more of the above three types. For each type of file operation request, the corresponding process mentioned above can be used for processing. Below, taking Figure 9 as an example, this scenario will be illustrated with examples. Figure 9 is a schematic flowchart of a file operation method provided by an embodiment of this application. As Figure 9 shown, in this method, step ①: Allocate a large block of memory from the kernel as shared memory, which can be accessed by both the user space and the kernel space; step ②: Split the data structures of the send queue (SQ) and the receive queue (RQ) from the shared memory; step ③: The message sender (in the kernel space or the user space) realizes message sending by writing messages (including file operation requests and response messages) into the shared memory. The message receiver continuously reads the shared memory in a polling manner to achieve high-speed message reception; step ④: The shared memory is exported for use by the business logic of the user space file system FUSE. When FUSE needs to transfer data across states to the peer (transfer from the user space to the kernel space or from the kernel space to the user space), the CPU doesn't need to perform memory copying. Through the above method, the FUSE latency can be stably achieved at 4.5 microseconds (us). Compared with about 28 us in the typical industry scenario, it is improved by more than about 5 times; moreover, there is no memory copying, which can save CPU resources in the large IO transfer scenario.

[0148] It should be noted that a virtual file system also runs on this computing device. This virtual file system runs in the kernel space and is used to transfer file operation requests and the corresponding response messages of file operation requests between user processes and kernel modules. The above Figure 5 , Figure 6 and Figure 7The illustrated embodiment is described by taking the example of a user process sending a memory allocation request to a kernel module in the user space file system. In some embodiments, in response to a user process initiating a file operation request, the virtual file system sends the file operation request to the kernel module. The kernel module allocates shared memory for the user process, and based on the shared memory allocated for the user process, the kernel module passes the file operation request to the user space daemon process. Subsequently, the kernel module reads the response message corresponding to the file operation request from the shared memory allocated to the user process, and sends the response message to the virtual file system, which then sends the response message to the user process. In this embodiment, the kernel module and the user space daemon process communicate based on shared memory, which can reduce the number of user mode and kernel mode switches and data copies during the communication between the kernel module and the user space daemon process, thereby improving the performance of the user space file system. Moreover, the user process communicates with the kernel module based on the virtual file system, and this communication process is the same as that in the prior art, that is, there is no need to modify the user program. Therefore, it can reduce the difficulty of applying the user space file system and improve the convenience of use.

[0149] Figure 10 A file operation device provided by an embodiment of the present application is applied to a kernel module in a user space file system. The user space file system further includes a user space daemon process. The kernel module runs in the kernel mode, and the user space daemon process runs in the user mode. The kernel module and the user space daemon process can access the shared memory on the computing device to implement two-way communication between the user mode and the kernel mode. The device includes a writing module 1001 and a reading module 1002.

[0150] The writing module 1001 is configured to write the file operation request into the shared memory in response to a file operation request initiated by a user process.

[0151] The reading module 1002 is configured to read the response message corresponding to the file operation request from the shared memory and send the read response message to the user process.

[0152] Optionally, the shared memory stores a first message queue and a second message queue.

[0153] The writing module 1001 is used for:

[0154] In response to a file operation request initiated by a user process, writing the file operation request into the first message queue.

[0155] The reading module 1002 is used for:

[0156] Reading the response message from the second message queue and sending the read response message to the user process.

[0157] Optionally, the reading module 1002 is configured to:

[0158] Read the response message from the shared memory in a polling manner.

[0159] Optionally, the user process is a remote user process, and the writing module 1001 is configured to:

[0160] In response to the user process initiating a file operation request through a remote procedure call, write the file operation request into the shared memory.

[0161] It should be noted that in other embodiments, the steps implemented by the above modules can be specified as needed. The above modules respectively implement different steps in the above file operation method to implement all functions of the above device. That is, the file operation device provided in the above embodiments only takes the division of the above function modules as an example when implementing the file operation method. In actual applications, the above functions can be allocated to different function modules as needed, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above. In addition, the device provided in the above embodiments and the corresponding method embodiments belong to the same concept, and the specific implementation process can be seen in the method embodiments, which will not be elaborated here.

[0162] Figure 11 It is a file operation device provided by an embodiment of the present application, which is applied to a user space daemon process in a user space file system. The user space file system further includes a kernel module that runs in kernel mode, and the user space daemon process runs in user mode. The kernel module and the user space daemon process can access the shared memory on the computing device to implement two-way communication between user mode and kernel mode; the device includes a reading module 1101 and a writing module 1102.

[0163] The reading module 1101 is configured to: read the file operation request written by the kernel module from the shared memory, and execute the file operation corresponding to the file operation request;

[0164] The writing module 1102 is configured to: write the response message corresponding to the file operation request into the shared memory.

[0165] Optionally, the shared memory stores a first message queue and a second message queue;

[0166] The reading module 1101 is configured to: read the file operation request from the first message queue, and execute the file operation corresponding to the file operation request;

[0167] The writing module 1102 is configured to: write the response message corresponding to the file operation request into the second message queue.

[0168] Optionally, the reading module 1101 is configured to:

[0169] Read the file operation request from the shared memory in a polling manner.

[0170] It should be noted that in other embodiments, the steps to be implemented by the above modules can be specified as needed, and all functions of the above device can be implemented by separately implementing different steps in the above file operation method through the above modules. That is to say, the file operation device provided in the above embodiments is only illustrated by the division of the above function modules when implementing the file operation method. In practical applications, the above functions can be allocated to different function modules as needed, that is, the internal structure of the device can be divided into different function modules to complete all or part of the functions described above. In addition, the device provided in the above embodiments and the corresponding method embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments and will not be elaborated here.

[0171] Among them, the writing module 1001, the reading module 1002, the reading module 1101, and the writing module 1102 can all be implemented by software or by hardware. Exemplarily, next, taking the writing module 1001 as an example, the implementation manner of the writing module 1001 will be introduced. Similarly, the implementation manners of the reading module 1002, the reading module 1101, and the writing module 1102 can refer to the implementation manner of the writing module 1001.

[0172] As an example of a software functional unit, the writing module 1001 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above computing instance may be one or more. For example, the writing module 1001 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers for running the code may be distributed in the same region or in different regions. Further, the multiple hosts / virtual machines / containers for running the code may be distributed in the same availability zone (AZ) or in different AZs, and each AZ includes one data center or multiple geographically proximate data centers. Among them, usually one region may include multiple AZs.

[0173] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Usually, one VPC is set up within one region. For cross-region communication between two VPCs within the same region and between VPCs in different regions, a communication gateway needs to be set up within each VPC, and the interconnection between VPCs is achieved through the communication gateway.

[0174] As an example of a hardware functional unit, the writing module 1001 may include at least one computing device, such as a server. Alternatively, the writing module 1001 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). Among them, the above PLD may be implemented by a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0175] The multiple computing devices included in the writing module 1001 can be distributed in the same region or in different regions. The multiple computing devices included in the writing module 1001 can be distributed in the same availability zone (AZ) or in different AZs. Similarly, the multiple computing devices included in the writing module 1001 can be distributed within the same VPC or across multiple VPCs. Among them, the multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0176] The embodiments of the present application provide a computer-readable storage medium, which can be any available medium that a computing device can store or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive), etc. The computer-readable storage medium includes program code, and when the program code is executed by a computing device, the computing device executes to implement the file operation method provided in the above method embodiments.

[0177] The present application provides a computer program product, which may be software or a program product containing program code that can run on a computing device or be stored in any available medium. When the computer program product runs on a computing device, it causes the computing device to execute to implement the file operation method provided in the above method embodiments.

[0178] Those of ordinary skill in the art can realize that, in combination with the method steps and units described in the embodiments disclosed herein, they can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the steps and components of the embodiments have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0179] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working processes of the above-described devices, modules, and units can be referred to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0180] In several embodiments provided by the present application, it should be understood that the disclosed computing devices, apparatuses, and methods can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or modules can be combined, or some features can be ignored, or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection to each other can be an indirect coupling or communication connection through some interfaces, devices, or units, and can also be in an electrical, mechanical, or other form of connection.

[0181] The unit described as a separate component may or may not be physically separated. The component displayed as a unit may or may not be a physical unit, that is, it can be located in one place, or can also be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.

[0182] In addition, the units in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software unit.

[0183] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computing device (which may be a personal computer, a server, or a computing device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application.

[0184] In this application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and effects. It should be understood that there is no logical or temporal dependence between "first", "second", and "nth", nor are the quantity and execution order limited. It should also be understood that although the following description uses terms such as first and second to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of various examples, the first message queue can be referred to as the second message queue, and similarly, the second message queue can be referred to as the first message queue. Both the first message queue and the second message queue can be message queues, and in some cases, they can be separate and different message queues.

[0185] In this application, the meaning of the term "at least one" refers to one or more, and the meaning of the term "a plurality of" refers to two or more.

[0186] It should also be understood that the term "if" can be interpreted to mean "when" ("when" or "upon") or "in response to a determination" or "in response to a detection". Similarly, depending on the context, the phrase "if a determination..." or "if a [stated condition or event] is detected" can be interpreted to mean "when a determination is made" or "in response to a determination" or "when a [stated condition or event] is detected" or "in response to a detection of a [stated condition or event]".

[0187] The above description is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art in the technical field disclosed in this application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

[0188] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0189] The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer program instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired or wireless manner. The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, or magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid-state drive).

[0190] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware or by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium, which can be a read-only memory, a magnetic disk, or an optical disc, etc.

[0191] The above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A user space file system, characterized in that, Applied to a computing device, the computing device includes a shared memory, the user space file system includes a kernel module and a user space daemon, the kernel module runs in kernel mode, the user space daemon runs in user mode, and the kernel module and the user space daemon can access the shared memory to implement bidirectional communication between user mode and kernel mode.

2. The user space file system according to claim 1, wherein The kernel module is used for: In response to a file operation request initiated by a user process, write the file operation request into the shared memory; The user space daemon is used for: Read the file operation request from the shared memory and execute the file operation corresponding to the file operation request; Write the response message corresponding to the file operation request into the shared memory; The kernel module is further used for reading the response message from the shared memory and sending the read response message to the user process.

3. The user space file system according to claim 1, wherein The shared memory stores a first message queue and a second message queue; The kernel module is used for: In response to a file operation request initiated by the user process, write the file operation request into the first message queue; The user space daemon is used for: Read the file operation request from the first message queue and execute the file operation corresponding to the file operation request; Write the response message corresponding to the file operation request into the second message queue; The kernel module is further used for reading the response message from the second message queue and sending the read response message to the user process.

4. The method according to claim 2 or 3, characterized in that The user space daemon is used for: Read the file operation request from the shared memory in a polling manner.

5. The method according to claim 2 or 3, characterized in that, The kernel module is used for: Read the response message from the shared memory in a polling manner.

6. The method according to any one of claims 1 to 5, characterized in that The user process is a remote user process, and the kernel module is used for: In response to the user process initiating a file operation request through a remote procedure call, write the file operation request into the shared memory.

7. A file operation method, characterized in that, Applied to a computing device, the computing device is configured with a user space file system and a shared memory, the user space file system includes a kernel module and a user space daemon, the kernel module runs in kernel mode, the user space daemon runs in user mode, and the kernel module and the user space daemon can access the shared memory; The method includes: In response to a file operation request initiated by a user process, the kernel module writes the file operation request into the shared memory; The user space daemon reads the file operation request from the shared memory and executes the file operation corresponding to the file operation request; The user space daemon writes the response message corresponding to the file operation request into the shared memory; The kernel module reads the response message from the shared memory and sends the read response message to the user process.

8. A computing device, characterized in that, The computing device includes a shared memory, and the user space file system as described in any one of claims 1 to 6 above runs on the computing device.

9. A storage system, characterized in that, The storage system includes at least one computing device and a storage device. The computing device includes a shared memory, and a user space file system as described in any one of claims 1 to 6 above runs on the computing device to implement operations on files in the storage device.

10. A storage medium, characterized in that The storage medium is used to store at least one program code segment, and the at least one program code segment is used to implement a user space file system as described in any one of claims 1 to 6 above.

Citation Information

Cited By

  • Acceleration system and method under user mode file system unloading device

    CN122111681A