User-mode paravirtualized device creation and deletion of systems, devices, and clusters
By implementing the creation and deletion system of user-mode paravirtualized devices in the host machine, and using the virtual input and output protocol and the virtual host protocol to optimize container and group management, the problem of long interruption time of virtual machine live migration is solved and the user experience is improved.
Patent Information
- Application Number
- CN202410863120.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-29
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-29
AI Technical Summary
The input and output interruption time of virtual machines during live migration is long, resulting in poor user experience.
By providing a user-mode paravirtualization device creation and deletion system in the host, using the virtual input and output protocol and the virtual host protocol for data plane pass-through and control plane negotiation, the management of containers and groups is optimized, and the address mapping during virtual machine migration is reduced. and unmap operations.
Significantly reduces the input and output interruption time of virtual machine live migration and improves user experience.
Smart Images

Figure CN118394453B
Abstract
Description
Technical Field
[0001] The present application relates to the computer field, and in particular to a user-mode semi-virtualized device creation and deletion system, device and cluster. Background Art
[0002] Virtio Data Path Acceleration (vDPA) is a data path acceleration technology used in virtualized environments to improve the performance and efficiency of virtual machines' access to the host's physical devices. By abstracting the data path acceleration function from the host's physical devices and making them devices directly accessible to the virtual machines, vDPA reduces the communication overhead between the virtual machines and the host's physical devices and improves the efficiency and performance of data transmission.
[0003] Paravirtualized data path acceleration is a hardware offload solution with the control plane based on the virtual host (vhost) protocol and the data plane based on the virtual input and output (virtio) protocol. The virtual host protocol is a protocol used in a virtualized environment to improve the performance and efficiency of virtual machines' access to the host's physical devices. Specifically, the virtual host protocol allows virtual machines to communicate directly with the host's physical devices, bypassing the packet processing of virtualization software (such as the hypervisor), thereby reducing data transmission latency and improving network performance. The virtual input and output (virtio) protocol defines a set of virtual device specifications that enable efficient data transmission between virtual machines and the host's physical devices. By using the virtual input and output protocol, virtual machines can communicate directly with the host's physical devices without going through an additional intermediate layer, thereby improving the performance and efficiency of virtual machines. Therefore, the emergence of paravirtualized data path acceleration technology allows virtual machines to pass-throuth to physical devices, while using virtual host technology to support hot migration of virtual machines.
[0004] Paravirtualized data path acceleration may include user-mode paravirtualized data path acceleration. User-mode paravirtualized data path acceleration may be developed based on the Data Plane Development Kit (DPDK), using the vhost-user protocol to interact with the simulator (e.g., qemu) to complete control plane negotiation of virtual input and output. The DPDK is a user-mode driver that is easy to develop, debug, and upgrade, so it has more users than kernel-mode paravirtualized data path acceleration.
[0005] However, currently the input and output interruption time of hot migration of virtual machines is relatively long, and the user experience is not good. Summary of the invention
[0006] The present application provides a user-mode paravirtualized device creation and deletion system, device, and cluster, which can reduce the input and output interruption time of virtual machines performing hot migration.
[0007] In a first aspect, a user-mode paravirtualized device creation system is provided, comprising:
[0008] A data processing device for connecting to a host machine via a peripheral component interconnect expansion;
[0009] The host machine is used to run one or more virtual machines and provide user-mode paravirtualized data path acceleration for the virtual machines to access the data processing device, wherein the user-mode paravirtualized data path acceleration includes data plane direct communication based on a virtual input and output protocol and control plane negotiation based on a virtual host protocol between the virtual machines and the data processing device;
[0010] The host machine is used to obtain a first user-state paravirtualized device creation request, wherein the first user-state paravirtualized device creation request includes a first virtual machine identifier, and is used to create a first user-state paravirtualized device;
[0011] The host machine is used to determine whether a first container corresponding to the first virtual machine identifier exists according to the first virtual machine identifier, and if the first container exists, create a first group in the first container, and create a first user-state para-virtualized device in the first group, wherein the first container also includes a second group, a second user-state para-virtualized device is created in the second group, and the first user-state para-virtualized device and the second user-state para-virtualized device belong to the same virtual machine.
[0012] In some possible designs, the host machine is used to obtain a second user-state para-virtualized device creation request, wherein the second user-state para-virtualized device creation request includes a first virtual machine identifier, which is used to create a third user-state para-virtualized device; the host machine is used to determine whether there is a first container corresponding to the first virtual machine identifier based on the first virtual machine identifier, and if the first container exists, create a third group in the first container and create a third user-state para-virtualized device in the third group.
[0013] In some possible designs, the host machine is further used to perform mapping between input and output virtual addresses and host physical addresses based on the third group, but not to perform mapping between host virtual addresses and host physical addresses based on the first container.
[0014] In some possible designs, the host machine is further used to increase a first container count, wherein the first container count is used to record the number of user-mode paravirtualized devices of the first virtual machine.
[0015] In some possible designs, the host machine is used to obtain a third user state paravirtualized device creation request, wherein the third user state paravirtualized device creation request includes a second virtual machine identifier, and is used to create a fourth user state paravirtualized device;
[0016] The host machine is used to determine whether a second container corresponding to the second virtual machine identifier exists according to the second virtual machine identifier, and if the second container does not exist, create the second container, create a fourth group in the second container, and create a fourth user-mode para-virtualized device in the fourth group.
[0017] In some possible designs, the host machine is further used to perform a mapping between input and output virtual addresses and host physical addresses based on the fourth group, and to perform a mapping between host virtual addresses and host physical addresses based on the second container.
[0018] In a second aspect, a user-mode paravirtualized device deletion system is provided, comprising:
[0019] A data processing device for connecting to a host machine via a peripheral component interconnect expansion;
[0020] The host machine is used to run one or more virtual machines and provide user-mode paravirtualized data path acceleration for the virtual machines to access the data processing device, wherein the user-mode paravirtualized data path acceleration includes data plane direct communication based on a virtual input and output protocol and control plane negotiation based on a virtual host protocol between the virtual machines and the data processing device;
[0021] The host machine is used to obtain a first user-state paravirtualized device deletion request, wherein the first user-state paravirtualized device deletion request includes a first virtual machine identifier, which is used to delete the first user-state paravirtualized device;
[0022] The host machine is used to determine the first container according to the first virtual machine identifier, and delete the first user-state para-virtualized device in the first group of the first container, wherein the first container also includes a second group, a second user-state para-virtualized device is created in the second group, and the first user-state para-virtualized device and the second user-state para-virtualized device belong to the same virtual machine.
[0023] In some possible designs, the host machine is further used to reduce the value of a first container count, wherein the first container count is used to record the number of user-mode paravirtualized devices of the first virtual machine.
[0024] In some possible designs, the host machine is further used to unmap the input and output virtual addresses from the host physical addresses based on the first group, and when the value of the first container count is not zero, the host virtual address is not unmapped from the host physical address based on the first container.
[0025] In some possible designs, the host machine is used to obtain a second user-state paravirtualized device deletion request, wherein the second user-state paravirtualized device deletion request includes a first virtual machine identifier, and is used to delete the second user-state paravirtualized device;
[0026] The host machine is used to determine the first container according to the first virtual machine identifier, and delete the second user-mode para-virtualized device in the second group of the first container.
[0027] In some possible designs, the host machine is further used to unmap the input and output virtual addresses to the host physical addresses based on the second group, reduce the value of the first container count, and when the value of the first container count is zero, unmap the host virtual addresses to the host physical addresses based on the first container.
[0028] In a third aspect, a computer device is provided, comprising the user-mode paravirtualized device creation system as described in any one of the first aspect, or the user-mode paravirtualized device creation system as described in any one of the second aspect.
[0029] According to a fourth aspect, a computer device cluster is provided, wherein the computer device cluster includes a plurality of computer devices, wherein at least one computer device is the computer device as described in the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.
[0031] Figure 1 It is a structural diagram of a user-mode paravirtualized device creation or deletion system provided by the present application;
[0032] Figure 2 It is a hardware structure diagram of a processor provided by this application;
[0033] Figure 3It is a flowchart of a method for creating a user-mode semi-virtualized device provided by the present application;
[0034] Figure 4 It is a flowchart of a method for deleting a user-mode paravirtualized device provided by the present application;
[0035] Figure 5 It is a structural diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The embodiments of the present invention are described below in conjunction with the accompanying drawings in the embodiments of the present invention. The terms used in the implementation mode of the present invention are only used to explain the specific embodiments of the present invention, and are not intended to limit the present invention.
[0037] See also Figure 1 , Figure 1 This is a schematic diagram of the structure of a user-mode semi-virtualized device creation or deletion system provided by this application. Figure 1 As shown, the user-mode paravirtualized device creation or deletion system of the present application may include a host machine 110 and a data processing device 120 .
[0038] The host machine 110 can be described in detail from two aspects: hardware structure and software structure.
[0039] In terms of hardware structure, the host machine 110 includes a first processor 210 and a memory 220. The first processor 210 is connected to the memory 220 via a double data rate (DDR) bus 230. Here, different memories 220 may use different data buses to communicate with the first processor 210, so the double data rate bus 230 may also be replaced by other types of data buses, and the embodiment of the present application does not limit the bus type.
[0040] The first processor 210 is the computing core and control core of the host machine 110. The first processor 210 may include one or more cores 211. The first processor 210 may be a very large scale integrated circuit. An operating system and other software programs are installed in the first processor 210, so that the first processor 210 can access the memory 220. It is understandable that, in an embodiment of the present invention, the core 211 in the first processor 210 may be, for example, a central processing unit (CPU) or other specific integrated circuits. The first processor 210 may also be other general-purpose processors, 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. Figure 2 Only one first processor 210 is taken as an example. In actual applications, the host machine 110 may also include multiple first processors 210.
[0041] The memory 220 is the main memory of the host machine 110. The memory 220 is usually used to store various running software in the operating system, input and output data, and information exchanged with external memory. In order to improve the access speed of the first processor 210, the memory 220 needs to have the advantage of fast access speed. In the traditional computer system architecture, dynamic random access memory (DRAM) is usually used as the memory 220. The first processor 210 can access the memory 220 at high speed through the memory controller, and perform read and write operations on any storage unit in the memory 220. In addition to the dynamic random access memory, the memory 220 can also be other random access memories, such as static random access memory (SRAM). In addition, the memory 220 can also be a read-only memory (ROM). As for the read-only memory, for example, it can be a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), etc. This embodiment does not limit the number and type of memory 220. In addition, the memory 220 can be configured to have a power-saving function. The power-saving function means that when the system loses power and then powers on again, the data stored in the memory will not be lost. The memory 220 with the power-saving function is called a non-volatile memory.
[0042] In addition, the host machine 110 may also include a baseboard management controller (Baseboard Management Controller, BMC) 240. The baseboard management controller 240 can upgrade the firmware of the device, manage the operating status of the device, and troubleshoot the faults. The first processor 210 can access the baseboard management controller 240 through a PCIe bus or a bus such as USB, I2C, etc. The baseboard management controller 240 can also be connected to at least one sensor. The status data of the computer device is obtained through the sensor, wherein the status data includes: temperature data, current data, voltage data, etc. The type of status data is not specifically limited in this application. The baseboard management controller 240 communicates with the first processor 210 through a peripheral component interconnection extension (Peripheral Component Interconnect Express, PCIe) bus or other types of buses, for example, the acquired status data is passed to the first processor 210 for processing. The baseboard management controller 240 can also control the power circuit or clock circuit in the host machine 110. In short, the baseboard management controller 240 can manage the host machine 110 in the above manner. However, the baseboard management controller 240 is only an optional device. In some implementations, the first processor 210 may communicate directly with the sensor to directly manage and maintain the computer device. Figure 2 Only some components of the processor are exemplified. In practical applications, the components of the processor may include more components, which are not specifically limited here.
[0043] From a software perspective, the host machine 110 may include a simulator 111 , a data plane development kit 112 , and a virtual function input output-peripheral component interconnect (vfio-pci) 113 .
[0044] The simulator 111 may be a Quick EMUlator (QEMU). QEMU may be used as a virtual machine monitor, allowing multiple virtual machines to be run simultaneously on a physical host. These virtual machines may run different operating systems, such as Linux, Windows, etc. QEMU implements isolation and management of virtual machines through virtualization technology, allowing users to implement multiple virtual environments on a single physical host.
[0045] One or more virtual machines (VMs) 115 may run in the simulator 111. A virtual machine 115 is a complete computer system simulated in software, which can simulate a hardware platform and run operating systems and applications on it. A virtual machine enables multiple operating systems to run simultaneously on a physical machine, with each operating system operating in its own virtual machine environment, isolated from each other, but sharing the resources of the physical machine (such as CPU, memory, hard disk space, and I / O devices).
[0046] A virtual input / output driver (virtio driver) 116 may be run in the virtual machine 115. The virtual input / output driver 116 is a driver for communicating with virtual devices in a virtualized environment. In a virtualized environment, a virtual machine (VM) needs to communicate with a virtualized host machine in order to access network, storage, and other devices. In order to achieve such communication, a virtual device and a corresponding device driver are usually required. The virtual input / output driver is a general driver provided for virtual devices, which can establish an efficient communication channel between the virtual machine and the host.
[0047] Data Plane Development Kit 112 is an open source data plane development toolkit designed to help network applications achieve high-performance packet processing on general-purpose processors. It provides a set of optimized user-mode network libraries and drivers that can maximize the performance of modern multi-core processors, thereby achieving high-throughput and low-latency packet processing in areas such as software-defined networking (SDN) and network function virtualization (NFV).
[0048] The paravirtualized data path acceleration driver 117 is a device driver for supporting paravirtualized data path acceleration technology. The role of the paravirtualized data path acceleration driver is to allow virtual machines or containers in a virtualized environment to directly access hardware devices that support paravirtualized data path acceleration technology and utilize the network acceleration functions provided by them. These drivers are usually provided by hardware vendors or open source communities and are compatible with common virtualization platforms (such as KVM, Xen, and VMware). Paravirtualized data path acceleration technology aims to improve network performance in a virtualized environment by transferring the processing tasks of data packets from the software stack in the virtual machine or container to dedicated hardware devices (such as network cards). This technology can reduce the CPU load in a virtualized environment, reduce the latency of packet processing, and improve network throughput.
[0049] The Virtual Function Input Output-Peripheral Component Interconnect 113 is used to implement virtualization of devices and direct allocation to virtual machines for use. It is part of the Virtual Function I / O (VFIO) framework, which allows user space applications to directly control devices, thereby providing lower virtualization overhead and better performance. The Virtual Function Input Output-Peripheral Component Interconnect allows users to assign physical devices (usually PCI devices) directly to virtual machines, which means that the virtual machine can fully access the functions of the device without going through the host operating system. Using the Virtual Function Input Output-Peripheral Component Interconnect, users can tell the VFIO framework which devices to assign to the virtual machine by configuring the corresponding device identifiers. QEMU then maps the device to the address space of the virtual machine so that the virtual machine can directly access the device. This direct access method generally provides better performance and functional support than traditional virtualization methods (such as through virtualized device emulators).
[0050] The data processing device 120 may include a network card (Network Interface Card) and a data processing unit (Data Processing Unit, DPU). Among them, the network card, also known as a network adapter or network interface controller, is a computer hardware device used to connect a computer to a local area network (LAN) or a wide area network (WAN). The network card is responsible for data transmission between the computer and the network, and provides physical connection and data communication functions between the computer and the network. Network cards are usually installed on the motherboard of the host computer, or connected to the computer through an external interface (such as USB, PCIe). They have one or more network interfaces (usually Ethernet ports) for plugging in network cables (such as Ethernet cables). DPU is the abbreviation of data processing unit, which is a dedicated hardware accelerator designed to handle data-intensive tasks in data centers. DPU is usually used with general-purpose processors such as CPUs, GPUs, and FPGAs to accelerate the processing of data center workloads.
[0051] One or more peripheral component interconnect expansion devices 121 may be provided in the data processing device 120. The peripheral component interconnect expansion device 121 is an external device or component connected to the PCIe bus. PCIe is a high-speed serial expansion bus standard used to connect various peripheral devices inside a computer, such as a graphics card, a network card, a storage controller, a sound card, etc. A PCIe device is connected to the host computer 110 via a PCIe slot or a slot integrated in the host computer 110. The peripheral component interconnect expansion device 121 may be a device simulated by the network card data processing device 120.
[0052] Here, the paravirtualized data path acceleration driver 117 and the simulator 111 can communicate through a domain socket of a virtual host-user protocol, for example, a Unix domain socket (Unit Domain Socket, UDS) channel. Among them, the UDS channel is a mechanism for inter-process communication on the same computer. Unlike traditional network sockets, Unix domain sockets do not involve a network protocol stack, but directly create a special type of file in the file system of the operating system, through which processes can communicate. Unix domain sockets usually exist in the file system in the form of a file path, for example, / tmp / my_socket. A process can create, connect, send and receive data by calling system functions, just like operating a network socket. Because there is no overhead involved in the network protocol stack, Unix domain sockets usually have higher performance and lower latency than network sockets.
[0053] The process of creating a user-mode paravirtualized device in the data plane development kit on the host machine can be:
[0054] (1) Loading Virtual Function Input Output Peripheral Component Interconnect. First, you can use the modprobe command to load the Virtual Function Input Output Peripheral Component Interconnect driver. For example, the protocol uses the following command modprobe vfio-pci to load the Virtual Function Input Output Peripheral Component Interconnect.
[0055] (2) Binding the user-state paravirtualized device to the virtual function input / output-peripheral component interconnect: Binding the user-state paravirtualized device to the virtual function input / output-peripheral component interconnect may be achieved by adding the PCI address of the user-state paravirtualized device to the binding list of the virtual function input / output-peripheral component interconnect. The implementation method may include any one of the following:
[0056] (a) Use the echo command to write the PCI address of the user-mode paravirtualized device to the / sys / bus / pci / drivers / vfio-pci / bind file.
[0057] (b) Use the --bind parameter in the dpdk-devbind.py tool to bind the user-mode paravirtualized device to the virtual function IO-PCI.
[0058] (3) Create a container. Once the container runtime configuration is complete, a mapping relationship between the host virtual address (HVA) and the host physical address (HPA) can be created inside the container. Then, DPDK maintains the HVA->HPA page table based on the container.
[0059] (4) Create a container group. After configuring the group in the container, you can map the input and output virtual address (IOVA) to the host physical address (HPA) within the group. Then, DPDK maintains the IOVA->HPA page table based on the group.
[0060] (5) Create user-mode paravirtualized devices. After the container and group are created, you can create user-mode paravirtualized devices in the container and group.
[0061] A virtual machine generally integrates multiple user-mode paravirtualized devices, and each user-mode paravirtualized device uses a container and a group.
[0062] In the case where a virtual machine includes multiple user-mode paravirtualized devices, if the virtual machine is to be hot migrated, the input and output interruption time of the hot migration of the virtual machine mainly occurs in two steps: interruption of the source virtual machine and startup of the destination virtual machine.
[0063] In the source virtual machine interruption step, the most time-consuming steps are the following two steps: unmapping the host virtual address from the host physical address based on the container; unmapping the input and output virtual addresses from the host physical address based on the group.
[0064] In the target virtual machine startup step, the most time-consuming steps are the following two steps: creating a mapping between the host virtual address and the host physical address based on the container; creating a mapping between the input and output virtual addresses and the host physical address based on the group.
[0065] Therefore, when there are multiple user-mode paravirtualized devices in a virtual machine, the output interruption time will be multiplied compared to when there is only one user-mode paravirtualized device in the virtual machine, which will cause the tenants in the virtual machine to clearly perceive the virtual input and output interruption, resulting in a poor customer experience. For example, when there are three user-mode paravirtualized devices in a virtual machine, when the virtual machine is hot migrated, it is necessary to unmap the host virtual address to the host physical address three times based on the container, unmap the input and output virtual address to the host physical address three times based on the group, create the mapping between the host virtual address and the host physical address three times based on the container, and create the mapping between the input and output virtual address and the host physical address three times based on the group.
[0066] See also Figure 3 , Figure 3 Schematic diagram of a method for creating a user-mode semi-virtualized device provided by this application. Figure 3 As shown, the user-mode paravirtualized device creation method of the present application includes:
[0067] S101: The host machine obtains a first user-mode paravirtualized device creation request.
[0068] The first user-state paravirtualized device creation request includes a first virtual machine identifier, which is used to create a first user-state paravirtualized device for the first virtual machine. When the first virtual machine is started, the first virtual machine identifier is recorded in an Extensible Markup Language (xml) file. The virtual machine identifier in each virtual machine is unique. In a specific embodiment, the first virtual machine identifier may be d90f5422-861a-4479-8559-62d8a1545cb0. The first virtual machine identifier may be added to the parameters of the command line interface (CLI) or remote procedure call (RPC) interface of the user-state paravirtualized device driver.
[0069] S102: The host machine determines, according to the first virtual machine identifier, whether there is a first container corresponding to the first virtual machine identifier.
[0070] When the first container exists, the process proceeds to step S103.
[0071] S103: Create a first group in the first container, and create a first user-mode para-virtualized device in the first group.
[0072] Since the first container already exists, it means that the first container also includes at least the second group, a second user-mode paravirtualized device is created in the second group, and the first user-mode paravirtualized device and the second user-mode paravirtualized device belong to the same virtual machine. When creating the first container and the second group, the host performs a mapping between the input and output virtual addresses and the host physical addresses based on the second group, and performs a mapping between the host virtual addresses and the host physical addresses based on the first container, and increases the value of the first container count. The first container count is used to record the number of user-mode paravirtualized devices of the first virtual machine.
[0073] Since the first user-mode paravirtualized device and the second user-mode paravirtualized device belong to the same virtual machine, if the first container already exists, there is no need to create a new container. Instead, it is necessary to create a first group in the first container. The host machine performs mapping between input and output virtual addresses and host physical addresses based on the first group. However, it is not necessary to perform mapping between host virtual addresses and host physical addresses based on the first container. Then, it is necessary to increase the value of the first container count.
[0074] S104: The host machine obtains a second user-mode paravirtualized device creation request.
[0075] The second user-mode para-virtualized device creation request includes a first virtual machine identifier, and is used to create a third user-mode para-virtualized device for the first virtual machine.
[0076] S105: The host machine determines whether there is a first container corresponding to the first virtual machine identifier according to the first virtual machine identifier. If the first container exists, the process proceeds to step S106.
[0077] S106: Create a third group in the first container, and create a third user-mode para-virtualized device in the third group.
[0078] Since the first container already includes the first group and the second group, a first user-mode paravirtualized device is created in the first group, and a second user-mode paravirtualized device is created in the second group. Therefore, if the first container already exists, there is no need to create a new container, and only the third group needs to be created in the first container. The host performs the mapping between the input and output virtual addresses and the host physical addresses based on the third group, but there is no need to perform the mapping between the host virtual addresses and the host physical addresses based on the first container. Then, the value of the first container count needs to be increased.
[0079] S107: The host machine obtains a third user-mode paravirtualized device creation request.
[0080] The third user-mode paravirtualized device creation request includes a second virtual machine identifier, which is used to create a fourth user-mode paravirtualized device. When the second virtual machine is started, the second virtual machine identifier is recorded in an Extensible Markup Language (xml) file. The second virtual machine identifier can be added to the parameters of the CLI or RPC interface of the user-mode paravirtualized device driver.
[0081] S108: The host machine determines whether there is a second container corresponding to the second virtual machine identifier according to the second virtual machine identifier. If there is no second container, the process goes to step S109.
[0082] S109: Create a second container, create a fourth group in the second container, and create a fourth user-mode para-virtualized device in the fourth group.
[0083] Since the second container does not exist before, it is necessary to create the second container and the fourth group. When creating the second container and the fourth group, the host performs a mapping between the input and output virtual addresses and the host physical addresses based on the fourth group, performs a mapping between the host virtual addresses and the host physical addresses based on the second container, and increases the second container count. The second container count is used to record the number of user-mode paravirtualized devices of the second virtual machine.
[0084] See also Figure 4 , Figure 4: is a flowchart of a method for deleting a user-mode semi-virtualized device provided by the present application. Figure 4 As shown, the user-mode paravirtualized device deletion method of the present application includes:
[0085] S201: The host machine obtains a first user-mode para-virtualized device deletion request.
[0086] The first user-mode para-virtualized device deletion request includes a first virtual machine identifier, which is used to delete the first user-mode para-virtualized device.
[0087] S202: The host machine determines the first container according to the first virtual machine identifier, and deletes the first user-mode para-virtualized device in the first group of the first container.
[0088] Since the first container includes the first group and the second group, wherein the first group includes the first user-mode paravirtualized device, and the second group includes the second user-mode paravirtualized device. The first user-mode paravirtualized device and the second user-mode paravirtualized device belong to the same virtual machine. At this time, the host performs a mapping between the input and output virtual addresses and the host physical addresses based on the second group, performs a mapping between the input and output virtual addresses and the host physical addresses based on the second group, and performs a mapping between the host virtual addresses and the host physical addresses based on the first container. The value of the first container count is 2.
[0089] Therefore, when the first user-mode paravirtualized device in the first group of the first container is deleted, the host machine releases the mapping between the input and output virtual addresses and the host physical addresses based on the second group, and subtracts 1 from the value of the first container count, that is, the value of the first container count is 1. Since the value of the first container count is not zero at this time, the mapping between the host virtual address and the host physical address is not released based on the first container.
[0090] S203: The host machine obtains a second user-mode para-virtualized device deletion request.
[0091] The second user-state para-virtualized device deletion request includes a first virtual machine identifier, which is used to delete the second user-state para-virtualized device.
[0092] S204: The host machine determines the first container according to the first virtual machine identifier, and deletes the second user-mode para-virtualized device in the second group of the first container.
[0093] Since the first group and the first user-mode paravirtualized device in the first container have been deleted, the second group and the second user-mode paravirtualized device are still retained in the first container. Therefore, when the second user-mode paravirtualized device in the second group of the first container is deleted, the host machine releases the mapping between the input and output virtual addresses and the host physical addresses based on the second group, and subtracts 1 from the value of the first container count. Since the value of the first container count is zero at this time, the mapping between the host virtual address and the host physical address is released based on the first container.
[0094] In the above scheme, since the user-state paravirtualized device is maintained based on the virtual machine identifier, the same virtual machine is used for the user-state paravirtualized device in a virtual machine, and the host machine only creates one container for the user-state paravirtualized device belonging to the same virtual machine. Therefore, when the virtual machine is hot migrated, when the source virtual machine is stopped, the user-state paravirtualized device in the same container only needs to perform one container-based unmapping between the host virtual address and the host physical address, and when the destination virtual machine is created, the user-state paravirtualized device in the same container only needs to perform one container-based creation of the mapping between the host virtual address and the host physical address, thus greatly reducing the time of input and output interruption. For example, when there are three user-state paravirtualized devices in the virtual machine, when the virtual machine is hot migrated, it is necessary to perform one container-based unmapping between the host virtual address and the host physical address, three group-based unmapping between the input and output virtual addresses and the host physical address, one container-based creation of the mapping between the host virtual address and the host physical address, and three group-based creation of the mapping between the input and output virtual addresses and the host physical address.
[0095] Figure 54 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device 400 includes: one or more second processors 410, a communication interface 420 and a memory 430. The second processor 410, the communication interface 420 and the memory 430 are interconnected via a bus 440. Optionally, the computing device 400 may also include an input / output interface 450, and the input / output interface 450 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 400 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the second processor 410 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 400 can refer to the specific details in the above-mentioned embodiments, such as the second processor 410 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 400 may be used to implement part or all of the functions of one or more components in the above-mentioned device embodiment. In addition, the communication interface 420 may be specifically used to perform the communication functions necessary to implement the functions of these devices and components, and the second processor 410 may be specifically used to perform the processing functions necessary to implement the functions of these devices and components.
[0096] It should be understood that Figure 5 The computing device 400 may include one or more second processors 410, and the multiple second processors 410 may provide processing capabilities in a coordinated manner in a parallel connection manner, a serial connection manner, a serial-parallel connection manner, or any connection manner, or the multiple second processors 410 may constitute a processor sequence or a processor array, or the multiple second processors 410 may be divided into a main processor and an auxiliary processor, or the multiple second processors 410 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 5 The computing device 400 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 400 may include Figure 5 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.
[0097] The second processor 410 may have a variety of specific implementation forms. For example, the second processor 410 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The second processor 410 may also be a single-core processor or a multi-core processor. The second processor 410 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be a dedicated integrated circuit, a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The second processor 410 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 420 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.
[0098] The memory 430 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 430 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 430 may also be used to store program codes and data, so that the second processor 410 calls the program codes stored in the memory 430 to execute part or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 5 Show more or fewer components, or have different component configurations.
[0099] The bus 440 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 440 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 440 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0100] The present application also provides a computing device cluster, which may include multiple computing devices as described above, wherein the computing devices are described in Figure 5 and related descriptions.
[0101] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, which will not be repeated here.
[0102] The present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment can be implemented. The specific implementation of the processor of the computer-readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.
[0103] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.
[0104] 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. Each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks 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 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in 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.
[0105] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiment of the present application can be adjusted in sequence, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A user-mode paravirtualized device creation system, characterized in that: include: A data processing device for connecting to a host machine via a peripheral component interconnect expansion; The host machine is used to run one or more virtual machines and provide user-mode paravirtualized data path acceleration for the virtual machines to access the data processing device, wherein the user-mode paravirtualized data path acceleration includes data plane direct communication based on a virtual input and output protocol and control plane negotiation based on a virtual host protocol between the virtual machines and the data processing device; The host machine is used to obtain a first user-state paravirtualized device creation request, wherein the first user-state paravirtualized device creation request includes a first virtual machine identifier, and is used to create a first user-state paravirtualized device; The host machine is used to determine whether a first container corresponding to the first virtual machine identifier exists according to the first virtual machine identifier, and if the first container exists, create a first group in the first container, and create a first user-state para-virtualized device in the first group, wherein the first container also includes a second group, a second user-state para-virtualized device is created in the second group, and the first user-state para-virtualized device and the second user-state para-virtualized device belong to the same virtual machine.
2. The system according to claim 1, characterized in that The host machine is used to obtain a second user-state paravirtualized device creation request, wherein the second user-state paravirtualized device creation request includes a first virtual machine identifier and is used to create a third user-state paravirtualized device; The host machine is used to determine whether a first container corresponding to the first virtual machine identifier exists according to the first virtual machine identifier, and if the first container exists, create a third group in the first container, and create a third user-mode para-virtualized device in the third group.
3. The system according to claim 2, characterized in that The host machine is further configured to perform mapping between input and output virtual addresses and host physical addresses based on the third group, but not perform mapping between host virtual addresses and host physical addresses based on the first container.
4. The system according to claim 3, characterized in that The host machine is further used to increase a first container count, wherein the first container count is used to record the number of user-mode paravirtualized devices of the first virtual machine.
5. The system according to any one of claims 1 to 4, characterized in that: The host machine is used to obtain a third user state paravirtualized device creation request, wherein the third user state paravirtualized device creation request includes a second virtual machine identifier and is used to create a fourth user state paravirtualized device; The host machine is used to determine whether a second container corresponding to the second virtual machine identifier exists according to the second virtual machine identifier, and if the second container does not exist, create the second container, create a fourth group in the second container, and create a fourth user-mode para-virtualized device in the fourth group.
6. The system according to claim 5, characterized in that The host machine is further configured to perform mapping between input and output virtual addresses and host physical addresses based on the fourth group, and perform mapping between host virtual addresses and host physical addresses based on the second container.
7. A user-mode paravirtualized device deletion system, characterized in that: include: A data processing device for connecting to a host machine via a peripheral component interconnect expansion; The host machine is used to run one or more virtual machines and provide user-mode paravirtualized data path acceleration for the virtual machines to access the data processing device, wherein the user-mode paravirtualized data path acceleration includes data plane direct communication based on a virtual input and output protocol and control plane negotiation based on a virtual host protocol between the virtual machines and the data processing device; The host machine is used to obtain a first user-state paravirtualized device deletion request, wherein the first user-state paravirtualized device deletion request includes a first virtual machine identifier, which is used to delete the first user-state paravirtualized device; The host machine is used to determine a first container according to the first virtual machine identifier, and delete a first user-state para-virtualized device in a first group of the first container, wherein the first container also includes a second group, a second user-state para-virtualized device is created in the second group, and the first user-state para-virtualized device and the second user-state para-virtualized device belong to the same virtual machine.
8. The system according to claim 7, characterized in that The host machine is further used to reduce a value of a first container count, wherein the first container count is used to record the number of user-mode paravirtualized devices of the first virtual machine.
9. The system according to claim 8, characterized in that The host machine is further configured to unmap the input and output virtual addresses from the host physical addresses based on the first group, and not unmap the host virtual addresses from the host physical addresses based on the first container when the value of the first container count is not zero.
10. The system according to claim 9, characterized in that The host machine is used to obtain a second user state paravirtualized device deletion request, wherein the second user state paravirtualized device deletion request includes a first virtual machine identifier, which is used to delete the second user state paravirtualized device; The host machine is used to determine the first container according to the first virtual machine identifier, and delete the second user-mode para-virtualized device in the second group of the first container.
11. The system according to claim 10, characterized in that The host machine is further used to unmap the input and output virtual addresses to the host physical addresses based on the second group, reduce the value of the first container count, and when the value of the first container count is zero, unmap the host virtual addresses to the host physical addresses based on the first container.
12. A computer device, characterized in that: The computer device comprises the user-mode paravirtualized device creation system as claimed in any one of claims 1 to 6, or the user-mode paravirtualized device deletion system as claimed in any one of claims 7 to 11.
13. A computer device cluster, characterized in that: The computer device cluster includes a plurality of computer devices, wherein at least one computer device is the computer device according to claim 12.
