Hybrid collaborative I / O optimization method and system
By using shared memory and buffer queue technology in a virtualized environment, the problem of inefficient I/O operation in a virtualized environment is solved, and more efficient data transmission and system performance improvement is achieved.
Patent Information
- Application Number
- CN202510155355.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In a virtualized environment, frequent I/O operation requests lead to a large overhead of switching the system's operating mode, and a large amount of I/O operation data leads to redundant copying of data, reducing system performance.
Using the hybrid collaborative I/O optimization method, by building shared memory between the virtual machine and the host, the I/O operation requests of the virtual machine are passed to the host through super calls, and the buffer queue is used to reduce the number of system operation mode switching caused by super calls.
Transferring data through shared memory reduces data transmission time, reduces performance overhead caused by super calls, and improves I/O operation performance in virtualized environments.
Smart Images

Figure CN119621249A_ABST
Abstract
Description
Background Art
[0002] In modern computer systems, I / O (input and output) operations are one of the key performance bottlenecks, especially in virtualized environments. Most applications cannot do without a large number of data I / O operations, and the overhead of I / O operations is usually more significant because the virtualization layer itself introduces additional complexity. Data I / O operations have always been an important indicator affecting application performance and even server performance. How to improve the efficiency of data I / O has always been a key point in application development.
[0003] In order to improve the efficiency of I / O operations and reduce their impact on the overall performance of the system, the design of optimization measures needs to start from multiple angles. At present, for I / O operation optimization, some studies optimize the performance of virtualized I / O operations through the idea of buffer queues. Others transmit network I / O operation data through the transmission channel of shared memory to optimize network communication in specific virtualization scenarios. Different optimization methods have different entry points and application scenarios, but the core lies in alleviating several important factors that make I / O operations a bottleneck in a virtualized environment.
[0004] First, frequent I / O operation requests will bring huge overhead of switching system operation modes.
[0005] Secondly, a large amount of I / O operation data will also lead to the workload of redundant data copying, which will further reduce system performance. Focusing on these two aspects for optimization can greatly optimize the I / O operation performance in a virtualized environment. Summary of the invention
[0006] In view of the deficiencies in the above-mentioned prior art, a hybrid collaborative I / O optimization method and system are provided, which takes network I / O as the entry point and optimizes the I / O performance in a virtualized environment by means of shared memory, so as to solve the technical problem of low I / O efficiency in a virtualized environment.
[0007] The present invention adopts the following technical solutions: A hybrid collaborative I / O optimization method comprises the following steps: S1. Create virt-socket, bind the virtual machine virt-socket service module and the host machine virt-socket service module and initialize them; S2. After the initialization of step S1 is completed, the user space program of the virtual machine virt-socket service module sends data by calling the standard socket interface. When the set scheduling conditions are met, the virtual machine virt-socket service module notifies the host machine virt-socket service module to respond to the I / O operation through a hypercall, and then transfers it to the host machine virt-socket service module for specific I / O operation processing; S3. After the I / O operation processing of step S2 is completed, the host machine virt-socket service module updates the descriptor list for this I / O operation processing, and writes the updated descriptor list back to the memory of the virtual machine virt-socket service module, completing the synchronous update and maintenance of the descriptor list by the host machine virt-socket service module and the virtual machine virt-socket service module. The hypercall returns the result, and the entire I / O operation processing flow ends.
[0008] Preferably, step S1 specifically includes: S101, the host machine virt-socket service module and the virtual machine virt-socket service module respectively load the virt-socket kernel support module, the host machine virt-socket service module runs the KVM virtualization management program to identify the type of hypercall number used by the virt-socket connection; the virtual machine virt-socket service module calls the virt-socket interface through the user space application to create a virt-socket, and creates a related data structure in the kernel; S102: Notify the host machine to create corresponding virtual machine virt-socket service modules and host machine virt-socket service modules through a hypercall.
[0009] Preferably, in step S101, the relevant data structure in the kernel includes a descriptor list of the address space allocated in advance.
[0010] Preferably, in step S102, the virtual machine virt-socket service module sends the memory address of the descriptor list to the host machine virt-socket service module and saves it, and completes the binding of the virtual machine virt-socket service module and the host machine virt-socket service module when dynamically reading and writing the descriptor list.
[0011] Preferably, step S2 specifically includes: S201, the user space program of the virtual machine virt-socket service module sends data by calling the send method of the standard socket interface; S202, when the set scheduling conditions are met, the virtual machine virt-socket service module notifies the host machine to perform an I / O operation processing response through a hypercall; S203, when a hypercall is captured by the virtual machine virt-socket service module management program, the hypercall number is determined to be the hypercall number used by virt-socket, and then transferred to the host machine virt-socket service module for processing.
[0012] Preferably, in step S201, before sending the data, the data is first copied to the kernel space of the virtual machine's virt-socket service module, and an empty descriptor is found in the descriptor list, and the data is updated.
[0013] Preferably, the data includes a memory address representing the data, a data size, an offset and other status information.
[0014] Preferably, in step S202, the scheduling condition is set such that when the descriptor list is filled, a hypercall is called to send an I / O operation processing request.
[0015] Preferably, in step S203, the host machine virt-socket service module first reads the memory address of the previously stored virtual machine descriptor list and updates the local descriptor list; then traverses the local descriptor list to find the descriptor item that needs to be processed by I / O operation at the current moment, and performs specific I / O operation processing according to the information in the descriptor.
[0016] In a second aspect, an embodiment of the present invention provides a hybrid collaborative I / O optimization system, including: Create a module, create a virt-socket, bind the virtual machine virt-socket service module and the host virt-socket service module and initialize them; After the response module is initialized, the user space program of the virtual machine virt-socket service module sends data by calling the standard socket interface. When the set scheduling conditions are met, the virtual machine virt-socket service module notifies the host machine virt-socket service module to respond to the I / O operation through a hypercall, and then transfers it to the host machine virt-socket service module for specific I / O operation processing; Update module: The host virt-socket service module updates the descriptor list for this I / O operation and writes the updated descriptor list back to the memory of the virtual machine virt-socket service module, completing the synchronous update and maintenance of the descriptor list by the host virt-socket service module and the virtual machine virt-socket service module. The hypercall returns the result, and the entire I / O operation processing flow ends.
[0017] In a third aspect, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned hybrid collaborative I / O optimization method when executing the computer program.
[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, including a computer program, which implements the steps of the above-mentioned hybrid collaborative I / O optimization method when executed by a processor.
[0019] Compared with the prior art, the present invention has at least the following beneficial effects: A hybrid collaborative I / O optimization method, a virtual machine runs as a common process in a host machine, and for the virtual machine, the physical address space used by the virtual machine will be mapped to the virtual address space used by the thread of the virtual machine in the host machine, through such an address mapping relationship, the integrity of the virtual machine address space is guaranteed, and the independence of the memory address space of the virtual machine and the host machine is also guaranteed, avoiding malicious memory access; because the virtual machine hypervisor runs at a higher level than the virtual machine and has absolute control over the memory of the virtual machine, therefore, with the assistance of the virtual machine hypervisor, the shared memory mechanism of the virtual machine and the host machine can be easily implemented. By building a shared memory between the virtual machine and the host machine, the I / O operation request of the virtual machine can change its transmission path through a special mechanism and transmit it through the shared memory, thereby achieving the optimization purpose.
[0020] Furthermore, when the virtual machine's I / O request is generated, the I / O operation data will be stored in a fixed kernel address of the virtual machine, and the corresponding flag bits of the data control information will be modified and recorded. Such data control information is passed to the data receiving module in the host machine through the hypercall unique to the virtualization environment. Through the hypercall, all information of the I / O operation request will be passed to the host machine, and then the network processing module of the host machine will analyze and process the I / O operation request.
[0021] Furthermore, the hypercall greatly facilitates the information transmission between the virtual machine and the host machine. It implements the switching of the operation mode of the virtual machine and the hypervisor through the relevant interfaces provided by the hypervisor, thereby realizing a timely and effective information transmission channel. However, this will bring a problem. Although the data is transmitted through shared memory, the data transmission time is reduced, but the cost is the introduction of hypercalls with large overhead. Therefore, how to make further optimization on this basis is a problem that needs to be considered. A feasible way is to use a buffer queue method, store a series of I / O requests in a buffer queue, and then send them out at a specific time through a certain scheduling method, thereby reducing the overhead caused by multiple I / O requests to one.
[0022] Furthermore, the low I / O efficiency in the virtualized environment is optimized by using shared memory to transmit data, and virt-socket is implemented in the KVM virtualized environment for network I / O: a socket protocol family based on shared memory. Its design and implementation combine multiple optimizations: the standard socket programming interface provides a simple and convenient programming interface for upper-layer applications, and existing applications can be modified and applied to virt-socket at the lowest cost, thereby achieving performance improvement in specific virtualized situations.
[0023] Furthermore, by using virt-socket, the I / O operation request queue of the virtual machine is passed to the host machine through a hypercall. After capturing such a hypercall, the host machine calls the corresponding network module for processing. The design of virt-socket also reduces the number of system operation mode switches caused by supercalls through a buffer queue, thereby reducing performance overhead.
[0024] It can be understood that the beneficial effects of the second aspect mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0025] In summary, the present invention achieves the optimization purpose through shared memory transmission, and reduces the number of system operation mode switching caused by hypercalls through a buffer queue, thereby reducing performance overhead.
[0026] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic diagram of the process of the present invention; Figure 2 This is the overall framework diagram of virt-socket; Figure 3 This is the overall flow chart of the hypercall; Figure 4 This is the architecture diagram of the symbol list; Figure 5 Read and write memory for virtual machines; Figure 6 A schematic diagram of a computer device provided by an embodiment of the present invention; Figure 7 The present invention is a block diagram of an electronic device provided according to an embodiment. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0030] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0031] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.
[0032] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0033] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0034] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0035] From a macro logic point of view, the virtual machine and the host machine share a piece of physical memory. The virtual machine runs as a normal process in the host machine. For the virtual machine, the physical address space used by it will be mapped to the virtual address space used by the thread of the virtual machine in the host machine. This address mapping relationship ensures the integrity of the virtual machine address space and the independence of the memory address space of the virtual machine and the host machine, thus avoiding malicious memory access. Since the virtual machine hypervisor runs at a higher level than the virtual machine and has absolute control over the memory of the virtual machine, the shared memory mechanism of the virtual machine and the host machine can be easily implemented with the assistance of the virtual machine hypervisor. By building a shared memory between the virtual machine and the host machine, the I / O operation processing request of the virtual machine can change its transmission path through a special mechanism and transmit it through the shared memory, thereby achieving the optimization purpose.
[0036] Data transmission can be done through shared memory as a medium, but some additional processing mechanisms are needed for data control. When an I / O operation processing request of a virtual machine is generated, the I / O operation processing data will be stored in a fixed kernel address of the virtual machine, and the corresponding flag bits of the data control information will be modified and recorded. Such data control information is passed to the data receiving module in the host machine through a hypercall unique to the virtualization environment. Through the hypercall, all information of the I / O operation processing request will be passed to the host machine, and then the network processing module of the host machine will analyze and process the I / O operation processing request.
[0037] Hypercalls greatly facilitate the information transmission between virtual machines and host machines. They implement the switching of the operation modes of virtual machines and hypervisors through the relevant interfaces provided by the hypervisor, thereby realizing a timely and effective information transmission channel. However, this will bring a problem. Although data transmission time is reduced by allowing data to be transmitted through shared memory, the cost is the introduction of hypercalls with large overhead. Therefore, how to make further optimizations on this basis is a problem that needs to be considered. A feasible way is to use a buffer queue method to store a series of I / O operation processing requests in a buffer queue, and then send them out uniformly at a specific time through a certain scheduling method, thereby reducing the overhead caused by multiple I / O operation processing requests to one.
[0038] The present invention provides a hybrid collaborative I / O optimization method, which optimizes the problem of low I / O operation processing efficiency in a virtualized environment by adopting a shared memory data transmission method, and implements virt-socket (virtual network socket) in a KVM (Kernel-based Virtual Machine) virtualized environment for network I / O operation processing: a socket protocol family based on shared memory.
[0039] Its design and implementation combine multiple optimizations: the standard socket programming interface provides a simple and convenient programming interface for upper-level applications, and existing applications can be modified and applied to virt-socket at minimal cost, thereby achieving performance improvements in specific virtualization scenarios.
[0040] The virtual machine and the host machine transfer data through shared memory, which greatly improves performance, especially in scenarios with large amounts of I / O operation data. In an unoptimized virtualized environment, the process of transferring data through protocols such as TCP / UDP (Transmission Control Protocol / User Datagram Protocol) involves multiple data copies and system switching overhead, resulting in great performance loss. With virt-socket, the virtual machine's I / O operation request queue is passed to the host machine through a hypercall. After capturing such a hypercall, the host machine calls the corresponding network module for processing. The design of virt-socket also reduces the number of system operation mode switches caused by supercalls by means of a buffer queue, thereby reducing performance overhead.
[0041] Example 1 See also Figure 1 The present invention provides a hybrid collaborative I / O optimization method, comprising the following steps: S1. Create virt-socket, bind the virtual machine virt-socket service module and the host machine virt-socket service module and initialize them; In the virtual machine, virt-socket is responsible for creating virtual communication endpoints through user space applications. The virtual machine virt-socket service module communicates with the host through user space applications, creates virt-sockets, and allocates corresponding data structures for each virtual channel in the kernel.
[0042] In the host machine, virt-socket supports data transmission between the host machine and the virtual machine by providing an efficient communication method; the host machine virt-socket service module supports communication with the virtual machine through the kernel module, and identifies and processes communication requests through the KVM hypervisor.
[0043] In the virt-socket framework, the data transmitted by each network I / O operation request is represented by a descriptor. This descriptor stores all the information of this piece of data, including the memory address of the data, the size of the data, the offset and other auxiliary flags. The descriptors of multiple I / O operation requests are organized into a circular buffer queue, called a descriptor list, and are issued at one time by the hypercall. The virtual machine manager maintains such a descriptor list for each virtual machine and keeps it synchronized with the descriptor list in the virtual machine. When the descriptor list of a virt-socket instance in the virtual machine meets certain scheduling rules, the hypercall will issue all buffered I / O operation requests together. At this time, the virtual machine manager will read the latest virtual machine descriptor list content according to the previously saved descriptor list address inside the virtual machine, so as to obtain all I / O operation requests represented by this descriptor list. After all I / O operation requests are completed, the updated descriptor list will be written back to the memory of the virtual machine. In this way, the virtual machine manager completes the synchronous update of the descriptor list of each virtual machine.
[0044] S101, first, the host machine and the virtual machine load the kernel support module of virt-socket to complete the support for the protocol family virtualization, and the KVM virtualization management program running on the host machine can identify the type of hypercall number used by the virt-socket connection; the user space application of the virtual machine calls the virt-socket interface to create a virt-socket, and at this time, the relevant data structures in the kernel are also created, including the descriptor list of the address space allocated in advance; S102, then notify the kernel module of the host machine to create a corresponding virt-socket service module through a hypercall.
[0045] During this process, the virtual machine kernel virt-socket module sends the memory address of the descriptor list to the host machine's virt-socket service module and saves it. It will be used when dynamically reading and writing the descriptor list in the future, completing the binding of the virtual machine's virt-socket and the host machine's virt-socket service module.
[0046] S2. After the virt-socket is created and initialized in step S1, the user space program of the virtual machine sends data by calling the standard socket interface. When the set scheduling conditions are met, the virtual machine notifies the host machine to respond to the I / O operation through a hypercall, and then transfers it to the virt-socket service module for specific I / O operation processing; In order to ensure that the virt-socket library is as transparent as possible to the upper layer, the present invention designs a socket application programming interface (Application Programming Interface, API), so that any upper layer application can use the standard socket programming interface to reference and call virt-socket. Since virt-socket transfers data through shared memory in the KVM virtualization environment, this data transmission method is different from the TCP protocol or UDP protocol. Therefore, this system registers a new set of network address families (Address Family) and protocol families (Protocol Family) in the virtual machine Linux kernel, namely, address family virtualization AF_VIRT and protocol family virtualization PF_VIRT, which are used to represent virt-socket connections in the virtualization environment. This allows the system to process virt-socket data packets differently from TCP and UDP protocols, making the design and implementation simple and clear.
[0047] In actual applications, it is necessary to make small modifications to the virtual machine hypervisor to identify and capture new network packets, and add the virt-socket kernel support module to the virtual machine and the host. This kernel module registers the protocol family virtualization PF_VIRT protocol to the global system to handle the initialization, data transmission and data reception of the virt-socket connection. Applications using virt-socket need to reference the corresponding header file and specify the socket address family virtualization AF_VIRT and protocol family virtualization PF_VIRT when creating a socket connection, so as to enjoy the performance optimization in specific virtualization scenarios.
[0048] In a virtualized environment, the concept of hypercall is similar to the concept of system call in an operating system. A hypercall can be used to pass requests and send commands between a virtual machine and a host machine. A hypercall is a request sent by a virtual machine to the kernel of the host machine through the virtual machine monitor, and the host machine responds and returns the result. A hypercall allows a virtual machine to get a response from the host machine in a method similar to a system call, so that the virtual machine and the host machine can achieve specific functions through deeper collaboration.
[0049] A hypercall is initiated by the user space of the virtual machine and is ultimately responded to by the host kernel. Therefore, to add a hypercall, you first need to add a system call in the kernel of the virtual machine, and then implement it in the specific implementation of the system call. The system will first detect whether the virtualized environment exists, that is, the virtual machine will detect whether it exists in a virtualized environment. Because it is meaningless for a non-virtual machine to use such a hypercall. If the detection is successful, a hypercall is generated using the relevant interface supported by the virtual machine hypervisor, and the system operating mode is switched, that is, from non-root mode to root mode. Adding a new hypercall requires registering a new hypercall number in the virtual machine hypervisor to distinguish different hypercall types.
[0050] S201, the user space program of the virtual machine sends data by calling the interface of the standard socket; The data is first copied to the kernel space of the virtual machine, and an empty descriptor is found in the descriptor list and its information is updated; the updated information includes the memory address representing the data, the data size, the offset and other status information.
[0051] S202, when the set scheduling conditions are met, the virtual machine notifies the host machine to respond to the I / O operation through a hypercall; When to send such a hypercall is a problem of scheduling algorithm, which needs to ensure that data is delivered as soon as possible, but not too frequently to reduce performance. In the present invention, when the descriptor list is filled, a hypercall is called to send an I / O operation processing request, aiming to try the maximum optimization degree that can be achieved by virtualized I / O optimization based on shared memory.
[0052] Since the virtual machine and the host machine run on the same physical computer, they share the same computing power, storage resources, and network resources. The virtual machine hypervisor can control the running status of the virtual machine and also obtain all the information about the running of the virtual machine. Due to the memory management mechanism of the virtual machine, the physical memory address of the virtual machine is actually a mapping of the virtual memory space of the virtual machine process on the host machine, which is controlled by the virtual machine hypervisor. With this convenience, many personalized special optimizations can be made to achieve better network I / O operation processing efficiency, such as transmitting network I / O operation processing data through shared memory between the virtual machine and the host machine.
[0053] When an application calls the socket application programming interface provided by virt-socket to process network I / O operations, the virtual machine virt-socket service module first applies for a fixed memory space to cache the data that needs to be processed for each I / O operation. This caching mechanism allows the virt-socket instance to directly use the already applied memory space each time it sends or receives data, eliminating the overhead of dynamic allocation. The virtual machine virt-socket service module copies the data to be sent to the already applied cache space. And the descriptor list is updated synchronously. The virtual machine's descriptor list contains detailed information on all I / O operation processing requests, including the current memory address of the data block, data size, address offset, and other flags.
[0054] S203, when a hypercall is captured by the virtual machine management program, the hypercall number is determined to be the hypercall number used by the virt-socket, and then the hypercall is transferred to the virtual machine virt-socket service module for processing.
[0055] The virtual machine virt-socket service module first reads the memory address of the previously stored virtual machine descriptor list and updates the local descriptor list; then it traverses the local descriptor list to find the descriptor item that needs to be processed for I / O operation at the current moment, and performs specific I / O operation processing according to the information in the descriptor.
[0056] In the case of native virtualization, each I / O operation request is accompanied by a switch in the system operation mode, which brings huge performance overhead. Therefore, drawing on the idea of buffer queues, the design and implementation of virt-socket also uses buffer queues to reduce the performance loss caused by frequent system operation mode switching.
[0057] In virt-socket, multiple network I / O operation processing requests will be first cached in a descriptor list data structure after being issued. This descriptor list is essentially a fixed-length circular buffer queue. When there is a vacancy, new elements can be added to the queue, and the queues are connected end to end to form a ring. When certain scheduling conditions are met, a super call will be triggered, so that all network I / O operation processing requests are issued at one time, thereby reducing the overhead of system switching. In the implementation of virt-socket, the present invention adopts a relatively simple but effective way to achieve such scheduling, that is, a super call is triggered when the descriptor list is full. Such a mechanism can maximize the degree of optimization space that this shared memory-based optimization mechanism can bring, and it is simple, effective and reliable to implement.
[0058] When the application in the virtual machine initializes the socket connection through virt-socket, the virtual machine virt-socket service module will first allocate a fixed memory address as the space for the descriptor list, and pass the address to the host through a hypercall, and create the host virt-socket service module at the same time. Therefore, when the virtual machine and the host need to synchronize the descriptor list later, the host can update the local descriptor list through this pre-known virtual machine descriptor list memory address, or write the latest local descriptor list to the virtual machine's designated memory to synchronize the descriptor list.
[0059] In view of the good timeliness of the hypercall, in the implementation of virt-socket, the system uses the hypercall to pass messages. The specific implementation of the socketAPI function of virt-socket is actually the responsibility of the hypercall, such as connect, accept, bind, send, recv, etc. Since virt-socket is given a socket API, it is only necessary to directly call the relevant interface provided by the virtual machine hypervisor in the kernel implementation of the socket interface to implement the hypercall. The system takes the hypercall number used by virt-socket, the operation type of virt-socket, etc. as parameters into the hypercall, and is captured by the virtual machine hypervisor. When the virtual machine hypervisor obtains these parameters, it will create a corresponding virt-socket service module for this virt-socket request, read the parameters, complete the I / O operation processing request, and return the result.
[0060] S3. After the I / O operation processing of step S2 is completed, the host machine virt-socket service module updates the descriptor list according to the operation processing status of this I / O, and writes the updated descriptor list back to the memory of the virtual machine, completing the synchronous update and maintenance of the descriptor list by the host machine virt-socket service module and the virtual machine virt-socket service module; finally, the hypercall returns the result, thereby completing the entire I / O operation process.
[0061] The system of the present invention modifies the relevant API of KVM, so that the virtual machine virt-socket service module can read the data of a certain memory address of the virtual machine through the API, or write the data into the memory address of the virtual machine. Therefore, in the previous I / O operation process, when the KVM kernel module captures such a hypercall, the virtual machine virt-socket service module first reads the latest virtual machine descriptor list content and updates the local descriptor list according to the address of the previously saved virtual machine descriptor list; When the virtual machine I / O operation is completed, the virtual machine virt-socket service module writes the updated descriptor list to the memory address where the virtual machine's descriptor list is located. After the virtual machine resumes operation, it directly accesses the updated descriptor list, thereby completing the synchronous maintenance and update of the descriptor list between the host and the virtual machine.
[0062] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits", "modules" or "platforms".
[0063] Example 2 The present invention provides a hybrid collaborative I / O optimization system, which can be used to implement the above-mentioned hybrid collaborative I / O optimization method. Specifically, the hybrid collaborative I / O optimization system includes a creation module, a response module and an update module.
[0064] Among them, create a module, create a virt-socket, bind the virtual machine virt-socket service module and the host machine virt-socket service module and initialize them; The host virt-socket service module and the virtual machine virt-socket service module load the virt-socket kernel support module respectively. The host virt-socket service module runs the KVM virtualization management program to identify the type of hypercall number used by the virt-socket connection; the virtual machine virt-socket service module creates a virt-socket through the user space application calling the virt-socket interface and creates related data structures in the kernel; the host is notified through the hypercall to create the corresponding virtual machine virt-socket service module and host virt-socket service module.
[0065] After the response module is initialized, the user space program of the virtual machine virt-socket service module sends data by calling the standard socket interface. When the set scheduling conditions are met, the virtual machine virt-socket service module notifies the host machine virt-socket service module to respond to the I / O operation through a hypercall, and then transfers it to the host machine virt-socket service module for specific I / O operation processing; The user space program of the virtual machine's virt-socket service module sends data by calling the send method of the standard socket interface; when the set scheduling conditions are met, the virtual machine's virt-socket service module notifies the host machine to respond to the I / O operation through a hypercall; when a hypercall is captured by the virtual machine's virt-socket service module management program, it determines that its hypercall number is the hypercall number used by virt-socket, and then transfers it to the host machine's virt-socket service module for processing.
[0066] Update module: The host virt-socket service module updates the descriptor list for this I / O operation and writes the updated descriptor list back to the memory of the virtual machine virt-socket service module, completing the synchronous update and maintenance of the descriptor list by the host virt-socket service module and the virtual machine virt-socket service module. The hypercall returns the result, and the entire I / O operation processing flow ends.
[0067] Example 3 The present invention provides a terminal device, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, graphics processors (GPU), tensor processors (TPU), digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions to implement corresponding method processes or corresponding functions; the processor described in the embodiment of the present invention can be used for the operation of the hybrid collaborative I / O optimization method, including: Create virt-socket, bind the virtual machine virt-socket service module and the host machine virt-socket service module and initialize them; after the initialization is completed, the user space program of the virtual machine virt-socket service module sends data by calling the standard socket interface. When the set scheduling conditions are met, the virtual machine virt-socket service module notifies the host machine virt-socket service module to respond to the I / O operation through a hypercall, and then transfers it to the host machine virt-socket service module for specific I / O operation processing; then the host machine virt-socket service module updates the descriptor list for this I / O operation processing, and writes the updated descriptor list back to the memory of the virtual machine virt-socket service module, completing the synchronous update and maintenance of the descriptor list by the host machine virt-socket service module and the virtual machine virt-socket service module, the hypercall returns the result, and the entire I / O operation processing flow ends.
[0068] See also Figure 6, the terminal device is a computer device. The computer device 60 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When the computer program 63 is executed by the processor 61, the hybrid collaborative I / O optimization method of the embodiment is implemented. To avoid repetition, it is not described here one by one. Alternatively, when the computer program 63 is executed by the processor 61, the functions of each model / unit in the hybrid collaborative I / O optimization system of the embodiment are implemented. To avoid repetition, it is not described here one by one.
[0069] The computer device 60 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will appreciate that Figure 6 This is only an example of the computer device 60 and does not constitute a limitation of the computer device 60. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0070] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, graphics processing units (GPU), tensor processing units (TPU), digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0071] The memory 62 may be an internal storage unit of the computer device 60, such as a hard disk or memory of the computer device 60. The memory 62 may also be an external storage device of the computer device 60, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device 60.
[0072] Furthermore, the memory 62 may include both an internal storage unit of the computer device 60 and an external storage device. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 may also be used to temporarily store data that has been output or is to be output.
[0073] See also Figure 7 The terminal device is an electronic device 600, which is in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0074] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above method section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1 Follow the steps shown in .
[0075] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0076] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0077] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0078] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems). Such communication may be performed via an input / output interface 650. In addition, the electronic device 600 may also communicate with one or more networks (e.g., local area networks, wide area networks, and / or public networks, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, etc.
[0079] Example 4 The present invention also provides a storage medium, specifically a computer-readable storage medium, which is a memory device in a terminal device for storing programs and data. It is understandable that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device, and can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that more specific examples of the computer-readable storage medium here include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0080] Computer readable storage media also include data signals propagated in baseband or as part of a carrier wave, which carry readable program code. Such propagated data signals can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium can also be any readable medium other than a readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or device. The program code contained on the readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, radio frequency, etc., or any suitable combination of the above.
[0081] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network or a wide area network, or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0082] The processor may load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the hybrid collaborative I / O optimization method in the above embodiment; the processor may load and execute the following steps: Create virt-socket, bind the virtual machine virt-socket service module and the host machine virt-socket service module and initialize them; after the initialization is completed, the user space program of the virtual machine virt-socket service module sends data by calling the standard socket interface. When the set scheduling conditions are met, the virtual machine virt-socket service module notifies the host machine virt-socket service module to respond to the I / O operation through a hypercall, and then transfers it to the host machine virt-socket service module for specific I / O operation processing; then the host machine virt-socket service module updates the descriptor list for this I / O operation processing, and writes the updated descriptor list back to the memory of the virtual machine virt-socket service module, completing the synchronous update and maintenance of the descriptor list by the host machine virt-socket service module and the virtual machine virt-socket service module, the hypercall returns the result, and the entire I / O operation processing flow ends.
[0083] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can usually be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0084] Specific implementation of virtualized network I / O optimization solution based on shared memory The experimental software environment of the system is as follows: The host machine uses the Linux operating system Ubuntu12.04 distribution with a 3.2.0 kernel, and the virtual machine uses the same operating system environment.
[0085] The virtual machine KVM kernel module is kvm-kmod3.8, and QEMU uses qemu-kvm-1.2.0 version.
[0086] The implementation of virt-socket consists of several different modules, including: 1. The socket communication module of the virtual machine provides a concise socket programming interface to the application, which is convenient for calling virt-socket.
[0087] 2. Hypercall module, which adds hypercall function to the virtual machine and enables the requested information to be directly passed to the host machine through hypercall.
[0088] 3. Virtual machine memory acquisition module, which is an encapsulation of the virt-socket service module in the host machine to read and write virtual machine memory operations.
[0089] The above modules are combined and connected to form the overall framework of virt-socket. The upper-layer socket provides a calling interface for the application, the hypercall transmits the I / O request queue, and the virtual machine memory acquisition module operates the memory data of the virtual machine, thereby realizing data transmission based on shared memory. The overall framework of virt-socket is as follows Figure 2 shown.
[0090] 1. Socket programming interface Before running the virt-socket test case, the virtual machine first needs to load the virt-socket kernel module to register the new virt-socket network protocol in the virtual machine's operating system.
[0091] When the virt-socket kernel module is dynamically loaded into the system kernel, the module_init function is called actively. The implementation of this function registers the protocol and operation function array corresponding to virt-socket with the system. In this way, the application can use virt-socket through the PF_VIRT network type. When the module is unloaded from the operating system kernel, the module_exit function is called actively to deregister the virt-socket network type from the system.
[0092] 2. Hypercall Hypercalls can transfer requests between virtual machines and host machines. Unlike system calls, hypercalls are initiated by the user space of the virtual machine, passed to the kernel state of the virtual machine through the system call, and then passed to the kernel state of the host machine through the interface provided by the virtual machine hypervisor, thereby obtaining a response from the kernel of the host machine. This process involves a system call within the virtual machine and a switch in the operation mode between the virtual machine and the host machine. Therefore, implementing a system call requires starting from these two aspects.
[0093] Implementing a system call in a Linux operation link is relatively simple, so it will not be described in detail. In the specific scenario of the present invention, after registering a new virt-socket network type, the virt-socket instance involves the occurrence of system calls when using the socketAPI to create, send, receive and close network connections. Therefore, the system does not need to generate a new system call in a special way, but directly implements the subsequent implementation of the hypercall in the kernel implementation of virt-socket.
[0094] The implementation of hypercall requires the use of relevant interfaces provided by KVM. Specifically, when calling the hypercall interface, you must first check whether the current computer exists in the form of a virtual machine. Assuming that a computer runs directly on hardware, it cannot implement anything by calling hypercall because it does not exist in a virtualized environment. After detecting the virtualized environment, the calling program can introduce up to 5 32-byte parameters to pass to the host. They represent the hypercall number and other 4 flags related to specific scenarios. These flags are passed to the host through registers. See the overall process of hypercall. Figure 3 shown.
[0095] 3. Request merging mechanism In the absence of any optimized virtualization, every I / O of the virtual machine will cause a change in the running state of the virtual machine, that is, the switch between root mode and non-root mode, and such a switch has a large performance overhead. In order to reduce such switching overhead, the system designs a circular buffer queue to store I / O requests. Each item in the queue is a descriptor, which is used to describe the data block corresponding to a certain I / O request, including the memory address, size, offset and other flags of the data block. These descriptors are combined to form a descriptor list, which is connected to the first bit and is a circular data structure. And each time the scheduling conditions are met, all I / O requests represented by the entire descriptor list will be issued at once, thereby reducing the original multiple system operation mode switches to one, greatly reducing the performance overhead caused by system mode switching. The architecture of the descriptor list is as follows Figure 4 shown.
[0096] 4. Virtual machine memory reading and writing The virtual machine management program controls the operation of the virtual machine and manages the memory and I / O of the virtual machine. The present invention modifies the code of the KVM kernel module and opens the permission for other programs to modify the memory value of a specific virtual machine, thereby realizing the shared use of the virtual machine memory.
[0097] When the virt-socket service module needs to read or write the value of a certain memory address of the virtual machine, it will call the modified KVM related API. It plays a vital role in various stages of the virt-socket connection, such as initial creation, synchronization of the host descriptor list after sending data requests, reading and writing I / O data, and updating the virtual machine descriptor list after I / O is completed. Its architecture design is as follows Figure 5 shown.
[0098] In summary, the present invention provides a hybrid collaborative I / O optimization method and system, which realizes a shared memory mechanism between a virtual machine and a host machine with the assistance of a virtual machine hypervisor. By building a shared memory between the virtual machine and the host machine, the I / O request of the virtual machine changes its transmission path through a special mechanism and is transmitted through the shared memory, thereby achieving the optimization purpose; the scheduling method is uniformly issued at a specific time, thereby reducing the overhead caused by multiple I / O requests to one; the number of system operation mode switches caused by super calls is reduced by means of a buffer queue, thereby reducing performance overhead.
[0099] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0100] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0101] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0102] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0104] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0105] If the integrated module / 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 this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0106] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0107] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0109] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A hybrid collaborative I / O optimization method, characterized in that: The following steps are involved: S1. Create virt-socket, bind the virtual machine virt-socket service module and the host machine virt-socket service module and initialize them; S2. After the initialization of step S1 is completed, the user space program of the virtual machine virt-socket service module sends data by calling the standard socket interface. When the set scheduling conditions are met, the virtual machine virt-socket service module notifies the host machine virt-socket service module to respond to the I / O operation through a hypercall, and then transfers it to the host machine virt-socket service module for specific I / O operation processing; S3. After the I / O operation processing of step S2 is completed, the host machine virt-socket service module updates the descriptor list for this I / O operation processing, and writes the updated descriptor list back to the memory of the virtual machine virt-socket service module, completing the synchronous update and maintenance of the descriptor list by the host machine virt-socket service module and the virtual machine virt-socket service module. The hypercall returns the result, and the entire I / O operation processing flow ends.
2. The hybrid collaborative I / O optimization method according to claim 1, characterized in that: Step S1 is specifically as follows: S101, the host machine virt-socket service module and the virtual machine virt-socket service module respectively load the virt-socket kernel support module, the host machine virt-socket service module runs the KVM virtualization management program to identify the type of hypercall number used by the virt-socket connection; the virtual machine virt-socket service module calls the virt-socket interface through the user space application to create a virt-socket, and creates a related data structure in the kernel; S102: Notify the host machine to create corresponding virtual machine virt-socket service modules and host machine virt-socket service modules through a hypercall.
3. The hybrid collaborative I / O optimization method according to claim 2, characterized in that: In step S101, the relevant data structure in the kernel includes a descriptor list of the address space allocated in advance.
4. The hybrid collaborative I / O optimization method according to claim 2, characterized in that: In step S102, the virtual machine virt-socket service module sends the memory address of the descriptor list to the host machine virt-socket service module and saves it. When the descriptor list is dynamically read and written, the binding of the virtual machine virt-socket service module and the host machine virt-socket service module is completed.
5. The hybrid collaborative I / O optimization method according to claim 1, characterized in that: Step S2 is specifically as follows: S201, the user space program of the virtual machine virt-socket service module sends data by calling the send method of the standard socket interface; S202, when the set scheduling conditions are met, the virtual machine virt-socket service module notifies the host machine to perform an I / O operation processing response through a hypercall; S203, when a hypercall is captured by the virtual machine virt-socket service module management program, the hypercall number is determined to be the hypercall number used by virt-socket, and then transferred to the host machine virt-socket service module for processing.
6. The hybrid collaborative I / O optimization method according to claim 5, characterized in that: In step S201, before sending the data, the data is first copied to the kernel space of the virtual machine's virt-socket service module, and an empty descriptor is found in the descriptor list, and the data is updated.
7. The hybrid collaborative I / O optimization method according to claim 6, characterized in that: The data includes the memory address representing the data, the data size, the offset and other status information.
8. The hybrid collaborative I / O optimization method according to claim 5, characterized in that: In step S202, the scheduling condition is set such that when the descriptor list is full, a hypercall is called to send an I / O operation processing request.
9. The hybrid collaborative I / O optimization method according to claim 5, characterized in that: In step S203, the host machine virt-socket service module first reads the memory address of the previously stored virtual machine descriptor list and updates the local descriptor list; then it traverses the local descriptor list to find the descriptor item that needs to be processed by I / O operation at the current moment, and performs specific I / O operation processing according to the information in the descriptor.
10. A hybrid collaborative I / O optimization system, characterized in that: include: Create a module, create a virt-socket, bind the virtual machine virt-socket service module and the host virt-socket service module and initialize them; After the response module is initialized, the user space program of the virtual machine virt-socket service module sends data by calling the standard socket interface. When the set scheduling conditions are met, the virtual machine virt-socket service module notifies the host machine virt-socket service module to respond to the I / O operation through a hypercall, and then transfers it to the host machine virt-socket service module for specific I / O operation processing; Update module: The host virt-socket service module updates the descriptor list for this I / O operation and writes the updated descriptor list back to the memory of the virtual machine virt-socket service module, completing the synchronous update and maintenance of the descriptor list by the host virt-socket service module and the virtual machine virt-socket service module. The hypercall returns the result, and the entire I / O operation processing flow ends.