Method and system for optimizing user space file system

By building an independent communication channel for each CPU core, combining the dual-ring queue communication mechanism of io_uring and dynamic polling strategy, the scalability and context switching overhead of the FUSE framework are solved, and efficient resource utilization and secure data transmission are achieved.

CN120508251APending Publication Date: 2025-08-19HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510578515.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

The existing FUSE framework optimization method has poor scalability due to the use of a single queue for request processing. Multiple communication channel methods use read and write device files for communication, resulting in excessive context switching overhead, and the way to reduce the number of data copying problems is limited and the security is poor.

Method used

An independent communication channel is built for each CPU core, and the dual-ring queue communication mechanism of io_uring is used to perform efficient asynchronous communication between user state and kernel state. A hybrid polling strategy combining short sleep and dynamic polling is designed to dynamically determine the sleep time, and a lightweight channel load estimation method is used to select the appropriate channel for request transmission.

Benefits of technology

It solves the problems of poor scalability and large context switching overhead of FUSE framework, realizes efficient utilization of resources, reduces the number of system calls, and improves security and flexibility in usage scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508251A_ABST
    Figure CN120508251A_ABST
Patent Text Reader

Abstract

The invention discloses a method for optimizing a user space file system, which solves the expansibility problem of a user space file system framework from the perspective of communication between a kernel space and a user space, and constructs an independent communication channel for each CPU core. According to the method, efficient asynchronous communication between a user mode and a kernel mode is carried out by utilizing an iouring double-ring queue communication mechanism, a hybrid polling strategy combining transient sleep and dynamic polling is designed, sleep time is dynamically determined, a dynamic load balancing strategy based on a multi-channel load state and NUMA locality is designed, and a dynamic load balancing strategy based on a multi-channel load state and NUMA locality is designed. And a lightweight channel load estimation method is adopted, and the request is sent to a proper channel, so that efficient utilization of resources is realized. According to the method, the technical problem that the expansibility is poor due to the fact that a single queue is used for carrying out request processing in an existing FUSE framework optimization method based on kernel extension can be solved; and the technical problem of overhigh context switching overhead caused by communication by using read-write of equipment files in an existing multi-communication channel method is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of distributed storage systems, and more particularly, relates to a method and system for optimizing a user space file system. Background Art

[0002] With the advent of the big data era, efficient data storage and management have become crucial. As the infrastructure for data management, the performance of the file system directly affects the efficiency of upper-layer applications. The Filesystem in Userspace (FUSE) has become a widely adopted solution in academia and industry due to its advantages such as easy development, security, and reliability. The FUSE framework has serious performance bottlenecks, mainly reflected in frequent context switching and single-queue request processing. These problems are particularly prominent under high-concurrency loads, limiting the application of FUSE in high-concurrency scenarios. In view of this, the FUSE framework optimization solution came into being.

[0003] There are three main optimization solutions for the existing FUSE framework: the first is to run a lightweight extension in the kernel, transferring part of the file system functions originally implemented in user space to the kernel implementation; the second is to add multiple communication channels to achieve communication between the kernel and user space; the third is to reduce the number of data copies between applications and the file system, and use specific hardware instructions to accelerate data transmission.

[0004] However, the above three optimization solutions all have some drawbacks that cannot be ignored:

[0005] First, although the kernel extension approach reduces context switching overhead and unnecessary kernel-user space communication, it still uses a single queue for request processing, resulting in poor scalability.

[0006] Second, although adding multiple communication channels improves scalability, each communication channel uses device file reading and writing for communication, which still requires multiple context switches, increasing overhead.

[0007] Third, methods that reduce the number of data copies between applications and file systems rely on page alignment and specific permissions, which limits their practical use cases and poses security issues. Summary of the Invention

[0008] In response to the above-mentioned defects or improvement needs of the prior art, the present invention provides a method and system for optimizing the user space file system, which aims to solve the technical problems of poor scalability of the existing FUSE framework optimization method based on kernel extension due to the use of a single queue for request processing; the technical problem of excessive context switching overhead in the existing multiple communication channel method using the reading and writing of device files for communication; and the technical problem of limited usage scenarios and poor security in the method of reducing the number of data copies between applications and file systems.

[0009] To achieve the above object, according to one aspect of the present invention, a method for optimizing a user space file system is provided, comprising the following steps:

[0010] (1) Receive a FUSE request from the user and parse the FUSE request to obtain the CPU core and request type corresponding to the FUSE request;

[0011] (2) Obtain the number of the target kernel space channel for transmitting the FUSE request based on the CPU core and request type corresponding to the FUSE request obtained in step (1).

[0012] (3) Select a kernel space channel numbered as the target kernel space channel number obtained in step (2) from the multiple kernel space channels obtained in step (2), and select the kernel space channel numbered as the target kernel space channel number from the first bidirectional linked list L in the kernel space channel. free Obtain an idle kernel channel item, copy the header of the FUSE request obtained in step (1) to the memory corresponding to the header field of the idle kernel channel item, and copy the payload of the FUSE request to the memory corresponding to the payload field of the idle kernel channel item;

[0013] (4) Select the user space channel numbered as the target kernel space channel number obtained in step (2), and obtain the io_uring instance of the user space channel;

[0014] (5) Obtain an idle completion queue event from the completion queue of the io_uring instance obtained in step (4), write the send information corresponding to the FUSE request into the idle completion queue event, and insert the completion queue event after writing the send information into the tail of the completion queue to obtain an updated completion queue;

[0015] (6) Obtaining the completion queue event after writing the send information from the updated completion queue obtained in step (5) in a sleep-first-then-polling manner;

[0016] (7) obtaining the address of the user channel item from the custom data field in the completion queue event after the write-send information obtained in step (6), and obtaining the user channel item according to the address of the user channel item;

[0017] (8) Obtain the memory pointed to by the header field and payload field of the user channel item obtained in step (7), read the FUSE request from the memory, and hand the FUSE request to the user space file system for processing to obtain the request processing result.

[0018] (9) The processing result obtained in step (8) is written into the header field and the payload field of the user channel item obtained in step (7), and the address of the user channel item is submitted to the submission queue in the io_uring instance to obtain an updated submission queue.

[0019] (10) Obtain the submission queue item from the updated submission queue header obtained in step (9), obtain the channel number from the channel number field of the submission queue item, and obtain the kernel space channel kch corresponding to the channel number qid , obtain the FUSE request number from the submission number field of the submission queue item, and obtain the request processing result from the header field and payload field of the kernel channel item through the request number.

[0020] Preferably, step (1) is to obtain the CPU core corresponding to the FUSE request according to the thread where the FUSE request is located;

[0021] Step (1) is to obtain the request type of the FUSE request by reading the OPCODE field in the FUSE request. If the OPCODE field is READ or WRITE, it means that the FUSE request is a data type, otherwise it means that the FUSE request is a metadata type.

[0022] Preferably, step (2) includes the following sub-steps:

[0023] (2-1) Create a variable pending_size for each kernel space channel in the pre-established multiple channels, which is used to represent the size of the unprocessed FUSE requests in the kernel channel, wherein each kernel space channel is provided with a first bidirectional linked list L free and the second doubly linked list L pending , the first doubly linked list L free The second bidirectional linked list L is used to manage the idle kernel channel items in the kernel space channel. pending Used to manage unprocessed FUSE requests in the kernel space channel;

[0024] (2-2) Scan the first doubly linked list L in each kernel space channel pending, to obtain the size of all FUSE requests, accumulate the sizes of all FUSE requests, and assign the accumulated result to the variable pending_size;

[0025] (2-3) Obtain the NUMA node to which the CPU core obtained in step (1) belongs;

[0026] (2-4) Create the first empty set S local and the second empty set S global , where the first empty set S local Used to store the numbers of kernel space channels corresponding to all CPU cores in the NUMA node obtained in step (2-3) that meet the preset conditions, the second empty set S global Used to store the kernel space channel numbers that meet the preset conditions corresponding to all CPU cores in the current client;

[0027] (2-5) Select the kernel space channel corresponding to the CPU core obtained in step (1) as the initial candidate kernel space channel, and determine whether the variable pending_size corresponding to the initial candidate kernel space channel is less than the preset threshold Th. If so, it means that the initial candidate kernel space channel is the target kernel space channel. At this time, the number of the initial candidate kernel channel is returned, and the process ends. Otherwise, go to step (2-6);

[0028] (2-6) Scan all kernel space channels corresponding to all CPUs of the NUMA node obtained from step (2-3), and add the numbers of all kernel space channels that meet the preset conditions to the first set S local middle;

[0029] (2-7) Determine the first set S local Is the size greater than or equal to 2? If so, select the first set S local Randomly select two kernel space channels, and use the kernel space channel corresponding to the smaller variable pending_size of the two kernel space channels as the target kernel space channel, and return the number of the target kernel channel. The process ends, otherwise go to step (2-8);

[0030] (2-8) Scan all kernel space channels of the current client and add the numbers of all kernel space channels that meet the preset conditions to the second set S global middle;

[0031] (2-9) From the second set S globalRandomly select two kernel space channels, and use the kernel space channel corresponding to the smaller variable pending_size of the two kernel space channels as the target kernel space channel, and return the number of the target kernel space channel.

[0032] Preferably, the channel is established by following the steps below:

[0033] (A1) Obtain the number of CPU cores nr_cpu of the current client, initialize nr_cpu user space channels and nr_cpu kernel space channels, and initialize the user space channel depth depth=1024; wherein the current client is deployed with multiple consistent memory access NUMA nodes, each NUMA node including multiple CPU cores.

[0034] (A2) Set counter i=0;

[0035] (A3) Determine whether the counter i is equal to the number of CPU cores nr_cpu, if yes, proceed to step (A11), otherwise proceed to step (A4);

[0036] (A4) Initialize the i-th user space channel uch among nr_cpu user space channels i The size of the io_uring instance in the io_uring is equal to the user space channel depth depth, and the i-th user space channel uch is set i The number field qid i is equal to i;

[0037] (A5) Set counter j=0;

[0038] (A6) Determine whether the counter j is equal to the user space channel depth depth, if so, proceed to step (A10), otherwise proceed to step (A7);

[0039] (A7) Get the i-th user space channel uch i The jth user channel item uent in ij , set the user channel item uent ij The parent channel number field pqid is i, and a memory space of size header_sz is allocated from the memory managed by the NUMA node to which the j-th CPU core belongs among all nr_cpu CPU cores, and the memory first address of the memory space is assigned to the j-th user channel item uent ij The header field allocates a memory space of size payload_sz from the memory managed by the NUMA node to which the j-th CPU core belongs among all nr_cpu CPU cores, and assigns the first address of the memory space to the j-th user channel item uentij The payload field is encapsulated into the jth user channel item ent. ij In the corresponding iovec structure;

[0040] (A8) From the i-th user space channel uch i Get an idle submission queue item SQE from the io_uring instance, and set the address field of the submission queue item to the j-th user channel item uent encapsulated in step (A7) ij The address of the corresponding iovec structure, set the custom data field of the submission queue item to the j-th user channel item uent encapsulated in step (A7) ij The memory address of the submitted queue is written, and the submitted queue item after the information is written is inserted into the tail of the submitted queue in the io_uring instance to obtain the updated submitted queue;

[0041] (A9) Set counter j = j + 1 and return to step (A6);

[0042] (A10) Set the counter i=i+1 and return to step (A3);

[0043] (A11) Set counter m=0;

[0044] (A12) Determine whether the counter m is equal to the number of CPU cores nr_cpu. If so, the process ends; otherwise, proceed to step (A13);

[0045] (A13) Initialize the mth kernel space channel kch among the nr_cpu kernel space channels m The first doubly linked list L in free and the second doubly linked list L pending ;

[0046] (A14) Set counter n=0;

[0047] (A15) Determine whether the counter n is equal to the queue depth depth, if so, proceed to step (A19), otherwise proceed to step (A16);

[0048] (A16) obtaining the submission queue item after the written information from the updated submission queue header obtained in step (A8), parsing the submission queue item after the written information to obtain the address of the iovec structure in the user channel item and the address of the user channel item;

[0049] (A17) Get the mth kernel space channel kch m The nth kernel channel item kent in mn, obtain the corresponding iovec structure from the address of the iovec structure obtained in step (A16), obtain the header field and payload field from the iovec structure, and assign them to the kernel channel item kent respectively mn The header field and payload field of the kernel channel item kent are assigned the address of the user channel item obtained in step (A16) mn The address field of the kernel channel entry kent mn Put the first doubly linked list L in the kernel space channel free the end of;

[0050] (A18) Set counter n=n+1 and return to step (A15);

[0051] (A19) Set the counter m=m+1 and return to step (A12).

[0052] Preferably, in step (5), the sending information corresponding to the FUSE request is written into the idle completion queue event by setting the custom data field in the completion queue event to the address field of the idle kernel channel item;

[0053] The process of sleeping first and then polling in step (6) is as follows: first, the user space daemon is put into sleep state, and the sleep time is sleep_time, then the user space daemon is woken up to poll the updated completion queue obtained in step (5) to obtain the completion queue event after the writing and sending information from the completion queue.

[0054] Preferably, the sleep time sleep_time is determined according to the following steps:

[0055] (6-1) Initialize the user space timestamp of the last completion queue event arrival last_arrive_time = 0, the total number of completion event arrival intervals in the batch batch = 0, the total number of completion event arrival intervals less than the mean in the batch lmd_batch = 0, the average value of the completion event arrival intervals before merging mean_last = 0, the number of completion event arrivals in the batch nr_batch = 0, the mean value of all completion event arrival intervals mean = 0, the left mean deviation of all completion event arrival intervals lmd = 0, and the number of completed event arrivals counted nr = 0;

[0056] (6-2) When the completion event arrives in the user space, obtain the current timestamp now, determine whether the number of completion events arriving in the batch nr_batch is 0, if so, set the timestamp of the last completion queue event arriving in the user space last_arrive_time = now, and then return to step (6-2), otherwise, calculate the interval interval between the arrival of this completion queue event in the user space and the arrival of the last completion queue event in the user space interval = now - last_arrive_time, update the total arrival interval of completion events in the batch batch = batch + interval, update the number of completion events arriving in the batch nr_batch = nr_batch + 1, and then enter step (6-3);

[0057] (6-3) Determine whether the interval between the arrival of the current completion queue event and the arrival of the last completion queue event is less than the average value mean_last of the arrival interval of the completion event before the merger. If so, update the total arrival interval of the completion event in the batch that is less than the mean value lmd_batch = lmd_batch + interval, and then go to step (6-4); otherwise, go directly to step (6-4);

[0058] (6-4) Determine whether the number of completed events in a batch nr_batch> the preset batch threshold BATCH_THREHOLD is established. If so, proceed to step (6-5), otherwise proceed to step (6-7);

[0059] (6-5) Update the mean of all completed event arrival intervals mean = (mean*nr+batch) / (nr_batch+nr), update the left mean deviation lmd of all completed event arrival intervals lmd = (lmd*nr+lmd_batch) / (nr_batch+nr), update the counted number of completed event arrivals nr = nr_batch+nr, and then enter step (6-6).

[0060] (6-6) Update the total arrival intervals of completed events in the batch to batch = 0, update the number of arrival completed events in the batch to nr_batch = 0, update the total arrival intervals of completed events less than the mean in the batch to lmd_batch = 0, update the mean value of the arrival intervals of completed events before merging to mean_last = mean, and then proceed to step (6-7);

[0061] (6-7) Get the sleep time sleep_time according to the mean mean of all completion event arrival intervals and the left mean deviation lmd of all completion event arrival intervals:

[0062] sleep_time=max(mean / 2,mean-4*lmd).

[0063] Preferably, the process of submitting the address of the user channel item to the submission queue in the io_uring instance in step (9) to obtain the updated submission queue includes the following sub-steps:

[0064] (9-1) Get the user space channel uch corresponding to the parent channel number field pqid of the user channel item obtained in step (7) pqid ;

[0065] (9-2) The user space channel uch obtained from step (9-1) pqid Get a submission queue item from the io_uring instance;

[0066] (9-3) Setting the submission number field of the submission queue item obtained in step (9-2) to the number of the FUSE request obtained in step (8), setting the channel number field of the submission queue item to the parent channel number field pqid of the user channel item, and setting the custom data field of the submission queue item to the address of the user channel item obtained in step (7);

[0067] (9-4) Insert the submission queue item obtained in step (9-2) into the user space channel uch pqid The tail of the submission queue in the io_uring instance in .

[0068] According to another aspect of the present invention, a system for optimizing a user space file system is provided, comprising:

[0069] The first module is used to receive a FUSE request from a user and parse the FUSE request to obtain the CPU core and request type corresponding to the FUSE request;

[0070] The second module is used to obtain the number of the target kernel space channel for transmitting the FUSE request according to the CPU core and request type corresponding to the FUSE request obtained by the first module.

[0071] The third module is used to select a kernel space channel numbered as the target kernel space channel obtained by the second module from the multiple kernel space channels obtained by the second module, and select the kernel space channel from the first bidirectional linked list L in the kernel space channel. free Obtain an idle kernel channel item, copy the header of the FUSE request obtained by the first module to the memory corresponding to the header field of the idle kernel channel item, and copy the payload of the FUSE request to the memory corresponding to the payload field of the idle kernel channel item;

[0072] The fourth module is used to select a user space channel numbered as the target kernel space channel number obtained by the second module, and obtain the io_uring instance of the user space channel;

[0073] The fifth module is used to obtain an idle completion queue event from the completion queue of the io_uring instance obtained by the fourth module, write the send information corresponding to the FUSE request into the idle completion queue event, and insert the completion queue event after the send information is written into the end of the completion queue to obtain an updated completion queue;

[0074] The sixth module is used to obtain the completion queue event after the sending information is written from the updated completion queue obtained by the fifth module in a sleep-first-then-polling manner;

[0075] The seventh module is used to obtain the address of the user channel item from the custom data field in the completion queue event after the write and send information obtained by the sixth module, and obtain the user channel item according to the address of the user channel item;

[0076] An eighth module is configured to obtain the memory pointed to by the header field and the payload field of the user channel item obtained by the seventh module, read the FUSE request from the memory, and hand the FUSE request to the user space file system for processing to obtain a request processing result;

[0077] The ninth module is configured to write the processing result obtained by the eighth module into the header field and the payload field of the user channel item obtained by the seventh module, and submit the address of the user channel item to the submission queue in the io_uring instance to obtain an updated submission queue;

[0078] The tenth module is used to obtain the submission queue item from the updated submission queue header obtained from the ninth module, obtain the channel number from the channel number field of the submission queue item, and obtain the kernel space channel kch corresponding to the channel number qid , obtain the FUSE request number from the submission number field of the submission queue item, and obtain the request processing result from the header field and payload field of the kernel channel item through the request number.

[0079] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:

[0080] (1) The present invention adopts steps (A1) to (A10) to establish an independent communication channel for each CPU for request transmission, thereby avoiding competition for the request queue lock. Therefore, it can solve the technical problem of poor scalability caused by the existing kernel extension-based FUSE framework optimization method using a single queue for request processing;

[0081] (2) The present invention adopts steps (2-1) to (2-9), which utilizes channel load and NUMA locality to select the target channel of the request, and can effectively balance channel utilization;

[0082] (3) The present invention adopts steps (3) to (5) and steps (6-1) to (6-7), thereby realizing the use of io_uring instances as a communication method for each independent channel, and realizing a strategy combining sleep and polling to obtain requests for processing, which can reduce the number of system calls and the number of switches between kernel space and user space. Therefore, it can solve the technical problem that the existing multiple communication channel method uses the reading and writing of device files for communication, resulting in excessive context switching overhead;

[0083] (4) Since the present invention adopts steps (7) to (10) and uses pre-allocated memory to send and reply FUSE requests, it can effectively solve the technical problems of limited usage scenarios and poor security in the existing method of copying data between applications and file systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] Figure 1 Schematic diagram of the overall framework of the method for optimizing the user space file system of the present invention;

[0085] Figure 2 is a flow chart of a method for optimizing a user space file system according to the present invention;

[0086] Figure 3 This is the result of the present invention on the fio test kit;

[0087] Figure 4 This is the result of the present invention on the filebench test suite. DETAILED DESCRIPTION

[0088] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

[0089] The following first explains and illustrates the technical terms of the present invention:

[0090] Channel: used to manage communication between user space and kernel space. Each CPU core has a channel. Each channel consists of a user space channel and a kernel space channel. The user space channel of each channel consists of several user channel items, and the kernel space channel of each channel consists of several kernel channel items. Each channel uses the io_uring instance for actual communication.

[0091] User space daemon: A program running in user space that receives and processes FUSE requests.

[0092] io_uring instance: This instance is used for efficient asynchronous I / O operations between user space and kernel space. It contains all the state information needed to manage the submission queue (SQ) and completion queue (CQ). User-space applications fill in submission queue entries (SQEs) describing the I / O operations to be performed and then notify the kernel. The kernel removes these entries from the submission queue and performs the corresponding operations. Upon completion, it places the results in the completion queue, from which the application can then obtain completion queue events (CQEs).

[0093] iovec structure: a structure used to describe multiple discontinuous memory areas.

[0094] The basic idea of the present invention is to solve the scalability problem of the user space file system framework from the perspective of communication between kernel space and user space, build an independent communication channel for each CPU core, use the dual-ring queue communication mechanism of io_uring to perform efficient asynchronous communication between user state and kernel state, design a hybrid polling strategy that combines short sleep and dynamic polling, dynamically determine the sleep time, design a dynamic load balancing strategy based on multi-channel load status and NUMA locality, adopt a lightweight channel load estimation method to send requests to the appropriate channel, and achieve efficient resource utilization.

[0095] like Figure 1 and Figure 2 As shown, the present invention provides a method for optimizing a user space file system, comprising the following steps:

[0096] (1) Receive a FUSE request from the user and parse the FUSE request to obtain the CPU core and request type corresponding to the FUSE request;

[0097] This step is to obtain the CPU core corresponding to the FUSE request based on the thread where the FUSE request is located;

[0098] In addition, this step is to obtain the request type of the FUSE request by reading the OPCODE field in the FUSE request. If the OPCODE field is READ or WRITE, it means that the FUSE request is a data type, otherwise it means that the FUSE request is a metadata type.

[0099] The advantage of this step is that it determines the initiating CPU core and type corresponding to the FUSE request, providing sufficient preparation and foundation for step (2) of selecting the target kernel space channel for transmitting the FUSE request.

[0100] (2) Obtain the number of the target kernel space channel for transmitting the FUSE request based on the CPU core and request type corresponding to the FUSE request obtained in step (1).

[0101] This step includes the following sub-steps:

[0102] (2-1) Create a variable pending_size for each kernel space channel in the pre-established multiple channels, which is used to represent the size of the unprocessed FUSE requests in the kernel channel, wherein each kernel space channel is provided with a first bidirectional linked list L free and the second doubly linked list L pending , the first doubly linked list L free The second bidirectional linked list L is used to manage the idle kernel channel items in the kernel space channel. pending Used to manage unprocessed FUSE requests in the kernel space channel;

[0103] Specifically, the channel in the present invention is established according to the following steps:

[0104] (A1) Obtain the number of CPU cores nr_cpu of the current client (specifically, a computer), initialize nr_cpu user space channels and nr_cpu kernel space channels, and initialize the user space channel depth depth = 1024;

[0105] Specifically, in this step, multiple Non-uniform memory access (NUMA) nodes are deployed in the client, and each NUMA node includes multiple CPU cores.

[0106] (A2) Set counter i=0;

[0107] (A3) Determine whether the counter i is equal to the number of CPU cores nr_cpu, if yes, proceed to step (A11), otherwise proceed to step (A4);

[0108] (A4) Initialize the i-th user space channel uch among nr_cpu user space channels i The size of the io_uring instance in the io_uring is equal to the user space channel depth depth, and the i-th user space channel uch is set i The number field qid i is equal to i;

[0109] (A5) Set counter j=0;

[0110] (A6) Determine whether the counter j is equal to the user space channel depth depth, if so, proceed to step (A10), otherwise proceed to step (A7);

[0111] (A7) Get the i-th user space channel uch i The jth user channel item uent in ij , set the user channel item uent ij The parent channel number field pqid is i, and a memory space of size header_sz is allocated from the memory managed by the NUMA node to which the j-th CPU core belongs among all nr_cpu CPU cores (where the value range of header_sz is 4KB to 8KB, preferably 4KB), and the memory first address of the memory space is assigned to the j-th user channel item uent ij The header field of the header field allocates a memory space of size payload_sz (where the value range of payload_sz is 128KB to 1024KB, preferably 1024KB) from the memory managed by the NUMA node to which the j-th CPU core belongs among all nr_cpu CPU cores, and assigns the first memory address of the memory space to the j-th user channel item uent ij The payload field is encapsulated into the jth user channel item ent. ij In the corresponding iovec structure;

[0112] (A8) From the i-th user space channel uch i Get an idle submission queue entry (SQE) from the io_uring instance, and set the address (addr) field of the submission queue entry to the jth user channel entry uent encapsulated in step (A7) ij The address of the corresponding iovec structure, set the custom data (userdata) field of the submission queue item to the j-th user channel item uent encapsulated in step (A7) ijThe memory address of the submitted queue is written, and the submitted queue item after the information is written is inserted into the tail of the submitted queue in the io_uring instance to obtain the updated submitted queue;

[0113] (A9) Set counter j = j + 1 and return to step (A6);

[0114] (A10) Set the counter i=i+1 and return to step (A3);

[0115] (A11) Set counter m=0;

[0116] (A12) Determine whether the counter m is equal to the number of CPU cores nr_cpu. If so, the process ends; otherwise, proceed to step (A13);

[0117] (A13) Initialize the mth kernel space channel kch among the nr_cpu kernel space channels m The first doubly linked list L in free and the second doubly linked list L pending ;

[0118] (A14) Set counter n=0;

[0119] (A15) Determine whether the counter n is equal to the queue depth depth, if so, proceed to step (A19), otherwise proceed to step (A16);

[0120] (A16) obtaining the submission queue item after the written information from the updated submission queue header obtained in step (A8), parsing the submission queue item after the written information to obtain the address of the iovec structure in the user channel item and the address of the user channel item;

[0121] (A17) Get the mth kernel space channel kch m The nth kernel channel item kent in mn , obtain the corresponding iovec structure from the address of the iovec structure obtained in step (A16), obtain the header field and payload field from the iovec structure, and assign them to the kernel channel item kent respectively mn The header field and payload field of the kernel channel item kent are assigned the address of the user channel item obtained in step (A16) mn The address field of the kernel channel entry kent mn Put the first doubly linked list L in the kernel space channel free the end of;

[0122] (A18) Set counter n=n+1 and return to step (A15);

[0123] (A19) Set the counter m=m+1 and return to step (A12);

[0124] The advantage of the above sub-steps (A1) to (A19) is that an independent channel is established for each CPU core, thereby avoiding the locking operation during the FUSE request transmission process.

[0125] (2-2) Scan the first doubly linked list L in each kernel space channel pending , to obtain the size of all FUSE requests, accumulate the sizes of all FUSE requests, and assign the accumulated result to the variable pending_size;

[0126] The advantage of the above sub-steps (2-1) to (2-2) is that the size of the unprocessed FUSE requests of each kernel channel is used as the channel load, thereby providing a basis for kernel channel selection.

[0127] (2-3) Obtain the NUMA node to which the CPU core obtained in step (1) belongs;

[0128] (2-4) Create the first empty set S local and the second empty set S global , where the first empty set S local Used to store the numbers of kernel space channels corresponding to all CPU cores in the NUMA node obtained in step (2-3) that meet the preset conditions, the second empty set S global Used to store the kernel space channel numbers that meet the preset conditions corresponding to all CPU cores in the current client;

[0129] Specifically, the preset condition is that the variable pending_size corresponding to the kernel space channel is less than a preset threshold Th (the value range of which is 1024KB to 4096KB, preferably 2048KB);

[0130] (2-5) Select the kernel space channel corresponding to the CPU core obtained in step (1) as the initial candidate kernel space channel, and determine whether the variable pending_size corresponding to the initial candidate kernel space channel is less than the preset threshold Th. If so, it means that the initial candidate kernel space channel is the target kernel space channel. At this time, the number of the initial candidate kernel channel is returned, and the process ends. Otherwise, go to step (2-6);

[0131] (2-6) Scan all kernel space channels corresponding to all CPUs of the NUMA node obtained from step (2-3), and add the numbers of all kernel space channels that meet the preset conditions to the first set S local middle;

[0132] (2-7) Determine the first set Slocal Is the size greater than or equal to 2? If so, select the first set S local Randomly select two kernel space channels, and use the kernel space channel corresponding to the smaller variable pending_size of the two kernel space channels as the target kernel space channel, and return the number of the target kernel channel. The process ends, otherwise go to step (2-8);

[0133] (2-8) Scan all kernel space channels of the current client and add the numbers of all kernel space channels that meet the preset conditions to the second set S global middle;

[0134] (2-9) From the second set S global Randomly select two kernel space channels, and use the kernel space channel corresponding to the smaller variable pending_size of the two kernel space channels as the target kernel space channel, and return the number of the target kernel space channel. The process ends.

[0135] The advantage of this step (2) is that the load request and NUMA locality of the communication channel are considered to select the transmission channel.

[0136] (3) Select a kernel space channel numbered as the target kernel space channel number obtained in step (2) from the multiple kernel space channels obtained in step (2), and select the kernel space channel numbered as the target kernel space channel number from the first bidirectional linked list L in the kernel space channel. free Obtain an idle kernel channel item, copy the header of the FUSE request obtained in step (1) to the memory corresponding to the header field of the idle kernel channel item, and copy the payload of the FUSE request to the memory corresponding to the payload field of the idle kernel channel item;

[0137] (4) Select the user space channel numbered as the target kernel space channel number obtained in step (2), and obtain the io_uring instance of the user space channel;

[0138] (5) Obtain an idle completion queue event from the completion queue of the io_uring instance obtained in step (4), write the send information corresponding to the FUSE request into the idle completion queue event, and insert the completion queue event after writing the send information into the tail of the completion queue to obtain an updated completion queue;

[0139] Specifically, in this step, the sending information corresponding to the FUSE request is written to the idle completion queue event by setting the custom data (userdata) field in the completion queue event to the address (addr) field of the idle kernel channel item;

[0140] The advantage of the above steps (3) to (5) is that the sending information corresponding to the FUSE request is transmitted using the completion queue time, thereby reducing the number of system calls.

[0141] (6) Obtaining the completion queue event after writing the send information from the updated completion queue obtained in step (5) in a sleep-first-then-polling manner;

[0142] Specifically, the process of sleeping first and then polling in this step is as follows: first, the user space daemon process enters the sleep state, and the sleep time is sleep_time, then the user space daemon process is woken up to poll the updated completion queue obtained in step (5) to obtain the completion queue event after the writing and sending information from the completion queue;

[0143] The above sleep time sleep_time is determined according to the following steps:

[0144] (6-1) Initialize the user space timestamp of the last completion queue event arrival last_arrive_time = 0, the total number of completion event arrival intervals in the batch batch = 0, the total number of completion event arrival intervals less than the mean in the batch lmd_batch = 0, the average value of the completion event arrival intervals before merging mean_last = 0, the number of completion event arrivals in the batch nr_batch = 0, the mean value of all completion event arrival intervals mean = 0, the left mean deviation of all completion event arrival intervals lmd = 0, and the number of completed event arrivals counted nr = 0;

[0145] (6-2) When the completion event arrives in the user space, obtain the current timestamp now, determine whether the number of completion events arriving in the batch nr_batch is 0, if so, set the timestamp of the last completion queue event arriving in the user space last_arrive_time = now, and then return to step (6-2), otherwise, calculate the interval interval between the arrival of this completion queue event in the user space and the arrival of the last completion queue event in the user space interval = now - last_arrive_time, update the total arrival interval of completion events in the batch batch = batch + interval, update the number of completion events arriving in the batch nr_batch = nr_batch + 1, and then enter step (6-3);

[0146] (6-3) Determine whether the interval between the arrival of the current completion queue event and the arrival of the last completion queue event is less than the average value mean_last of the arrival interval of the completion event before the merger. If so, update the total arrival interval of the completion event in the batch that is less than the mean value lmd_batch = lmd_batch + interval, and then go to step (6-4); otherwise, go directly to step (6-4);

[0147] (6-4) Determine whether the number of completed events in a batch nr_batch> the preset batch threshold BATCH_THREHOLD is established. If so, proceed to step (6-5), otherwise proceed to step (6-7);

[0148] Specifically, the batch threshold BATCH_THREHOLD preset in the present invention has a value range of 256 to 2048, preferably 1024;

[0149] (6-5) Update the mean of all completed event arrival intervals mean = (mean*nr+batch) / (nr_batch+nr), update the left mean deviation lmd of all completed event arrival intervals lmd = (lmd*nr+lmd_batch) / (nr_batch+nr), update the counted number of completed event arrivals nr = nr_batch+nr, and then enter step (6-6).

[0150] (6-6) Update the total arrival intervals of completed events in the batch to batch = 0, update the number of arrival completed events in the batch to nr_batch = 0, update the total arrival intervals of completed events less than the mean in the batch to lmd_batch = 0, update the mean value of the arrival intervals of completed events before merging to mean_last = mean, and then proceed to step (6-7);

[0151] (6-7) Get the sleep time sleep_time according to the mean mean of all the completion event arrival intervals and the left mean deviation lmd of all the completion event arrival intervals;

[0152] Specifically, this step uses the following formula to calculate the sleep time sleep_time:

[0153] sleep_time=max(mean / 2,mean-4*lmd)

[0154] The advantage of this step (6) is that it uses a dynamic hybrid polling method to obtain requests, which reduces the number of system calls and the switching between kernel space and user space.

[0155] (7) Obtain the address of the user channel item from the user data field in the completion queue event after the write-send information obtained in step (6), and obtain the user channel item according to the address of the user channel item;

[0156] (8) Obtain the memory pointed to by the header field and the payload field of the user channel item obtained in step (7), read the FUSE request from the memory, and hand the FUSE request to the user space file system for processing to obtain the request processing result;

[0157] (9) writing the processing result obtained in step (8) into the header field and payload field of the user channel item obtained in step (7), and submitting the address of the user channel item to the submission queue in the io_uring instance to obtain an updated submission queue;

[0158] Specifically, in this step, the address of the user channel item is submitted to the submission queue in the io_uring instance to obtain the updated submission queue. This process includes the following substeps:

[0159] (9-1) Get the user space channel uch corresponding to the parent channel number field pqid of the user channel item obtained in step (7) pqid ;

[0160] (9-2) The user space channel uch obtained from step (9-1) pqid Get a submission queue item from the io_uring instance;

[0161] (9-3) The commit_id field of the submission queue item obtained in step (9-2) is set to the number of the FUSE request obtained in step (8), the channel number (qid) field of the submission queue item is set to the parent channel number field pqid of the user channel item, and the user data field of the submission queue item is set to the address of the user channel item obtained in step (7);

[0162] (9-4) Insert the submission queue item obtained in step (9-2) into the user space channel uch pqid The tail of the submission queue in the io_uring instance in ;

[0163] (10) Obtain the submission queue item from the updated submission queue header obtained in step (9), obtain the channel number from the channel number field of the submission queue item, and obtain the kernel space channel kch corresponding to the channel number qid , obtain the FUSE request number from the submission number field of the submission queue item, and obtain the request processing result from the header field and payload field of the kernel channel item through the request number.

[0164] The advantage of the above steps (8) to (10) is that the submission of the FUSE request processing result is completed using the submission queue item, thereby reducing memory copying.

[0165] In summary, the present invention builds an independent communication channel for each CPU core, utilizes the dual-ring queue communication mechanism of io_uring for efficient asynchronous communication between user state and kernel state, designs a hybrid polling strategy that combines short sleep and dynamic polling, dynamically determines the sleep time, designs a dynamic load balancing strategy based on multi-channel load status and NUMA locality, adopts a lightweight channel load estimation method, sends requests to the appropriate channel, and realizes efficient resource utilization.

[0166] Experimental results

[0167] The experimental environment for this paper is as follows: the CPU is two 10-core 2.20GHz Intel Xeon Silver 4114 processors (total 40 threads) with a frequency of 2666MHz, the memory is 192GB of ECC DDR4 DRAM, and the hard disk is a 1TB solid-state drive. Under the Linux operating system, the algorithm is implemented as a kernel module. To avoid the impact of storage device performance bottlenecks on the experimental results, a general block device is constructed using memory during the experiment, and the test is performed on this memory-constructed block device. The memory block device size is 160GB.

[0168] To illustrate the effectiveness and superiority of the present invention, the present invention was tested using the fio test suite and the filebench test suite, recording the throughput in different read and write scenarios and comparing it with the traditional FUSE framework. Figure 3 The overall performance of different user-space file systems under fio load and 32 threads (uFUSE is the present invention) is given. As can be seen from the figure, compared with traditional FUSE, the random read performance of the present invention is improved by 2.84 times, the random write performance is improved by 2.95 times, the sequential read performance is improved by 1.60 times, and the sequential write performance is improved by 2.11 times; Figure 4 The performance test results of filebench under four different workloads (fileserver, webserver, webserver and varmail) are given. As can be seen from the figure, compared with the traditional FUSE framework, in the above four types of workloads, the bandwidth performance of the present invention is improved by 1.27, 1.20, 2.36 and 1.16 times respectively.

[0169] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for optimizing a user space file system, characterized in that: The following steps are involved: (1) Receive a FUSE request from the user and parse the FUSE request to obtain the CPU core and request type corresponding to the FUSE request; (2) Obtain the number of the target kernel space channel for transmitting the FUSE request based on the CPU core and request type corresponding to the FUSE request obtained in step (1). (3) Select a kernel space channel numbered as the target kernel space channel number obtained in step (2) from the multiple kernel space channels obtained in step (2), and select the kernel space channel numbered as the target kernel space channel number from the first bidirectional linked list L in the kernel space channel. free Obtain an idle kernel channel item, copy the header of the FUSE request obtained in step (1) to the memory corresponding to the header field of the idle kernel channel item, and copy the payload of the FUSE request to the memory corresponding to the payload field of the idle kernel channel item; (4) Select the user space channel numbered as the target kernel space channel number obtained in step (2), and obtain the io_uring instance of the user space channel; (5) Obtain an idle completion queue event from the completion queue of the io_uring instance obtained in step (4), write the send information corresponding to the FUSE request into the idle completion queue event, and insert the completion queue event after writing the send information into the end of the completion queue to obtain an updated completion queue; (6) Obtaining the completion queue event after writing the send information from the updated completion queue obtained in step (5) in a sleep-first-then-polling manner; (7) obtaining the address of the user channel item from the custom data field in the completion queue event after the write-send information obtained in step (6), and obtaining the user channel item according to the address of the user channel item; (8) Obtain the memory pointed to by the header field and payload field of the user channel item obtained in step (7), read the FUSE request from the memory, and hand the FUSE request to the user space file system for processing to obtain the request processing result. (9) The processing result obtained in step (8) is written into the header field and the payload field of the user channel item obtained in step (7), and the address of the user channel item is submitted to the submission queue in the io_uring instance to obtain an updated submission queue. (10) Obtain the submission queue item from the updated submission queue header obtained in step (9), obtain the channel number from the channel number field of the submission queue item, and obtain the kernel space channel kch corresponding to the channel number qid , obtain the FUSE request number from the submission number field of the submission queue item, and obtain the request processing result from the header field and payload field of the kernel channel item through the request number.

2. The method for optimizing a user space file system according to claim 1, wherein: It is characterized by: Step (1) is to obtain the CPU core corresponding to the FUSE request according to the thread where the FUSE request is located; Step (1) is to obtain the request type of the FUSE request by reading the OPCODE field in the FUSE request. If the OPCODE field is READ or WRITE, it means that the FUSE request is a data type, otherwise it means that the FUSE request is a metadata type.

3. The method for optimizing a user space file system according to claim 1 or 2, wherein: Step (2) includes the following sub-steps: (2-1) Create a variable pending_size for each kernel space channel in the pre-established multiple channels, which is used to represent the size of the unprocessed FUSE requests in the kernel channel, wherein each kernel space channel is provided with a first bidirectional linked list L free and the second doubly linked list L pending , the first doubly linked list L free The second bidirectional linked list L is used to manage the idle kernel channel items in the kernel space channel. pending Used to manage unprocessed FUSE requests in the kernel space channel; (2-2) Scan the first doubly linked list L in each kernel space channel pending , to obtain the size of all FUSE requests, accumulate the sizes of all FUSE requests, and assign the accumulated result to the variable pending_size; (2-3) Obtain the NUMA node to which the CPU core obtained in step (1) belongs; (2-4) Create the first empty set S local and the second empty set S global , where the first empty set S local Used to store the numbers of kernel space channels corresponding to all CPU cores in the NUMA node obtained in step (2-3) that meet the preset conditions, the second empty set S global Used to store the kernel space channel numbers that meet the preset conditions corresponding to all CPU cores in the current client; (2-5) Select the kernel space channel corresponding to the CPU core obtained in step (1) as the initial candidate kernel space channel, and determine whether the variable pending_size corresponding to the initial candidate kernel space channel is less than the preset threshold Th. If so, it means that the initial candidate kernel space channel is the target kernel space channel. At this time, the number of the initial candidate kernel channel is returned, and the process ends. Otherwise, go to step (2-6); (2-6) Scan all kernel space channels corresponding to all CPUs of the NUMA node obtained from step (2-3), and add the numbers of all kernel space channels that meet the preset conditions to the first set S local middle; (2-7) Determine the first set S local Is the size greater than or equal to 2? If so, select the first set S local Randomly select two kernel space channels, and use the kernel space channel corresponding to the smaller variable pending_size of the two kernel space channels as the target kernel space channel, and return the number of the target kernel channel. The process ends, otherwise go to step (2-8); (2-8) Scan all kernel space channels of the current client and add the numbers of all kernel space channels that meet the preset conditions to the second set S global middle; (2-9) From the second set S global Randomly select two kernel space channels, and use the kernel space channel corresponding to the smaller variable pending_size of the two kernel space channels as the target kernel space channel, and return the number of the target kernel space channel.

4. The method for optimizing a user space file system according to any one of claims 1 to 3, wherein: The channel is established by following these steps: (A1) Obtain the number of CPU cores nr_cpu of the current client, initialize nr_cpu user space channels and nr_cpu kernel space channels, and initialize the user space channel depth depth = 1024; The current client has multiple consistent memory access NUMA nodes deployed, and each NUMA node includes multiple CPU cores. (A2) Set counter i=0; (A3) Determine whether the counter i is equal to the number of CPU cores nr_cpu, if yes, proceed to step (A11), otherwise proceed to step (A4); (A4) Initialize the i-th user space channel uch among nr_cpu user space channels i The size of the io_uring instance in the io_uring is equal to the user space channel depth depth, and the i-th user space channel uch is set i The number field qid i is equal to i; (A5) Set counter j=0; (A6) Determine whether the counter j is equal to the user space channel depth depth, if so, proceed to step (A10), otherwise proceed to step (A7); (A7) Get the i-th user space channel uch i The jth user channel item uent in ij , set the user channel item uent ij The parent channel number field pqid is i, and a memory space of size header_sz is allocated from the memory managed by the NUMA node to which the j-th CPU core belongs among all nr_cpu CPU cores, and the memory first address of the memory space is assigned to the j-th user channel item uent ij The header field allocates a memory space of size payload_sz from the memory managed by the NUMA node to which the j-th CPU core belongs among all nr_cpu CPU cores, and assigns the first address of the memory space to the j-th user channel item uent ij The payload field is encapsulated into the jth user channel item ent. ij In the corresponding iovec structure; (A8) From the i-th user space channel uch i Get an idle submission queue item SQE from the io_uring instance, and set the address field of the submission queue item to the j-th user channel item uent encapsulated in step (A7) ij The address of the corresponding iovec structure, set the custom data field of the submission queue item to the j-th user channel item uent encapsulated in step (A7) ij The memory address of the submitted queue is written, and the submitted queue item after the information is written is inserted into the tail of the submitted queue in the io_uring instance to obtain the updated submitted queue; (A9) Set counter j = j + 1 and return to step (A6); (A10) Set the counter i=i+1 and return to step (A3); (A11) Set counter m=0; (A12) Determine whether the counter m is equal to the number of CPU cores nr_cpu. If so, the process ends; otherwise, proceed to step (A13); (A13) Initialize the mth kernel space channel kch among the nr_cpu kernel space channels m The first doubly linked list L in free and the second doubly linked list L pending ; (A14) Set counter n=0; (A15) Determine whether the counter n is equal to the queue depth depth, if so, proceed to step (A19), otherwise proceed to step (A16); (A16) obtaining the submission queue item after the written information from the updated submission queue header obtained in step (A8), parsing the submission queue item after the written information to obtain the address of the iovec structure in the user channel item and the address of the user channel item; (A17) Get the mth kernel space channel kch m The nth kernel channel item kent in mn , obtain the corresponding iovec structure from the address of the iovec structure obtained in step (A16), obtain the header field and payload field from the iovec structure, and assign them to the kernel channel item kent respectively mn The header field and payload field of the kernel channel item kent are assigned the address of the user channel item obtained in step (A16) mn The address field of the kernel channel entry kent mn Put the first doubly linked list L in the kernel space channel free the end of; (A18) Set counter n=n+1 and return to step (A15); (A19) Set the counter m=m+1 and return to step (A12).

5. The method for optimizing a user space file system according to claim 4, wherein: In step (5), the sending information corresponding to the FUSE request is written into the idle completion queue event by setting the custom data field in the completion queue event to the address field of the idle kernel channel item; The process of sleeping first and then polling in step (6) is as follows: first, the user space daemon is put into sleep state, and the sleep time is sleep_time, then the user space daemon is woken up to poll the updated completion queue obtained in step (5) to obtain the completion queue event after the writing and sending information from the completion queue.

6. The method for optimizing a user space file system according to claim 5, wherein: The sleep time sleep_time is determined according to the following steps: (6-1) Initialize the user space timestamp of the last completion queue event arrival last_arrive_time = 0, the total number of completion event arrival intervals in the batch batch = 0, the total number of completion event arrival intervals less than the mean in the batch lmd_batch = 0, the average value of the completion event arrival intervals before merging mean_last = 0, the number of completion event arrivals in the batch nr_batch = 0, the mean value of all completion event arrival intervals mean = 0, the left mean deviation of all completion event arrival intervals lmd = 0, and the number of completed event arrivals counted nr = 0; (6-2) When the completion event arrives in the user space, obtain the current timestamp now, determine whether the number of completion events arriving in the batch nr_batch is 0, if so, set the timestamp of the last completion queue event arriving in the user space last_arrive_time = now, and then return to step (6-2), otherwise, calculate the interval interval between the arrival of this completion queue event in the user space and the arrival of the last completion queue event in the user space interval = now - last_arrive_time, update the total arrival interval of completion events in the batch batch = batch + interval, update the number of completion events arriving in the batch nr_batch = nr_batch + 1, and then enter step (6-3); (6-3) Determine whether the interval between the arrival of the current completion queue event and the arrival of the last completion queue event is less than the average value mean_last of the arrival interval of the completion event before the merger. If so, update the total arrival interval of the completion event in the batch that is less than the mean value lmd_batch = lmd_batch + interval, and then go to step (6-4); otherwise, go directly to step (6-4); (6-4) Determine whether the number of completed events in a batch nr_batch> the preset batch threshold BATCH_THREHOLD is established. If so, proceed to step (6-5), otherwise proceed to step (6-7); (6-5) Update the mean of all completed event arrival intervals mean = (mean*nr+batch) / (nr_batch+nr), update the left mean deviation lmd of all completed event arrival intervals lmd = (lmd*nr+lmd_batch) / (nr_batch+nr), update the counted number of completed event arrivals nr = nr_batch+nr, and then enter step (6-6). (6-6) Update the total arrival intervals of completed events in the batch to batch = 0, update the number of arrival completed events in the batch to nr_batch = 0, update the total arrival intervals of completed events less than the mean in the batch to lmd_batch = 0, update the mean value of the arrival intervals of completed events before merging to mean_last = mean, and then proceed to step (6-7); (6-7) Get the sleep time sleep_time according to the mean mean of all completion event arrival intervals and the left mean deviation lmd of all completion event arrival intervals: sleep_time=max(mean / 2,mean-4*lmd).

7. The method for optimizing a user space file system according to claim 6, wherein: The process of submitting the address of the user channel item to the submission queue in the io_uring instance in step (9) to obtain the updated submission queue includes the following substeps: (9-1) Get the user space channel uch corresponding to the parent channel number field pqid of the user channel item obtained in step (7) pqid ; (9-2) The user space channel uch obtained from step (9-1) pqid Get a submission queue item from the io_uring instance; (9-3) Setting the submission number field of the submission queue item obtained in step (9-2) to the number of the FUSE request obtained in step (8), setting the channel number field of the submission queue item to the parent channel number field pqid of the user channel item, and setting the custom data field of the submission queue item to the address of the user channel item obtained in step (7); (9-4) Insert the submission queue item obtained in step (9-2) into the user space channel uch pqid The tail of the submission queue in the io_uring instance in .

8. A system for optimizing a user space file system, characterized in that: include: The first module is used to receive a FUSE request from a user and parse the FUSE request to obtain the CPU core and request type corresponding to the FUSE request; The second module is used to obtain the number of the target kernel space channel for transmitting the FUSE request according to the CPU core and request type corresponding to the FUSE request obtained by the first module. The third module is used to select a kernel space channel numbered as the target kernel space channel obtained by the second module from the multiple kernel space channels obtained by the second module, and select the kernel space channel from the first bidirectional linked list L in the kernel space channel. free Obtain an idle kernel channel item, copy the header of the FUSE request obtained by the first module to the memory corresponding to the header field of the idle kernel channel item, and copy the payload of the FUSE request to the memory corresponding to the payload field of the idle kernel channel item; The fourth module is used to select a user space channel numbered as the target kernel space channel number obtained by the second module, and obtain the io_uring instance of the user space channel; The fifth module is used to obtain an idle completion queue event from the completion queue of the io_uring instance obtained by the fourth module, write the send information corresponding to the FUSE request into the idle completion queue event, and insert the completion queue event after the send information is written into the end of the completion queue to obtain an updated completion queue; The sixth module is used to obtain the completion queue event after the sending information is written from the updated completion queue obtained by the fifth module in a sleep-first-then-polling manner; The seventh module is used to obtain the address of the user channel item from the custom data field in the completion queue event after the write and send information obtained by the sixth module, and obtain the user channel item according to the address of the user channel item; An eighth module is configured to obtain the memory pointed to by the header field and the payload field of the user channel item obtained by the seventh module, read the FUSE request from the memory, and hand the FUSE request to the user space file system for processing to obtain a request processing result; The ninth module is configured to write the processing result obtained by the eighth module into the header field and the payload field of the user channel item obtained by the seventh module, and submit the address of the user channel item to the submission queue in the io_uring instance to obtain an updated submission queue; The tenth module is used to obtain the submission queue item from the updated submission queue header obtained from the ninth module, obtain the channel number from the channel number field of the submission queue item, and obtain the kernel space channel kch corresponding to the channel number qid , obtain the FUSE request number from the submission number field of the submission queue item, and obtain the request processing result from the header field and payload field of the kernel channel item through the request number.