WO2023173961A1 - 一种内存分配方法及相关产品 - Google Patents

一种内存分配方法及相关产品 Download PDF

Info

Publication number
WO2023173961A1
WO2023173961A1 PCT/CN2023/074930 CN2023074930W WO2023173961A1 WO 2023173961 A1 WO2023173961 A1 WO 2023173961A1 CN 2023074930 W CN2023074930 W CN 2023074930W WO 2023173961 A1 WO2023173961 A1 WO 2023173961A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
computing node
vms
computing
memory capacity
Prior art date
Application number
PCT/CN2023/074930
Other languages
English (en)
French (fr)
Inventor
黄朝意
Original Assignee
华为云计算技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为云计算技术有限公司 filed Critical 华为云计算技术有限公司
Publication of WO2023173961A1 publication Critical patent/WO2023173961A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Definitions

  • This application relates to the field of virtualization technology, and in particular, to a memory allocation method and related products.
  • one physical host can be virtualized into multiple virtual machines (VMs). Moreover, in order to ensure that the VM can run normally, the physical host needs to allocate corresponding memory resources to the VM. However, different VMs may have different requirements for memory resources, which may cause memory over-scheduling, causing some VMs to be unable to operate normally because they cannot obtain memory resources.
  • VMs virtual machines
  • This application provides a memory allocation method and related products, which can avoid the situation where the VM on the physical host cannot operate normally due to the inability to obtain memory resources.
  • this application provides a memory allocation method, which method includes: when the first computing node cannot satisfy the memory required by the first VM, migrating one or more second VMs on the first computing node to The second computing node, and allocates memory for the first VM on the first computing node.
  • the first computing node can process the memory resources on the first computing node by using memory overcommitment, and by implementing the above method, even if the first computing node is in the memory overcommitment mode, the first computing node can The VM can still run normally, thus improving the utilization of resources on the first computing node.
  • the above-mentioned first computing node allocates memory for the first VM, including: additionally allocating memory for the first VM on the first computing node.
  • the first VM may be configured to apply for memory only when it needs to use memory during operation, and it will apply for as much memory as it needs to use. Based on the above implementation method, it can be configured as the above type.
  • the first VM allocates memory.
  • the above-mentioned first computing node allocates memory for the first VM, including: when migrating one or more second VMs, delaying the first computing node to increase allocation for the first VM. Memory. It should be understood that migrating VMs takes time. Compared with allocating additional memory to the first VM after the migration of the one or more second VMs is completed, through the above implementation method, the time required for migrating the one or more second VMs can be reduced. The impact brought by the operation of the first VM thus protects the business deployed on the first VM.
  • the above-mentioned first computing node allocating memory for the first VM includes: increasing and allocating the memory capacity requested by the first VM to the first VM on the first computing node.
  • the first computing node if the difference between the available memory capacity on the first computing node and the memory capacity requested by the first VM is less than a threshold, the first computing node cannot meet the needs of the first VM. of memory.
  • the above method further includes: suspending the one or more second VMs. In this way, the migration time of the one or more second VMs can be controlled.
  • the one or more second VMs meet one or more of the following conditions: the total memory capacity occupied by the one or more second VMs is greater than the above threshold, and one or more second VMs are migrated The second VM takes less time than the time it takes to exhaust the available memory capacity on the first compute node. In this way, it can be ensured that the available memory resources on the first computing node are not exhausted, thereby ensuring that the VM on the first computing node can run normally.
  • the above-mentioned second computing node can meet the requirements of the total memory capacity required by the above-mentioned one or more second VMs, wherein the above-mentioned one or more second VMs require
  • the total memory capacity includes the total memory capacity occupied by one or more second VMs mentioned above.
  • the total memory capacity required by the above-mentioned one or more second VMs in the case that all VMs in the above-mentioned one or more second VMs have not applied for memory from the first computing node before migrating to the second computing node. That is, the total memory capacity occupied by the above one or more second VMs.
  • any one or more of the above one or more second VMs also applies for memory from the first computing node before migrating to the second computing node
  • the above one or more In addition to the total memory capacity occupied by the above-mentioned one or more second VMs, the total memory capacity required by each second VM also includes the memory capacity that any one or more of the above-mentioned VMs applied to the first computing node before migrating to the second computing node. Total memory capacity. In this way, the above one or more second VMs can be guaranteed to run normally on the second computing node.
  • the above migration of one or more second VMs on the first computing node to the second computing node includes: converting the target second VM in the one or more second VMs.
  • the migration status information is sent to the second computing node, wherein the migration status information of the target second VM includes a physical address offset of the target second VM, and the target second VM moves to the first computing node before migrating to the second computing node.
  • the requested memory capacity is converting the target second VM in the one or more second VMs.
  • the above method further includes: based on the physical address offset of the target second VM at the second computing node, and the target second VM moves to the first computing node before migrating to the second computing node. Calculate the memory capacity requested by the node and allocate memory for the target second VM. In this way, the second VM can continue to run on the second computing node through the above allocated memory.
  • this application provides a memory allocation method, which method includes: when the first computing node cannot satisfy the memory required by the first VM, suspending the first VM, and then moving the first VM from the first computing node to Migrate to the second computing node, and allocate memory on the first computing node for the second VM on the first computing node.
  • a memory allocation method which method includes: when the first computing node cannot satisfy the memory required by the first VM, suspending the first VM, and then moving the first VM from the first computing node to Migrate to the second computing node, and allocate memory on the first computing node for the second VM on the first computing node.
  • the first computing node if the difference between the available memory capacity on the first computing node and the memory capacity requested by the first VM is less than a threshold, the first computing node cannot meet the needs of the first VM. of memory.
  • the above-mentioned second computing node can meet the requirements of the memory capacity occupied by the first VM and the memory capacity requested by the first VM. In this way, it can be ensured that the first VM can run normally on the second computing node, thereby not affecting the business deployed on the first VM.
  • the above method further includes: allocating memory to the first VM on the second computing node, so that the first VM resumes running on the second computing node.
  • the above-mentioned migration of the first VM from the first computing node to the second computing node includes: sending the migration status information of the first VM to the second computing node, where: The migration status information of a VM includes the memory capacity requested by the first VM and the physical address offset of the first VM.
  • the above-mentioned allocating memory for the first VM on the second computing node includes: based on the memory capacity requested by the first VM and the physical address offset of the first VM on the second computing node. Allocate within the first VM live.
  • this application provides a memory allocation device, which includes a scheduling module and a memory management module.
  • the scheduling module is used to migrate one or more second VMs on the first computing node to the second computing node when the first computing node cannot satisfy the memory required by the first VM;
  • the memory management module is used to migrate one or more second VMs on the first computing node to the second computing node.
  • a computing node allocates memory to the first VM.
  • the memory management module is configured to allocate more memory to the first VM on the first computing node.
  • the memory management module is configured to delay additional allocation of memory for the first VM on the first computing node when migrating one or more second VMs.
  • the memory management module is configured to increase and allocate the memory capacity requested by the first VM to the first VM on the first computing node.
  • the first computing node if the difference between the available memory capacity on the first computing node and the memory capacity requested by the first VM is less than a threshold, the first computing node cannot meet the needs of the first VM. of memory.
  • the above-mentioned device further includes a policy control module, which is configured to suspend the above-mentioned one or more second VMs on the first computing node before migrating them to the second computing node. or multiple second VMs.
  • the one or more second VMs meet one or more of the following conditions: the total memory capacity occupied by the one or more second VMs is greater than the above threshold, and one or more second VMs are migrated The second VM takes less time than the time it takes to exhaust the available memory capacity on the first compute node.
  • the above-mentioned second computing node can meet the requirements of the total memory capacity required by the above-mentioned one or more second VMs, wherein the above-mentioned one or more second VMs require
  • the total memory capacity includes the total memory capacity occupied by one or more second VMs mentioned above.
  • the total memory capacity required by the above-mentioned one or more second VMs in the case that all VMs in the above-mentioned one or more second VMs have not applied for memory from the first computing node before migrating to the second computing node. That is, the total memory capacity occupied by the above one or more second VMs.
  • any one or more of the above one or more second VMs also applies for memory from the first computing node before migrating to the second computing node
  • the above one or more In addition to the total memory capacity occupied by the above-mentioned one or more second VMs, the total memory capacity required by each second VM also includes the memory capacity that any one or more of the above-mentioned VMs applied to the first computing node before migrating to the second computing node. Total memory capacity.
  • the above scheduling module is configured to send the migration status information of the target second VM in one or more second VMs to the second computing node, where the target second VM
  • the migration status information includes the physical address offset of the target second VM and the memory capacity requested by the target second VM from the first computing node before migrating to the second computing node.
  • the above memory management module is also used to offset the physical address of the target second VM on the second computing node, and transfer the target second VM to the second computing node before migrating to the second computing node.
  • the memory capacity requested by the first compute node allocates memory for the target second VM.
  • this application provides a memory allocation device, which includes a policy control module, a scheduling module and a memory management module.
  • the policy control module is used to pause the first VM when the first computing node cannot satisfy the memory required by the first VM;
  • the scheduling module is used to migrate the first VM from the first computing node to the second computing node;
  • memory The management module is configured to allocate memory on the first computing node to the second VM on the first computing node.
  • the first computing node if the difference between the available memory capacity on the first computing node and the memory capacity requested by the first VM is less than a threshold, the first computing node cannot meet the needs of the first VM. of memory.
  • the above-mentioned second computing node can satisfy the memory occupied by the first VM. Capacity and memory capacity requirements requested by the first VM.
  • the above-mentioned memory management module is also used to allocate memory for the first VM on the second computing node, wherein the first VM resumes operation on the second computing node through the above-mentioned allocated memory.
  • the above-mentioned scheduling module is configured to send the migration status information of the first VM to the second computing node, where the migration status information of the first VM includes the memory capacity requested by the first VM. and the physical address offset of the first VM.
  • the memory management module is configured to allocate memory to the first VM on the second computing node based on the memory capacity requested by the first VM and the physical address offset of the first VM.
  • the present application provides a computing system, which includes a memory allocation device, a first computing node, and a second computing node as described in the foregoing third aspect or any implementation manner of the third aspect.
  • the first computing node runs a first VM and one or more second VMs;
  • the memory allocation device is used to migrate the one or more second VMs when the first computing node cannot satisfy the memory required by the first VM.
  • the second VM to the second computing node, and allocate memory to the first VM on the first computing node.
  • the present application provides a computing system, which includes a memory allocation device, a first computing node, and a second computing node as described in the foregoing fourth aspect or any implementation of the fourth aspect.
  • the first VM and the second VM are running on the first computing node; the memory allocation device is used to suspend the first VM when the first computing node cannot satisfy the memory required by the first VM, and then move the first VM from The first computing node is migrated to the second computing node, and memory is allocated to the second VM on the first computing node.
  • the present application provides a computing device system.
  • the computing device system includes a processor and a memory.
  • the memory stores computer program code.
  • the processor executes the computer program code in the memory to implement the foregoing first aspect or the method of the first aspect.
  • the present application provides a computer-readable storage medium that stores computer program code.
  • the computing device executes the aforementioned first aspect or any of the first aspects.
  • the computer-readable storage medium includes but is not limited to volatile memory (such as random access memory), non-volatile memory (such as flash memory, hard disk drive (HDD), solid state drive (SSD)) ).
  • the present application provides a computer program product.
  • the computer program product includes computer program code.
  • the computing device executes the first aspect or any implementation of the first aspect.
  • the computer program product may be a software installation package, which requires the use of the method described in the foregoing first aspect or any implementation of the first aspect, or the use of the foregoing second aspect or any implementation of the second aspect.
  • the computer program product can be downloaded and executed on the computing device.
  • Figure 1 is a schematic structural diagram of a computing system provided by an embodiment of the present application.
  • Figure 2 is a schematic structural diagram of a computing node provided by an embodiment of the present application.
  • Figure 3 is a schematic diagram of an application scenario of a computing system provided by an embodiment of the present application.
  • Figure 4 is a schematic diagram of an application scenario of another computing system provided by an embodiment of the present application.
  • Figure 5 is a schematic flowchart of a memory allocation method provided by an embodiment of the present application.
  • Figure 6 is a schematic structural diagram of a computing node using NUMA architecture provided by an embodiment of the present application.
  • Figure 7 is a schematic diagram of memory allocation provided by an embodiment of the present application.
  • Figure 8 is a schematic structural diagram of a memory allocation device provided by an embodiment of the present application.
  • Figure 9 is a schematic diagram of the deployment of a memory allocation device provided by an embodiment of the present application.
  • Figure 10 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a computing device system provided by an embodiment of the present application.
  • Virtualization technology is an important technical means to effectively manage and fully share physical resources. It can introduce an abstraction layer between computer software and hardware, provide an independent operating environment for upper-layer applications, and can also shield the dynamics of the underlying hardware. and heterogeneity to realize the sharing and reuse of hardware resources. In view of the above advantages, virtualization technology is widely used in fields such as cloud computing and high-performance computing.
  • a physical host can be virtualized into one or more VMs. That is to say, one or more VMs can be run on the physical host (also called a host). To ensure the normal operation of the VM, the physical host needs to allocate corresponding memory resources to the VM.
  • the physical host uses memory virtualization to provide the VM with a continuous memory space starting from scratch, that is, the VM's physical address (guest physical address, GPA) space. This address space is not a real physical address space. , it is just a mapping of the physical host's virtual address (host virtual address, HVA) space in the VM address space.
  • the GPA space is a continuous address space starting from zero, but for a physical host, the GPA space is not necessarily continuous.
  • the GPA space may be mapped to multiple discontinuous HVA spaces on the physical host. Due to the existence of GPA space, the VM's memory access process involves three address translations, namely: VM's virtual address (guest virtual address, GVA) ⁇ GPA ⁇ HVA ⁇ physical address of the physical host (host virtual address, HPA).
  • GVA is the address accessed by the VM
  • HPA is the actual address where programs and data are stored in the physical host
  • the mapping relationship between GVA and GPA is recorded in the VM's page table and maintained by the VM's operating system
  • GPA and HVA The mapping relationship between HVA and HPA is recorded in the shadow page table and maintained by the virtual machine monitor (VMM); the mapping relationship between HVA and HPA is recorded in the page table of the physical host and maintained by the operating system of the physical host.
  • VMM virtual machine monitor
  • memory over-allocation is: the memory capacity allocated to VMs and other processes (such as the Open Virtual Switching Standard (open vswitch, OVS) process) ( Hereinafter referred to as memory capacity) is greater than the memory capacity of the physical host.
  • memory capacity allocated to VM and other processes is the maximum memory capacity that VM and other processes are allowed to occupy. It is also called the memory specification of VM and other processes.
  • the actual memory capacity occupied by VMs and other processes may be less than the memory capacity of the physical host, or may be greater than or equal to the memory capacity of the physical host.
  • the memory capacity actually occupied by the VM and other processes is greater than or equal to the memory capacity of the physical host, it means that the memory on the physical host has been used up by the VM and other processes. At this time, the available memory capacity on the physical host is zero. In this case, if a VM or process applies for memory resources from the physical host, the VM or process will enter a soft lockup state because it cannot obtain the memory resources, which will affect the business running on the above-mentioned VM or process.
  • this application provides a memory allocation device.
  • the above memory allocation device will be described below in conjunction with the computing system shown in Figure 1 .
  • FIG. 1 is a schematic structural diagram of a computing system provided by an embodiment of the present application. As shown in FIG. 1 , the computing system 100 includes a memory allocation device 200 and multiple computing nodes 300 .
  • Memory allocation device 200 used to allocate memory resources to VM 310 on multiple computing nodes 300, and when the memory resources available on the computing node 300 cannot meet the memory required by the VM due to memory overload, memory allocation The device 200 is also used to migrate one or some VMs in the computing node 300 to other computing nodes, and then release the memory resources occupied by the migrated VMs to increase the memory resources available on the computing node 300. In this way, it can not only avoid the situation where the VM 310 is locked due to the inability to obtain memory resources, but also improve the utilization of resources on the computing node 300 (including memory resources, computing resources, etc.).
  • Computing node 300 It can be a computing device (such as a server, a physical host) on a public cloud, a private cloud, or a hybrid cloud, or it can be a terminal computing device (such as a terminal server, a laptop, a personal desktop computer, a smart camera, etc.).
  • Figure 2 exemplarily shows a schematic structural diagram of a computing node 300.
  • the computing node 300 in addition to at least one VM 310, the computing node 300 also includes hardware 320 and a host operating system (host operating system, host OS) 330.
  • a guest operating system (guest operating system, guest OS) 311 is installed on the VM 310, and an application program 312 is run on the guest operating system 311.
  • the VM 310 also includes a variety of hardware resources provided by the hardware 320, such as , virtual processor (such as virtual central processing unit (vCPU)) 313, virtual memory 314, virtual network card 315, etc.
  • Hardware 320 includes memory 321 (such as random access memory (RAM), hard disk), processor 322 (such as central processing unit (CPU)) and communication interface 323 (such as physical network card).
  • Host operation A virtual machine monitoring device 331 (such as VMM, hypervisor) is deployed in the system 330.
  • the host operating system 330 is used to allocate various hardware resources provided by the hardware 320 to the VM 310, and implement scheduling, isolation and management of the VM 310.
  • FIG. 2 only shows an exemplary structure of the computing node 300.
  • the computing node 300 may also have other structures.
  • the virtual machine monitoring device 331 may also be deployed on the host operating system 330.
  • the computing node 300 may also include other components (such as a bus), which is not limited in this embodiment of the present application.
  • the computing node 300 mentioned above can be a computing device on a public cloud, a private cloud or a hybrid cloud, or it can also be a terminal computing device. Therefore, the computing system 100 is suitable for a variety of scenarios. The application scenarios of the computing system 100 are described below with reference to Figures 3-4.
  • Example scenario 1 The computing system 100 is provided to tenants by a cloud service provider in the form of cloud services (ie, computing services).
  • cloud services ie, computing services
  • the computing system 100 is deployed in a cloud environment, where the cloud environment is an entity that uses basic resources to provide cloud services to tenants under the cloud computing model.
  • the cloud environment includes a cloud data center and a cloud service platform, and the cloud data center includes a cloud data center owned by a cloud service provider.
  • a large number of basic resources including computing resources, storage resources and network resources
  • the computing resources included in the cloud data center can be a large number of computing devices (such as servers, physical hosts). Then, the computing system 100 can be deployed in a flexible manner in the cloud environment.
  • the memory allocation device 200 in the computing system 100 is deployed on at least one computing device or at least one virtual machine on the cloud data center, and the plurality of computing nodes 300 are respectively Multiple computing devices on the cloud data center; for another example, the memory allocation device 200 in the computing system 100 is distributedly deployed on multiple computing devices and virtual machines on the cloud data center, and the multiple computing nodes 300 are respectively cloud data Multiple computing devices on the center.
  • the computing system 100 is abstracted by the cloud service provider into a computing service on the cloud service platform and provided to the tenant.
  • the cloud environment uses the computing system 100 deployed in the cloud data center to provide computing services to tenants.
  • the tenant deploys the business on multiple computing nodes 300 in the computing system 100 in the form of VM 310.
  • the VM 310 uses hardware resources (including computing resources, memory resources and network resources) on the computing nodes 300 to execute the tenant's business.
  • the memory resources in the computing node 300 are allocated by the memory allocation device 200 to the VM 310 on the computing node 300 as needed.
  • the computing node 300 can be over-allocated, but also the computing node 300 can be guaranteed to be over-allocated.
  • the business of the VM 310 on the computer is not affected, thereby improving the utilization of resources in the computing node 300 and providing tenants with higher quality services.
  • Example scenario 2 The memory allocation device 200 in the computing system 100 is provided by the cloud service provider to the tenant in the form of a cloud service (ie, memory allocation service).
  • a cloud service ie, memory allocation service
  • the memory allocation device 200 in the computing system 100 is deployed on one computing device or one VM on the cloud data center, or is deployed in a distributed manner on multiple computing devices or multiple VMs on the cloud data center, or in a distributed manner. Deployed on multiple computing devices and VMs on cloud data centers.
  • the multiple computing nodes 300 in the computing system 100 may be multiple computing devices on a cloud data center, or multiple computing devices in an edge environment, or multiple terminal computing devices, or may be multiple computing devices in different environments.
  • Computing devices for example, some computing nodes 300 are computing devices on cloud data centers, some computing nodes 300 are edge computing devices on edge environments, and some computing nodes 300 are terminal computing devices.
  • the edge environment includes a collection of edge computing devices that are close to the terminal computing device.
  • the edge computing devices include edge servers, edge stations with computing power, etc.
  • the memory allocation device 200 in the computing system 100 is abstracted by the cloud service provider into a memory allocation service on the cloud service platform and provided to the tenant.
  • the cloud environment uses the memory allocation device 200 deployed in the cloud data center to provide memory allocation services to multiple computing nodes 300.
  • the memory allocation device 200 on the multiple computing nodes 300 Memory resources can be fully utilized.
  • Example scenario 3 The functions of the memory allocation device 200 in the computing system 100 can be implemented by software devices, hardware devices, or a combination of software devices and hardware devices. Therefore, the memory allocation device 200 can be an edge.
  • the computing device or terminal computing device may also be a software device running on the above-mentioned edge computing device or terminal computing device. It may also be deployed in a distributed manner on multiple edge computing devices or multiple terminal computing devices, or in a distributed manner. Deployed on edge computing devices and terminal computing devices.
  • the multiple computing nodes 300 in the computing system 100 may be computing devices in any one or more environments of a cloud environment, an edge environment, and a terminal computing device.
  • the embodiments of the present application do not restrict the specific environment in which each part of the computing system 100 is deployed.
  • the actual application format may be based on the resource occupancy of the cloud environment and edge environment, the computing capabilities of the terminal computing device, or specific application requirements. Make adaptive deployments.
  • the memory allocation device 200 will be further described below in conjunction with the memory allocation method described in FIG. 5 . It should be noted that, for simplicity, the following description will take the memory allocation device 200 allocating memory resources to the first computing node among the plurality of computing nodes 300 as an example.
  • the memory allocation device 200 determines whether the first computing node can satisfy the memory required by the first VM. If the first computing node can satisfy the memory required by the first VM, then execute S102. If the first computing node cannot satisfy the memory required by the first VM, S102 will be executed. To determine the memory required by a VM, perform S103-S108.
  • the first VM is a VM running on the first computing node.
  • the first VM sends a memory application request to the memory allocation device 200, or the memory allocation device 200 automatically allocates memory to the first VM regularly or at a preset time. Any of the above conditions can trigger the memory allocation device 200 to execute S101.
  • the memory allocation device 200 determines whether the first computing node can meet the memory required by the first VM, including: the memory allocation device 200 determines the difference between the available memory capacity on the first computing node and the first memory capacity. Whether the value is less than the first threshold. If the difference between the available memory capacity on the first computing node and the first memory capacity is less than the first threshold, it is determined that the first computing node cannot satisfy the memory required by the first VM; if the available memory capacity on the first computing node If the difference from the first memory capacity is greater than or equal to the first threshold, it is determined that the first computing node can meet the memory required by the first VM.
  • the available memory capacity, the first memory capacity and the first threshold on the first computing node are described respectively below.
  • the available memory capacity on the first computing node refers to the memory capacity available on the first computing node.
  • the memory allocation device 200 has the function of monitoring the available memory capacity on the first computing node, so the memory allocation device 200 can obtain the available memory capacity on the first computing node.
  • the first computing node sends the local available memory capacity to the memory allocation device 200. In this way, the memory allocation device 200 can also obtain the second memory allocation request.
  • the amount of memory available on a compute node is not limited to the amount of memory available on a compute node.
  • the first memory capacity may be the memory capacity requested by the first VM.
  • the above memory application request includes the first memory capacity
  • the first memory capacity may be the memory allocation device 200 automatically allocates memory to the first VM.
  • the amount of memory pre-allocated to the first VM Considering that memory allocation is usually performed in units of pages (including huge pages and small pages), the first memory capacity can be a large page memory capacity or a small page memory capacity. Among them, large pages refer to large memory pages.
  • each page frame can be 2 megabytes (MB) or 1 gigabyte (GB). Small pages are also called standard memory pages. The size of each page frame is 4 kilobytes (KB). Compared with small pages, using large pages can improve memory access efficiency.
  • the first threshold may be preset by the user, or may be adaptively adjusted by the memory allocation device 200 based on the memory capacity of the first computing node, the number of VMs on the first computing node, or specific application requirements.
  • the memory allocation device 200 allocates memory for the first VM on the first computing node.
  • the memory allocation device 200 selects a portion of the available memory on the first computing node and allocates it to the first VM based on the first memory capacity, so as to facilitate the operation of the first VM.
  • the memory allocation device 200 allocates memory for the first VM on the first computing node, including: the memory allocation device 200 allocates additional memory for the first VM on the first computing node. It should be understood that when the first VM is running, memory will be applied for only when memory is needed, and as much memory will be applied for as much memory is needed. Therefore, "the memory allocation device 200 allocates additional memory to the first VM on the first computing node" can be understood as: allocating a part of the memory to the first VM on the basis of the memory already occupied by the first VM.
  • the memory allocation device 200 allocates all the required memory to the first VM. Therefore, the memory allocated by the memory allocation device 200 to the first VM on the first computing node may also be all the memory required for the first VM to run.
  • the memory allocation device 200 determines one or more target VMs on the first computing node.
  • the one or more target VMs may or may not include the first VM.
  • the one or more target VMs in this case will be referred to as one or more second VMs below.
  • the one or more second VMs meet one or more of the following conditions: the total memory capacity occupied by the one or more second VMs is greater than the first threshold, and the time taken to migrate the one or more second VMs is less than the exhaustion time. The time it takes to calculate the available memory capacity on a node. It should be noted that the total memory capacity occupied by the one or more second VMs refers to the sum of the memory capacity actually occupied by the one or more second VMs at the current moment.
  • the memory allocation device 200 determines one or more target VMs on the first computing node, including: the memory allocation device 200 determines one or more target VMs from the VMs running on the first computing node based on the first policy. Second VM.
  • the first strategy includes at least one of the following conditions: 1 The total memory capacity occupied by one or more second VMs is greater than that of the first Threshold; 2 The time taken to migrate one or more second VMs is less than a second threshold, where the second threshold is a value less than or equal to the above-mentioned time taken to exhaust the available memory capacity on the first computing node, and the second threshold can be It is preset by the user, or it can be obtained by adaptive adjustment of the memory allocation device 200 according to the actual situation; 3 When there are at least two results (each result includes one or more second VMs) satisfying conditions 1 and 2 , choose the one that takes less time to migrate, for example, determine the number of read and write accesses of all VMs in each result, and select the one with the smallest number of read and write accesses; 4 When there are at least two results that meet conditions 1 and 2, select Occupy The total memory capacity is larger.
  • S104 The memory allocation device 200 suspends the operation of the one or more target VMs.
  • the memory allocation device 200 sends a command to suspend the one or more target VMs to the first computing node 300.
  • the first computing node 300 After receiving the above command, the first computing node 300 performs a suspension operation (such as suspend) on the one or more target VMs. instruction) to halt one or more running target VMs.
  • the memory allocation device 200 can be allowed to control the migration time of the one or more target VMs.
  • the VM is paused, the actual memory capacity occupied by it will not change. Therefore, the above operations can also ensure that after the migration operation is completed (i.e., S106 and S107), the available memory capacity on the first computing node is greater than the first threshold. .
  • the memory allocation device 200 determines the second computing node.
  • the second computing node satisfies the following conditions: the second computing node and the first computing node are not the same computing node, and the second computing node can meet the total memory capacity requirements of the one or more target VMs. It should be noted that the total memory capacity required by the one or more target VMs includes the total memory capacity occupied by the one or more target VMs.
  • any one or more of the above one or more target VMs apply for memory from the first computing node, such as the first VM, before migrating to the second computing node.
  • the memory capacity required by each of the above-mentioned any one or more target VMs includes the memory capacity occupied by the VM (that is, the memory capacity actually occupied by the VM at the current moment), and the memory capacity that the VM is migrating.
  • the total memory capacity required by the above-mentioned one or more target VMs includes, in addition to the total memory capacity occupied by the above-mentioned one or more target VMs, the total memory capacity required by the above-mentioned one or more target VMs before migrating to the second computing node.
  • the total memory capacity requested by a computing node includes the memory capacity occupied by the VM (that is, the memory capacity actually occupied by the VM at the current moment), and the memory capacity that the VM is migrating.
  • the total memory capacity required by the one or more target VMs includes the memory capacity occupied by the first VM and the first VM.
  • the memory capacity that the VM is requesting i.e. the first memory capacity).
  • the above one or more target VMs may not include the first VM, in this case, if all VMs in the above one or more target VMs are migrated to the second computing node, have not applied for memory from the first computing node, then the total memory capacity required by the above one or more target VMs is the total memory capacity occupied by the above one or more second VMs; if the above one or more target VMs If any one or more VMs apply for memory from the first computing node before migrating to the second computing node, then the total memory capacity required by the one or more target VMs includes the total memory occupied by the one or more second VMs. capacity, and the total memory capacity requested by any one or more of the above VMs from the first computing node before migrating to the second computing node.
  • the memory allocation device 200 determines the second computing node, including: the memory allocation device 200 determines the second computing node from the plurality of computing nodes 300 based on the second policy.
  • the second strategy includes at least one of the following conditions: 1 It is not the first computing node; 2
  • the difference between the available memory capacity on the second computing node and the total memory capacity required by the one or more target VMs is greater than the third threshold, Similar to the above-mentioned first threshold, the third threshold may be preset by the user, or the memory allocation device 200 may adapt according to the memory capacity of the second computing node, the number of VMs on the second computing node, or specific application requirements.
  • the adjusted third threshold is used to help the memory allocation device 200 determine whether the memory resources available on the second computing node are sufficient after migrating the one or more target VMs to the second computing node; 3 When there are at least two second computing nodes When the computing node meets conditions 1 and 2, select the one with larger available memory capacity; 4 When there are at least two When the second computing node meets condition 1 and condition 2, the one with the slowest change in available memory capacity is selected. Among them, the condition that the available memory capacity changes the slowest can ensure that the memory resources available on the second computing node are sufficient during the period when the VM is migrated to the second computing node and resumes operation on the second computing node. That is to say, the Migrating one or more of the above target VMs to the second computing node will not affect the operation of other VMs or applications on the computing node.
  • S105 may be executed after S104, or may be executed simultaneously with S104, which is not limited by the embodiments of this application.
  • the memory allocation device 200 migrates the one or more target VMs from the first computing node to the second computing node.
  • the memory allocation device 200 sends a migration instruction to the first computing node, where the migration instruction is used to instruct the first computing node to migrate the one or more target VMs to the second computing node.
  • the first computing node After receiving the migration instruction, the first computing node sends the migration status information of the one or more target VMs to the second computing node, thereby completing the migration of the first or multiple target VMs.
  • the migration status information of one or more target VMs includes configuration information of each target VM (such as operating system), device information of each target VM (such as memory specifications), and memory of each target VM (such as target VM Initial memory, memory change fragmentation).
  • any one or more target VMs among the one or more target VMs may have applied for memory from the first computing node before migrating to the second computing node.
  • the migration status information of each of the above-mentioned any one or more target VMs also includes the GPA offset of the VM, and the memory capacity requested from the first computing node before the VM is migrated to the second computing node.
  • the GPA space of the VM is a continuous address space starting from zero. Therefore, the base address of the GPA space of each of the above-mentioned any one or more target VMs is zero. Then, the above The GPA of each target VM in any one or more target VMs remains unchanged before and after migration, and the GPA offset of each target VM in any one or more target VMs above remains unchanged before and after migration. constant.
  • the second computing node after the second computing node receives the migration status information of one or more target VMs, in order to ensure that the services deployed on these target VMs are not affected, it needs to resume on the second computing node. ) of these target VMs. Taking one of these target VMs as an example, the process of restoring operation is described:
  • the target VM resumes operation through the following steps: the memory allocation device 200 is based on the migration status of the target VM on the second computing node.
  • the memory information in the information (such as the target VM's initial memory and memory change fragmentation) allocates memory for the target VM. Afterwards, the target VM resumes operation on the second computing node with the above allocated memory.
  • the target VM resumes operation through any of the following methods. Any of the following methods is applicable to the first VM, or Before migrating to the second computing node, apply for the second VM of memory from the first computing node.
  • Method 1 The migration status information of the target VM does not include the GPA offset of the target VM and the memory capacity that the target VM applied to the first computing node before migrating to the second computing node. Then, the memory allocation device 200 allocates memory to the target VM on the second computing node based on the memory information (such as the target VM's initial memory and memory change fragmentation) in the target VM migration status information. This part of the memory is the target VM when it migrates to the second computing node. The portion of memory on the first computing node actually occupied by the second computing node, that is, the portion of memory corresponding to the memory capacity actually occupied by the target VM. At this time, the target VM resumes the running state before the suspension on the second computing node.
  • the memory information such as the target VM's initial memory and memory change fragmentation
  • the running state before the suspension includes requesting memory from the first computing node. Then, the memory allocation device 200 allocates the memory capacity requested by the VM from the first computing node to the target VM on the second computing node before migrating to the second computing node. Afterwards, the target VM can resume running on the second computing node with the above allocated memory.
  • the migration status information of the target VM includes the GPA offset of the target VM and the migration status of the target VM.
  • the memory allocation device 200 allocates the memory that the target VM wants to apply for on the second computing node, that is, it applies to the first computing node before migrating to the second computing node, but the first The memory that is not allocated by the computing node to the target VM is allocated to the target VM by the second computing node after being migrated to the second computing node.
  • the memory capacity occupied by the target VM that is, the memory capacity occupied by the first computing node before migrating to the second computing node, please refer to the relevant description of Method 1. After that, the target VM can resume running on the second computing node through the above allocated memory.
  • the target VM obtains the GPA offset of the target VM and the memory capacity requested by the target VM from the first computing node before migrating to the second computing node based on the migration status information of the target VM, and then obtains the GPA offset of the target VM and The requested memory capacity sends a memory application request to the memory allocation device 200 .
  • the memory allocation device 200 allocates the memory requested by the VM to the target VM on the second computing node.
  • a trigger condition is set in the target VM, and the trigger condition is that when the target VM reads one or more bytes in the memory space indicated by the second computing node HVA, the target VM allocates the memory to the memory allocation device 200 Send a memory application request. Then, the target VM sends a memory application request to the memory allocation device 200 based on the GPA offset of the target VM and the memory capacity requested by the target VM from the first computing node before migrating to the second computing node, including: the target VM is based on the GPA of the target VM. Obtain the HVA of the second computing node through the offset, and then read one or more bytes from the memory space indicated by the HVA. In this way, the target VM is triggered to send a memory application request to the memory allocation device 200 .
  • the process of the memory allocation device 200 allocating memory for the target VM on the second computing node in the above-mentioned methods 1 and 2 is similar to the process of the memory allocation device 200 allocating memory for the first VM on the first computing node.
  • the second computing node can meet the memory required by the target VM (that is, the memory capacity occupied by the target VM). This shows that the available memory resources on the second computing node are sufficient.
  • memory allocation The specific process of the device 200 allocating memory for the target VM on the second computing node may refer to the above-mentioned S102.
  • the memory allocation device 200 releases the memory on the first computing node occupied by the one or more target VMs.
  • the memory allocation device 200 can increase the available memory capacity on the first computing node by releasing the memory occupied by these VMs.
  • the memory allocation device 200 allocates memory to the first VM.
  • the memory allocation device 200 allocates memory to the first VM. 200 Allocate memory to the first VM on the second computing node. For the specific process, please refer to the process of resuming operation of the target VM in S106 above.
  • the memory allocation apparatus 200 may utilize the remaining available memory on the first computing node. Memory resources, allocate memory on the first computing node to other VMs running on it. In addition, when the first VM migrates to the second computing node and the memory allocation device 200 releases the memory on the first computing node occupied by the first VM, the memory allocation device 200 may also allocate this part of the released memory. to other VMs on the first compute node.
  • the memory allocation device 200 allocating memory for the first VM means that the memory allocation device 200 allocates memory for the first VM on the first computing node.
  • the memory allocation device 200 allocates memory for the first VM on the first computing node, including: the memory allocation device 200 allocates additional memory for the first VM on the first computing node. In other embodiments, the memory allocation device 200 allocates memory for the first VM on the first computing node, including: the memory allocation device 200 allocates memory on the first computing node. The first computing node allocates to the first VM all memory required for the first VM to run.
  • the memory allocation device 200 allocates additional memory for the first VM on the first computing node, including: the memory allocation device 200 allocates memory for the first VM on the first computing node. Increase the allocated memory capacity requested by the first VM.
  • the memory allocation device 200 allocates memory to the first VM on the first computing node, including: when migrating the one or more second VMs, the memory allocation device 200 delays allocating memory to the first VM on the first computing node. That is, the relevant steps of migrating the one or more second VMs (S103-S107) are executed in parallel with the relevant steps of allocating memory to the first VM.
  • the following is a detailed description of how the memory allocation device 200 delays increasing allocation of memory for the first VM on the first computing node:
  • the memory allocation device 200 can select a part of the memory resource Q to allocate to the first VM.
  • the memory allocation device 200 may continue to send memory application requests to the memory allocation device 200, or other VMs in the first computing node may continue to send memory application requests to the memory allocation device 200.
  • the memory allocation device 200 sends a memory application request.
  • the memory allocation device 200 may need to delay allocating memory to the VMs (including the first VM) that send the r memory application requests. Therefore, optionally, the memory allocation device 200 also performs the following steps:
  • S109 The memory allocation device 200 determines whether it is in a speed-limited state. If the memory allocation device 200 is in the speed-limiting state, S110-S111 is executed. If the memory allocation device 200 is not in the speed-limiting state, it is first set to the speed-limiting state, and then S110-S111 is executed.
  • the memory allocation device 200 when the memory allocation device 200 is in the speed limiting state, the memory allocation device 200 will delay allocating memory on the first computing node to the VM on the first computing node; when the memory allocation device 200 is not in the speed limiting state, the memory allocation device 200 will delay allocating memory to the VM on the first computing node.
  • the apparatus 200 does not delay allocating memory at the first computing node to the VM on the first computing node.
  • the prerequisite for the memory allocation device 200 to be in the speed limiting state is that the memory resources available on the first computing node cannot meet the memory requirements of the VM. Therefore, the memory resources available on the first computing node can meet the memory requirements of the VM.
  • the memory allocation device 200 does not need to be in a speed-limited state. That is to say, when the memory allocation device 200 is executing S101, if it is determined that the first computing node can meet the memory required by the first VM, then the memory allocation device 200 Before executing S102, a step of clearing the speed limit status is also executed. In this way, the memory allocation device 200 will not delay allocating memory for the first VM on the first computing node.
  • the memory allocation device 200 calculates the delay time based on the second threshold.
  • the memory allocation device 200 determines the target memory capacity, and then calculates the second threshold based on the network conditions of the computing system 100 (including the bandwidth during communication between computing nodes 300) and the target memory capacity, and then calculates the second threshold based on the target memory capacity and the second threshold. Calculate the delay time.
  • the memory allocation device 200 may not have determined the above one when calculating the delay time. or multiple second VMs. Therefore, the target memory capacity may be the total memory capacity of the one or more second VMs, or may not be the total memory capacity of the one or more second VMs.
  • the memory allocation device 200 may determine the target memory capacity in the following manner. Target memory capacity: Determine the target memory capacity based on the first threshold. For example, the target memory capacity can be any of the memory capacities actually occupied by the VM that is greater than the first threshold, or all the memory capacities that are greater than the first threshold that are actually occupied by the VM. Average memory capacity.
  • the memory capacity of memory resource Q is N
  • the memory capacities applied for by the above r memory application requests are M 1 , M 2 ,..., M r respectively, where M 1 +M 2 +...+M r ⁇ N
  • the target memory capacity is V
  • the second threshold is T 1
  • the delay time is D.
  • the time spent migrating memory resource Q T 2 (N/V)*T 1
  • the delay time corresponding to each memory application request satisfies one or more of the following conditions: D ⁇ T 1 /r, and D ⁇ T 2 /r.
  • the above delay time can also satisfy the following conditions: D ⁇ (H/V)*T 1 /r, where H represents the first threshold.
  • the above derivation process of the delay time is described by taking the VM on the first computing node by sending a memory application request to the memory allocation device 200 as an example. It should be understood that in actual applications, the memory allocation device 200 When memory is allocated to the VM on the first computing node regularly or at a preset time, the derivation process of the delay time is similar to the above process, and will not be described again here for simplicity.
  • the memory allocation device 200 allocates memory to the first VM on the first computing node after the delay time is reached.
  • the memory allocation device 200 selects a portion of the available memory on the first computing node and allocates it to the first VM based on the first memory capacity. Similarly, for other VMs that also apply for memory from the first computing node before the migration of one or more second VMs is completed, the memory allocation device 200 also allocates corresponding memory to these VMs after reaching the corresponding delay time. In this way, it can be ensured that there are still available memory resources on the first computing node before the migration of the one or more second VMs is completed.
  • the one or more second VMs are released After the memory is occupied, the available memory capacity on the first computing node will be greater than the first threshold, thereby ensuring that there is always memory allocated to the VM on the first computing node.
  • the NUMA architecture is an architecture commonly used by computing nodes in cloud computing mode.
  • the characteristic of this architecture is the related hardware resources in the system. (such as CPU, memory) are divided into multiple nodes, thereby enabling high-performance computing.
  • Figure 6 shows a schematic structural diagram of a computing node using a NUMA architecture.
  • the node can be any one of multiple computing nodes 300.
  • the computing node 400 includes multiple NUMA nodes 410.
  • Each NUMA node The node 410 includes a processor 411 and a memory 412, and one or more VMs can run on each NUMA node 410.
  • the NUMA node is used as the unit of memory capacity for memory allocation during operation.
  • the VM running on the NUMA node allocates memory resources by the local NUMA node, so Memory resources on a NUMA node can also be allocated to VMs running on that node based on the above memory allocation method.
  • VM 1 , VM 2 , VM 3 and VM 4 are running on the NUMA node 410.
  • VM 1 sends a memory application request to the memory allocation device 200.
  • the allocation device 200 determines that the difference between the available memory capacity on the current NUMA node 410 and the memory capacity requested by VM 1 is greater than the threshold.
  • the threshold here has a similar function to the above-mentioned first threshold. Therefore, The memory allocation device 200 directly allocates memory to VM 1 .
  • VM 2 sends a memory application request to the memory allocation device 200.
  • the memory allocation device 200 After receiving the request sent by VM 2 , the memory allocation device 200 determines that the difference between the available memory capacity on the current NUMA node 410 and the memory capacity requested by VM 2 is less than the threshold. , at this time, the memory allocation device 200 performs related steps of migrating the VM, for example, determining that the migrated VM is VM 4 . At the same time, the memory allocation device 200 delays allocating memory to VM 2 .
  • Migration process in VM 4 After receiving the memory application requests sent by VM 3 , VM 1 , and VM 2 in sequence, the memory allocation device 200 continues to use the memory resources available on the NUMA node 410 to VM 3 , VM 1 , and VM 2 in sequence. VM 2 allocates memory. Afterwards, the migration of VM 4 is completed, and after the memory occupied by VM 4 is released, the memory resources available on NUMA node 410 return to a state greater than the threshold.
  • the function of the memory allocation device 200 is described in detail with reference to FIGS. 5 to 7 .
  • the memory allocation device 200 is described in detail from the structural aspect of the memory allocation device 200 with reference to FIGS. 8 to 11 .
  • the memory allocation device 200 can be logically divided into multiple parts, each part has different functions, and each part can be a software module, a hardware module, or a combination of software modules and hardware modules.
  • Figure 8 exemplarily shows a schematic structural diagram of the memory allocation device 200.
  • the memory allocation device 200 includes a memory management module 210, a policy control module 220 and a scheduling module 230.
  • the memory management module 210, the policy control module 220 and the scheduling module 230 work together to implement the above method embodiments. Steps performed by the memory allocation device 200.
  • the memory management module 210 is used to perform the relevant steps of determining whether the first computing node can meet the memory required by the first VM in S101, as well as the above S102, S107-S108; the policy control module 220 is used to perform the above S103- S104, and the related steps of setting the memory allocation device 200 to the speed-limited state in S109; the scheduling module 230 is used to perform the above-mentioned S105-S106, determine whether the memory allocation device 200 is in the speed-limited state in S109, and S110-S111.
  • the memory management module 210 is also used to migrate the one or more second VMs to the second computing node. After the second computing node, the related steps of allocating memory to the second VM on the second computing node.
  • FIG. 8 is only an exemplary structural division method for dividing the memory allocation device 200 according to functions. This application does not limit the specific division method of the structure of the memory allocation device 200 .
  • the memory allocation device 200 since the memory allocation device 200 is logically divided into multiple parts, its deployment is flexible and can be deployed individually on one computing device or distributed on multiple computing devices.
  • the memory management module 210 and the policy control module 220 in the memory allocation device 200 are deployed on the first computing node and the second computing node respectively, and the scheduling module 230 in the memory allocation device 200 deploys other computing nodes.
  • the computing system 100 includes a management node.
  • the management node and each computing node 300 can communicate with each other to manage each computing node 300.
  • the scheduling module 230 can be deployed on the management node. It should be understood that the embodiment of the present application does not restrictively divide which parts of the memory allocation device 200 are specifically deployed on which computing device, and the actual application format can be adaptively deployed according to specific application requirements.
  • the computing device may be the computing device 500 shown in FIG. 10 .
  • the computing device 500 includes a memory 510 , a processor 520 , a communication interface 530 , and a bus 540 .
  • the memory 510 , the processor 520 , and the communication interface 530 realize communication connections with each other through the bus 540 .
  • the memory 510 may include read only memory (ROM), static storage device, dynamic storage device, random access memory (random access memory, RAM), etc.
  • the memory 510 may store program codes, such as computer program codes in the memory management module 210, computer program codes in the policy control module 220, computer program codes in the scheduling module 230, and the like.
  • the processor 520 and the communication interface 530 are used to execute part or all of the methods executed by the memory allocation device 200 (including the above-mentioned S101-S111).
  • the memory 510 may also store data, and the data stored by the memory 510 includes intermediate data or result data generated by the processor 520 during execution, such as first memory capacity, delay time, etc.
  • the processor 520 can be a CPU, an application specific integrated circuit (ASIC), Graphics processing unit (GPU) or one or more integrated circuits.
  • ASIC application specific integrated circuit
  • GPU Graphics processing unit
  • the processor 520 may also be an integrated circuit chip with signal processing capabilities. During the implementation process, part of the functions of the memory allocation device 200 may be completed by instructions in the form of hardware integrated logic circuits or software in the processor 520 .
  • the processor 520 can also be a general-purpose processor, a digital signal process (DSP), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, Discrete hardware components can implement or execute the methods, steps and logical block diagrams disclosed in the embodiments of this application.
  • the processor 520 can also be any conventional processor, and the method disclosed in this application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor can be used for execution.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory 510.
  • the processor 520 reads the information in the memory 510 and completes part or all of the functions of the memory allocation device 200 in combination with its hardware.
  • the communication interface 530 uses a transceiver module, such as but not limited to a transceiver, to implement communication between the computing device 500 and other devices or communication networks. For example, instructions to migrate one or more target VMs may be sent to the first computing device through communication interface 730.
  • a transceiver module such as but not limited to a transceiver
  • Bus 540 may include a path that carries information between various components in computing device 500 (eg, memory 510, processor 520, and communication interface 530).
  • the memory allocation device 200 may be deployed on the computing device system 600 as shown in FIG. 11 .
  • the computing device system 600 includes a plurality of computing devices 700.
  • Each computing device 700 includes a memory 710, a processor 720, a communication interface 730, and a bus 740.
  • the memory 710, the processor 720, and the communication interface 730 pass through Bus 740 implements communication connections between each other.
  • Memory 710 may be ROM, RAM, a static storage device, or a dynamic storage device.
  • the memory 710 may store computer program code, for example, computer program code in the memory management module 210 , computer program code in the policy control module 220 , or computer program code in the scheduling module 230 .
  • the processor 720 and the communication interface 730 are used to execute part of the method executed by the memory allocation device 200 (including any one or more steps described in S101-S111 above).
  • the memory 710 may also store data.
  • the data stored in the memory 710 includes intermediate data or result data generated by the processor 720 during execution, such as first memory capacity, delay time, etc.
  • Processor 720 may employ a CPU, GPU, ASIC, microprocessor, or one or more integrated circuits.
  • the processor 720 may also be an integrated circuit chip with signal processing capabilities.
  • part of the functions of the memory allocation device 200 may be implemented by instructions in the form of hardware integrated logic circuits or software in the processor 720 .
  • the processor 720 can also be a DSP, FPGA, general-purpose processor, or other programmable logic devices, discrete gates, transistor logic devices, discrete hardware components, etc., and can implement or execute the methods, steps and logical block diagrams disclosed in the embodiments of this application. .
  • the processor 720 can also be any conventional processor, and the steps combined with the method disclosed in this application can be directly implemented as a hardware decoding processor, or executed using a combination of hardware and software modules in the decoding processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory 710.
  • the processor 720 reads the information in the memory 710 and completes some functions of the memory allocation device 200 in combination with its hardware.
  • the communication interface 730 uses a transceiver module, such as but not limited to a transceiver, to implement communication between the computing device 700 and other devices or communication networks. For example, instructions to migrate one or more target VMs may be sent to the first computing device through communication interface 730.
  • a transceiver module such as but not limited to a transceiver
  • Bus 740 may include a path that carries information between various components in computing device 700 (eg, memory 710, processor 720, communications interface 730).
  • the plurality of computing devices 700 described above may include a first computing node and a second computing node.
  • the computer program product that provides the memory allocation device 200 includes one or more computing program codes executed by the memory allocation device 200. When these computer program codes are loaded and executed on a computing device, all or part of the computer program products according to the embodiments of the present application are generated. process or function.
  • the above-mentioned computing device may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the above-mentioned computer program code can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another.
  • the above-mentioned computer program code can be transferred from a website, computer, server or data center. Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, twisted pair or wireless (such as infrared, wireless, microwave), etc.) means.
  • the computer readable storage medium stores the computer program code that provides the memory allocation device 200 .
  • the computer-readable storage medium may be any available medium that can be accessed by a computing device or a data storage device such as a server, data center, etc. that contains one or more media integrated.
  • the above available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, optical disk), or semiconductor media (eg, SSD).

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System (AREA)

Abstract

本申请公开了一种内存分配方法及相关产品,其中,该方法包括:在第一计算节点不能够满足第一VM所需要的内存时,迁移第一计算节点上的一个或多个第二VM到第二计算节点,以及在第一计算节点为第一VM分配内存。利用上述方法能够避免第一VM因无法获得内存资源而无法正常运行的情况。进一步地,当第一计算节点使用内存超分的方式处理第一计算节点上的内存资源时,利用上述方法可以保证第一计算节点上的VM不会因无法获得内存资源而无法正常运行,从而提高第一计算节点上资源的利用率。

Description

一种内存分配方法及相关产品
本申请要求于2022年03月15日提交中国专利局、申请号为202210253470.3、申请名称为“一种内存分配方法及相关产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及虚拟化技术领域,尤其涉及一种内存分配方法及相关产品。
背景技术
在虚拟化场景下,一台物理主机可以虚拟成多台虚拟机(virtual machine,VM)。而且,为了保证VM能够正常运行,物理主机需要给VM分配相应的内存资源。但是,不同VM对内存资源的需求可能不同,这就可能出现内存超分的问题,从而导致部分VM因无法获得内存资源而无法正常运行。
因此,如何给VM分配内存资源仍然是当前急需解决的问题。
发明内容
本申请提供了一种内存分配方法及相关产品,能够避免物理主机上的VM因无法获得内存资源而无法正常运行的情况。
第一方面,本申请提供了一种内存分配方法,该方法包括:在第一计算节点不能够满足第一VM所需要的内存时,迁移第一计算节点上的一个或多个第二VM到第二计算节点,并在第一计算节点为第一VM分配内存。如此,可以避免第一VM因无法获得内存资源而无法正常运行的情况。进一步地,基于上述方法,第一计算节点可用使用内存超分的方式处理第一计算节点上的内存资源,而且通过实施上述方法,即使第一计算节点处于内存超分模式,第一计算节点上的VM依然能够正常运行,从而提高了第一计算节点上资源的利用率。
在第一方面的一种可能的实现方式中,上述第一计算节点为第一VM分配内存,包括:在第一计算节点为第一VM增加分配内存。应理解,在实际应用中,第一VM运行过程中可能被配置为需要使用内存时才会申请内存,而且需要使用多少内存才会申请多少内存,基于上述实现方式可以给被配置为上述类型的第一VM分配内存。
在第一方面的一种可能的实现方式中,上述第一计算节点为第一VM分配内存,包括:在迁移一个或多个第二VM时,延迟在第一计算节点为第一VM增加分配内存。应理解,迁移VM需要时间,相较于上述一个或多个第二VM迁移完成之后再为第一VM增加分配内存,通过上述实现方式,可以减少因迁移上述一个或多个第二VM而给第一VM的运行带来的影响,从而保障了部署在第一VM上的业务。
在第一方面的一种可能的实现方式中,上述第一计算节点为第一VM分配内存,包括:在第一计算节点为第一VM增加分配第一VM请求的内存容量。
在第一方面的一种可能的实现方式中,如果第一计算节点上的可用内存容量与第一VM请求的内存容量的差值小于阈值,则第一计算节点不能够满足第一VM所需要的内存。
在第一方面的一种可能的实现方式中,在迁移第一计算节点上的一个或多个第二VM到 第二计算节点之前,上述方法还包括:暂停上述一个或多个第二VM。如此,可以控制上述一个或多个第二VM的迁移时间。
在第一方面的一种可能的实现方式中,上述一个或多个第二VM满足以下一个或多个条件:一个或多个第二VM占用的总内存容量大于上述阈值,迁移一个或多个第二VM所用的时间小于耗尽第一计算节点上的可用内存容量所用的时间。如此,可以保证第一计算节点上可用的内存资源不被耗尽,从而保证第一计算节点上的VM可以正常运行。
在第一方面的一种可能的实现方式中,上述第二计算节点能够满足上述一个或多个第二VM所需的总内存容量的要求,其中,上述一个或多个第二VM所需的总内存容量包括上述一个或多个第二VM占用的总内存容量。在上述一个或多个第二VM中的所有VM在迁移到第二计算节点之前,均未向第一计算节点申请了内存的情况下,上述一个或多个第二VM所需的总内存容量即为上述一个或多个第二VM占用的总内存容量。在上述一个或多个第二VM中的任意一个或多个VM(如目标第二VM)在迁移到第二计算节点之前,还向第一计算节点申请了内存的情况下,上述一个或多个第二VM所需的总内存容量除了包括上述一个或多个第二VM占用的总内存容量,还包括上述任意一个或多个VM在迁移到第二计算节点前向第一计算节点申请的总内存容量。如此,可以保证上述一个或多个第二VM在第二计算节点上正常运行。
在第一方面的一种可能的实现方式中,上述迁移第一计算节点上的一个或多个第二VM到第二计算节点,包括:将一个或多个第二VM中的目标第二VM的迁移状态信息发送到第二计算节点,其中,目标第二VM的迁移状态信息包括目标第二VM的物理地址偏移、以及目标第二VM在迁移到第二计算节点之前向第一计算节点请求的内存容量。
在第一方面的一种可能的实现方式中,上述方法还包括:在第二计算节点基于目标第二VM的物理地址偏移、以及目标第二VM在迁移到第二计算节点之前向第一计算节点请求的内存容量,为目标第二VM分配内存。如此,第二VM便可以通过上述分配的内存在第二计算节点上继续运行。
第二方面,本申请提供了一种内存分配方法,该方法包括:在第一计算节点不能够满足第一VM所需要的内存时,暂停第一VM,然后将第一VM从第一计算节点迁移到第二计算节点,并在第一计算节点为第一计算节点上的第二VM分配内存。如此,不仅可以避免第一VM因无法获得内存资源而无法正常运行,还可以增加第一计算节点上可用的内存资源,从而为第一计算节点上的第二VM分配内存。
在第二方面的一种可能的实现方式中,如果第一计算节点上的可用内存容量与第一VM请求的内存容量的差值小于阈值,则第一计算节点不能够满足第一VM所需要的内存。
在第二方面的一种可能的实现方式中,上述第二计算节点能够满足第一VM占用的内存容量和第一VM请求的内存容量的要求。如此,可以保证第一VM在第二计算节点上能够正常运行,从而不会影响到部署在第一VM上的业务。
在第二方面的一种可能的实现方式中,上述方法还包括:在第二计算节点为第一VM分配内存,以使得第一VM在第二计算节点上恢复运行。
在第二方面的一种可能的实现方式中,上述将第一VM从第一计算节点迁移到第二计算节点,包括:将第一VM的迁移状态信息发送到第二计算节点,其中,第一VM的迁移状态信息包括第一VM请求的内存容量和第一VM的物理地址偏移。
在第二方面的一种可能的实现方式中,上述在第二计算节点为第一VM分配内存,包括:在第二计算节点基于第一VM请求的内存容量和第一VM的物理地址偏移为第一VM分配内 存。
第三方面,本申请提供了一种内存分配装置,该装置包括调度模块和内存管理模块。其中,调度模块用于在第一计算节点不能够满足第一VM所需要的内存时,迁移第一计算节点上的一个或多个第二VM到第二计算节点;内存管理模块用于在第一计算节点为第一VM分配内存。
在第三方面的一种可能的实现方式中,上述内存管理模块用于在第一计算节点为第一VM增加分配内存。
在第三方面的一种可能的实现方式中,上述内存管理模块用于在迁移一个或多个第二VM时,延迟在第一计算节点为第一VM增加分配内存。
在第三方面的一种可能的实现方式中,上述内存管理模块用于在第一计算节点为第一VM增加分配第一VM请求的内存容量。
在第三方面的一种可能的实现方式中,如果第一计算节点上的可用内存容量与第一VM请求的内存容量的差值小于阈值,则第一计算节点不能够满足第一VM所需要的内存。
在第三方面的一种可能的实现方式中,上述装置还包括策略控制模块,该模块用于在迁移第一计算节点上的一个或多个第二VM到第二计算节点之前,暂停上述一个或多个第二VM。
在第三方面的一种可能的实现方式中,上述一个或多个第二VM满足以下一个或多个条件:一个或多个第二VM占用的总内存容量大于上述阈值,迁移一个或多个第二VM所用的时间小于耗尽第一计算节点上的可用内存容量所用的时间。
在第三方面的一种可能的实现方式中,上述第二计算节点能够满足上述一个或多个第二VM所需的总内存容量的要求,其中,上述一个或多个第二VM所需的总内存容量包括上述一个或多个第二VM占用的总内存容量。在上述一个或多个第二VM中的所有VM在迁移到第二计算节点之前,均未向第一计算节点申请了内存的情况下,上述一个或多个第二VM所需的总内存容量即为上述一个或多个第二VM占用的总内存容量。在上述一个或多个第二VM中的任意一个或多个VM(如目标第二VM)在迁移到第二计算节点之前,还向第一计算节点申请了内存的情况下,上述一个或多个第二VM所需的总内存容量除了包括上述一个或多个第二VM占用的总内存容量,还包括上述任意一个或多个VM在迁移到第二计算节点前向第一计算节点申请的总内存容量。
在第三方面的一种可能的实现方式中,上述调度模块用于将一个或多个第二VM中的目标第二VM的迁移状态信息发送到第二计算节点,其中,目标第二VM的迁移状态信息包括目标第二VM的物理地址偏移、以及目标第二VM在迁移到第二计算节点之前向第一计算节点请求的内存容量。
在第三方面的一种可能的实现方式中,上述内存管理模块还用于在第二计算节点目标第二VM的物理地址偏移、以及目标第二VM在迁移到第二计算节点之前向第一计算节点请求的内存容量,为目标第二VM分配内存。
第四方面,本申请提供了一种内存分配装置,该装置包括策略控制模块、调度模块以及内存管理模块。其中,策略控制模块用于在第一计算节点不能够满足第一VM所需要的内存时,暂停第一VM;调度模块用于将第一VM从第一计算节点迁移到第二计算节点;内存管理模块用于在第一计算节点为第一计算节点上的第二VM分配内存。
在第四方面的一种可能的实现方式中,如果第一计算节点上的可用内存容量与第一VM请求的内存容量的差值小于阈值,则第一计算节点不能够满足第一VM所需要的内存。
在第四方面的一种可能的实现方式中,上述第二计算节点能够满足第一VM占用的内存 容量和第一VM请求的内存容量的要求。
在第四方面的一种可能的实现方式中,上述内存管理模块还用于在第二计算节点为第一VM分配内存,其中,第一VM通过上述分配的内存在第二计算节点上恢复运行。
在第四方面的一种可能的实现方式中,上述调度模块用于将第一VM的迁移状态信息发送到第二计算节点,其中,第一VM的迁移状态信息包括第一VM请求的内存容量和第一VM的物理地址偏移。
在第四方面的一种可能的实现方式中,上述内存管理模块用于在第二计算节点基于第一VM请求的内存容量和第一VM的物理地址偏移为第一VM分配内存。
第五方面,本申请提供了一种计算系统,该系统包括如前述第三方面或第三方面的任一种实现方式中所描述的内存分配装置、第一计算节点以及第二计算节点。其中,第一计算节点上运行有第一VM、以及一个或多个第二VM;内存分配装置用于在第一计算节点不能够满足第一VM所需要的内存时,迁移上述一个或多个第二VM到第二计算节点,以及在第一计算节点为第一VM分配内存。
第六方面,本申请提供了一种计算系统,该系统包括如前述第四方面或第四方面的任一种实现方式中所描述的内存分配装置、第一计算节点以及第二计算节点。其中,第一计算节点上运行有第一VM和第二VM;内存分配装置用于在第一计算节点不能够满足第一VM所需要的内存时,暂停第一VM,然后将第一VM从第一计算节点迁移到第二计算节点,并在第一计算节点为第二VM分配内存。
第七方面,本申请提供一种计算设备系统,该计算设备系统包括处理器和存储器,存储器存储有计算机程序代码,处理器执行存储器中的计算机程序代码以实现前述第一方面或第一方面的任一种实现方式中所描述的方法,或者实现前述第二方面或第二方面的任一种实现方式中所描述的方法。
第八方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序代码,当计算机程序代码被计算设备执行时,计算设备执行前述第一方面或第一方面的任一种实现方式中所描述的方法,或者执行前述第二方面或第二方面的任一种实现方式中所描述的方法。该计算机可读存储介质包括但不限于易失性存储器(如随机访问存储器)、非易失性存储器(如快闪存储器、硬盘(hard disk drive,HDD)、固态硬盘(solid state drive,SSD))。
第九方面,本申请提供一种计算机程序产品,该计算机程序产品包括计算机程序代码,在计算机程序代码被计算设备执行时,计算设备执行前述第一方面或第一方面的任一种实现方式中所描述的方法,或者执行前述第二方面或第二方面的任一种实现方式中所描述的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述第一方面或第一方面的任一种实现方式中所描述的方法,或者需要使用前述第二方面或第二方面的任一种实现方式中所描述的方法的情况下,可以下载该计算机程序产品并在计算设备上执行该计算机程序产品。
附图说明
图1是本申请实施例提供的一种计算系统的结构示意图;
图2是本申请实施例提供的一种计算节点的结构示意图;
图3是本申请实施例提供的一种计算系统的应用场景示意图;
图4是本申请实施例提供的另一种计算系统的应用场景示意图;
图5是本申请实施例提供的一种内存分配方法的流程示意图;
图6是本申请实施例提供的一种采用NUMA架构的计算节点的结构示意图;
图7是本申请实施例提供的一种内存分配的示意图;
图8是本申请实施例提供的一种内存分配装置的结构示意图;
图9是本申请实施例提供的一种内存分配装置的部署示意图;
图10是本申请实施例提供的一种计算设备的结构示意图;
图11是本申请实施例提供的一种计算设备系统的结构示意图。
具体实施方式
为了使本申请提供的技术方案更加清晰,在具体描述该技术方案之前,首先进行相关技术术语的解释。
虚拟化技术(virtualization)是一种有效管理和充分共享物理资源的重要技术手段,能够在计算机的软、硬件之间引入抽象层,给上层应用提供独立的运行环境,还能够屏蔽底层硬件的动态性、异构性,实现硬件资源的共享复用。鉴于上述优点,虚拟化技术被广泛应用在云计算和高性能计算等领域。
使用虚拟化技术可以将一台物理主机虚拟成一台或多台VM,也就是说,物理主机(也被称为宿主机)上可以运行一台或多台VM。为保证VM的正常运行,物理主机需要给VM分配相应的内存资源。具体实现中,物理主机采用内存虚拟化的方式来给VM提供一个从零开始的连续的内存空间,即VM的物理地址(guest physical address,GPA)空间,这个地址空间并不是真正的物理地址空间,它只是物理主机的虚拟地址(host virtual address,HVA)空间在VM地址空间的一个映射。对于VM来说,GPA空间是从零开始的连续地址空间,但对于物理主机来说,GPA空间并不一定是连续的,GPA空间可能映射到物理主机上的多个不连续的HVA空间。由于GPA空间的存在,VM的内存访问过程涉及到三次地址转换,即:VM的虚拟地址(guest virtual address,GVA)→GPA→HVA→物理主机的物理地址(host virtual address,HPA)。其中,GVA是VM访问的地址,HPA是物理主机中存放程序和数据的实际地址;GVA与GPA之间的映射关系记录在VM的页表中,由VM的操作系统维护;GPA与HVA之间的映射关系记录在影子页表中,由虚拟机管理软件(virtual machine monitor,VMM)维护;HVA与HPA之间的映射关系记录在物理主机的页表中,由物理主机的操作系统维护。
在实际应用中,物理主机中的内存资源往往会进行超量分配(内存超分),即:分配给VM和其他进程(如开放虚拟交换标准(open vswitch,OVS)进程)的内存的容量(以下简称为内存容量)大于物理主机的内存容量。其中,上述“分配给VM和其他进程的内存容量”是VM和其他进程允许占用的最大的内存容量,也被称为VM和其他进程的内存规格。应理解,由于VM和其他进程实际占用的内存容量小于或等于分配给VM和其他进程的内存容量,因此对物理主机进行内存超分会使得物理主机能够运行更多的VM或应用,从而极大地提高物理主机中资源(如计算资源、内存资源)的利用率。
在内存超分模式下,VM和其他进程实际占用的内存容量可能会小于物理主机的内存容量,也可能会大于或等于物理主机的内存容量。当VM和其他进程实际占用的内存容量大于或等于物理主机的内存容量时,说明物理主机上的内存已被VM和其他进程使用完毕,此时物理主机上的可用内存容量为零,在这种情况下,如果有VM或进程向物理主机申请内存资源,该VM或进程会因为无法获得内存资源而进入锁死(soft lockup)状态,这将影响到运行在上述VM或进程上的业务。
针对上述问题,本申请提供了一种内存分配装置,为了更加清楚的理解本申请提供的内存分配装置,下面结合图1示出的计算系统,对上述内存分配装置进行描述。
图1是本申请实施例提供的一种计算系统的结构示意图,如图1所示,计算系统100包括内存分配装置200和多个计算节点300。
内存分配装置200:用于给多个计算节点300上的VM 310分配内存资源,而且在计算节点300因内存超分而使得其上可用的内存资源不能够满足VM所需要的内存时,内存分配装置200还用于将计算节点300中的某个或某些VM迁移至其他计算节点,然后释放上述迁移后的VM占用的内存资源,以增加计算节点300上可用的内存资源。如此,不仅能够避免VM310因无法获得内存资源而被锁死的情况,还能够提高计算节点300上资源(包括内存资源、计算资源等)的利用率。
计算节点300:可以是公有云、私有云或混合云上的计算设备(如服务器、物理主机),也可以是终端计算设备(如终端服务器、笔记本电脑、个人台式电脑、智能摄像机等)。图2示例性的展示了一种计算节点300的结构示意图,如图2所示,除了至少一个VM 310之外,计算节点300还包括硬件320和宿主机操作系统(host operating system,host OS)330。其中,VM 310上安装有客户操作系统(guest operating system,guest OS)311,客户操作系统311上运行有应用程序312,除此之外,VM 310还包括硬件320提供的多种硬件资源,例如,虚拟处理器(如虚拟中央处理器(virtual central processing unit,vCPU))313、虚拟内存314、虚拟网卡315等。硬件320包括存储器321(如随机存取存储器(random access memory,RAM)、硬盘)、处理器322(如中央处理器(central processing unit,CPU)和通信接口323(如物理网卡)。宿主机操作系统330中部署有虚拟机监控装置331(如VMM、hypervisor),宿主机操作系统330用于将硬件320提供的各种硬件资源分配给VM 310,以及实现VM 310的调度、隔离和管理。应理解,图2仅仅示出了计算节点300的一种示例性的结构,在实际应用中,计算节点300还可能具有其他的结构,例如,虚拟机监控装置331还可以部署在宿主机操作系统330之外;又例如,计算节点300还可以包括其他部件(如总线),对此本申请实施例不作限定。
本申请实施例中,考虑到计算节点300的多样性,例如,前文所述的计算节点300可以是公有云、私有云或混合云上的计算设备,也可以是终端计算设备,因此,计算系统100适用于多种场景。下面结合图3-图4对计算系统100的应用场景进行描述。
示例场景1:计算系统100由云服务提供商以云服务(即计算服务)的形式提供给租户。
计算系统100部署在云环境中,其中,云环境是云计算模式下利用基础资源向租户提供云服务的实体,云环境包括云数据中心和云服务平台,云数据中心包括云服务提供商拥有的大量基础资源(包括计算资源、存储资源和网络资源),云数据中心包括的计算资源可以是大量的计算设备(如服务器、物理主机)。那么,计算系统100在云环境中的部署方式灵活,例如,计算系统100中的内存分配装置200部署在云数据中心上的至少一个计算设备或至少一个虚拟机上,多个计算节点300分别是云数据中心上的多个计算设备;又例如,计算系统100中的内存分配装置200分布式地部署在云数据中心上的多个计算设备和虚拟机上,多个计算节点300分别是云数据中心上的多个计算设备。
如图3所示,计算系统100由云服务提供商在云服务平台抽象成一种计算服务提供给租户,租户通过云服务平台购买上述计算服务后(可预充值再根据最终资源的使用情况进行结算),云环境利用部署在云数据中心的计算系统100向租户提供计算服务。在使用计算服务时, 租户将业务以VM 310的形式部署在计算系统100中的多个计算节点300上,VM 310使用计算节点300上的硬件资源(包括计算资源、内存资源和网络资源)来执行租户的业务。其中,对于计算节点300中的内存资源,由内存分配装置200按需分配给计算节点300上的VM 310,如此,不仅可以将计算节点300中的内存资源超量分配,还可以保证计算节点300上的VM 310的业务不受影响,从而提高了计算节点300中资源的利用率,给租户提供质量更高的服务。
示例场景2:计算系统100中的内存分配装置200由云服务提供商以云服务(即内存分配服务)的形式提供给租户。
计算系统100中的内存分配装置200部署在云数据中心上的一个计算设备或一个VM上,或者分布式地部署在云数据中心上的多个计算设备或多个VM上,又或者分布式地部署在云数据中心上的多个计算设备和VM上。计算系统100中的多个计算节点300可以是云数据中心上的多个计算设备,或者是边缘环境中的多个计算设备,又或者是多个终端计算设备,还可以是不同环境中多个计算设备,例如,一部分计算节点300是云数据中心上的计算设备,一部分计算节点300是边缘环境上的边缘计算设备,一部分计算节点300是终端计算设备。其中,边缘环境包括距离终端计算设备较近的边缘计算设备的集合,边缘计算设备包括边缘服务器、拥有计算力的边缘小站等。
如图4所示,计算系统100中的内存分配装置200由云服务提供商在云服务平台抽象成一种内存分配服务提供给租户,租户通过云服务平台购买上述内存分配服务后(可预充值再根据最终资源的使用情况进行结算),云环境利用部署在云数据中心的内存分配装置200向多个计算节点300提供内存分配服务,基于内存分配装置200具有的功能,多个计算节点300上的内存资源能够得到充分的利用。
示例场景3:计算系统100中的内存分配装置200具有的功能可以由软件装置实现,也可以由硬件设备实现,还可以由软件装置和硬件设备结合实现,因此,内存分配装置200可以是一个边缘计算设备或终端计算设备,也可以是运行在上述边缘计算设备或终端计算设备上的软件装置,还可以分布式地部署在多个边缘计算设备或多个终端计算设备上,又或者分布式地部署在边缘计算设备和终端计算设备上。计算系统100中的多个计算节点300可以是云环境、边缘环境以及终端计算设备中的任意一个或多个环境中的计算设备。
应理解,本申请实施例不对计算系统100的各个部分具体部署在什么环境进行限制性的划分,实际应用格式可根据云环境和边缘环境的资源占有情况、终端计算设备的计算能力或具体应用需求进行适应性的部署。
下面结合图5描述的内存分配方法,对内存分配装置200展开进一步地描述。需要说明的是,为了简便,下面将以内存分配装置200给多个计算节点300中的第一计算节点分配内存资源为例进行说明。
S101:内存分配装置200判断第一计算节点是否能够满足第一VM所需要的内存,如果第一计算节点能够满足第一VM所需要的内存,则执行S102,如果第一计算节点不能够满足第一VM所需要的内存,则执行S103-S108。
其中,第一VM是运行在第一计算节点上的VM。在一些实施例中,第一VM向内存分配装置200发送内存申请请求,或者内存分配装置200定期或在预设时间给第一VM自动分配内存,上述任一条件均可以触发内存分配装置200执行S101。
在一些实施例中,内存分配装置200判断第一计算节点是否能够满足第一VM所需要的的内存,包括:内存分配装置200确定第一计算节点上的可用内存容量与第一内存容量的差 值是否小于第一阈值。如果第一计算节点上的可用内存容量与第一内存容量的差值小于第一阈值,则确定第一计算节点不能够满足第一VM所需要的内存;如果第一计算节点上的可用内存容量与第一内存容量的差值大于或等于第一阈值,则确定第一计算节点能够满足第一VM所需要的内存。下面分别对第一计算节点上的可用内存容量、第一内存容量以及第一阈值进行描述。
(1)第一计算节点上的可用内存容量是指第一计算节点上可用的内存的容量。在一些实施例中,内存分配装置200具有监控第一计算节点上的可用内存容量的功能,因此内存分配装置200可以获得第一计算节点上的可用内存容量。在另一些实施例中,第一VM向内存分配装置200发送内存申请请求后,第一计算节点将本地的可用内存容量发送至内存分配装置200,通过这种方式内存分配装置200也可以获得第一计算节点上的可用内存容量。
(2)在第一VM向内存分配装置200发送内存申请请求的情况下,第一内存容量可以是第一VM请求的内存容量,例如,上述内存申请请求包括第一内存容量,那么当内存分配装置200接收到上述内存申请请求后便会获得第一内存容量;在内存分配装置200定期或在预设时间给第一VM自动分配内存的情况下,第一内存容量可以是内存分配装置200自动预分配给第一VM的内存容量。考虑到内存的分配通常以页(包括大页(huge page)和小页)为单位进行,因此第一内存容量可以是大页内存容量,也可以是小页内存容量。其中,大页是指大的内存页,每个页帧的大小可以是2兆(MB)或1吉字节(GB),小页也称为标准的内存页,每个页帧的大小是4千字节(KB),相较于小页,使用大页可以提高内存访问效率。
(3)第一阈值可以是用户预设的,也可以是内存分配装置200根据第一计算节点拥有的内存容量、第一计算节点上VM的数量、或具体应用需求进行适应性调节得到的。
S102:内存分配装置200在第一计算节点为第一VM分配内存。
具体地,内存分配装置200基于第一内存容量从第一计算节点上的可用内存中选取一部分分配给第一VM,以便于第一VM的运行。
在一些实施例中,内存分配装置200在第一计算节点为第一VM分配内存,包括:内存分配装置200在第一计算节点为第一VM增加分配内存。应理解,第一VM运行过程中,需要使用内存时才会申请内存,而且需要使用多少内存便会申请多少内存。因此,“内存分配装置200在第一计算节点为第一VM增加分配内存”可以理解为:在第一VM已经占用的内存的基础上,又给第一VM分配一部分内存。
在另一些实施例中,考虑到实际应用还可能存在以下情况:第一VM在运行前,内存分配装置200便给第一VM分配好所需的所有内存。因此,内存分配装置200在第一计算节点为第一VM分配的内存还可以是第一VM运行所需的所有内存。
S103:内存分配装置200确定第一计算节点上的一个或多个目标VM。
其中,上述一个或多个目标VM可以包括第一VM,也可以不包括第一VM。在上述一个或多个目标VM不包括第一VM时,为了便于区别,以下将这种情况下的一个或多个目标VM称为一个或多个第二VM。上述一个或多个第二VM满足以下一个或多个条件:上述一个或多个第二VM占用的总内存容量大于第一阈值,迁移上述一个或多个第二VM所用的时间小于耗尽第一计算节点上的可用内存容量所用的时间。需要说明的是,上述一个或多个第二VM占用的总内存容量是指当前时刻上述一个或多个第二VM实际占用的内存容量之和。
在一些实施例中,内存分配装置200确定第一计算节点上的一个或多个目标VM,包括:内存分配装置200基于第一策略从运行在第一计算节点上的VM中确定一个或多个第二VM。其中,第一策略包括以下至少一个条件:①一个或多个第二VM占用的总内存容量大于第一 阈值;②迁移一个或多个第二VM所用的时间小于第二阈值,其中,第二阈值是小于或等于上述耗尽第一计算节点上的可用内存容量所用的时间的数值,第二阈值可以是用户预设的,也可以是内存分配装置200根据实际情况进行适应性调节得到的;③当存在至少两个结果(每个结果包括一个或多个第二VM)满足条件①和条件②时,选择迁移所用时间更少的,例如,确定每个结果中所有VM的读写访问次数,并选择读写访问次数最少的;④当存在至少两个结果满足条件①和条件②时,选择占用的总内存容量更大的。
S104:内存分配装置200暂停上述一个或多个目标VM的运行。
具体地,内存分配装置200向第一计算节点300发送暂停上述一个或多个目标VM的命令,第一计算节点300接收到上述命令后,对上述一个或多个目标VM执行暂停操作(如suspend指令),以暂停正在运行的一个或多个目标VM。如此,可以令内存分配装置200控制上述一个或多个目标VM的迁移时间。而且,VM暂停运行后,其实际占用的内存容量就不会发生变化,因此通过上述操作还能够保证迁移操作完成后(即S106和S107),第一计算节点上的可用内存容量大于第一阈值。
S105:内存分配装置200确定第二计算节点。
其中,第二计算节点满足以下条件:第二计算节点与第一计算节点不是同一个计算节点、第二计算节点能够满足上述一个或多个目标VM所需的总内存容量的要求。需要说明的是,上述一个或多个目标VM所需的总内存容量包括上述一个或多个目标VM占用的总内存容量。考虑到实际应用中可能出现以下情况:上述一个或多个目标VM中的任意一个或多个目标VM在迁移到第二计算节点之前,向第一计算节点申请了内存,例如第一VM。在这种情况下,上述任意一个或多个目标VM中的每个目标VM所需的内存容量包括该VM占用的内存容量(即当前时刻该VM实际占用的内存容量),以及该VM在迁移到第二计算节点之前向第一计算节点请求的内存容量。那么,上述一个或多个目标VM所需的总内存容量除了包括上述一个或多个目标VM占用的总内存容量,还包括上述任意一个或多个目标VM在迁移到第二计算节点前向第一计算节点申请的总内存容量。在一些实施例中,由于上述一个或多个目标VM可以包括第一VM,在这种情况下,上述一个或多个目标VM所需的总内存容量包括第一VM占用的内存容量和第一VM正在请求的内存容量(即第一内存容量)。在另一些实施例中,由于上述一个或多个目标VM还可以不包括第一VM,在这种情况下,如果上述一个或多个目标VM中的所有VM在迁移到第二计算节点之前,均未向第一计算节点申请内存,那么上述一个或多个目标VM所需的总内存容量即为上述一个或多个第二VM占用的总内存容量;如果上述一个或多个目标VM中的任意一个或多个VM在迁移到第二计算节点之前,向第一计算节点申请内存,那么上述一个或多个目标VM所需的总内存容量包括上述一个或多个第二VM占用的总内存容量,以及上述任意一个或多个VM在迁移到第二计算节点前向第一计算节点申请的总内存容量。
在一些实施例中,内存分配装置200确定第二计算节点,包括:内存分配装置200基于第二策略从多个计算节点300中确定第二计算节点。其中,第二策略包括以下至少一个条件:①非第一计算节点;②第二计算节点上的可用内存容量与上述一个或多个目标VM所需的总内存容量的差值大于第三阈值,与上述第一阈值类似,第三阈值可以是用户预设的,也可以是内存分配装置200根据第二计算节点拥有的内存容量、第二计算节点上VM的数量、或具体应用需求进行适应性调节得到的,第三阈值用于帮助内存分配装置200确定将上述一个或多个目标VM迁移至第二计算节点后,该计算节点上可用的内存资源是否充足;③当存在至少两个第二计算节点满足条件①和条件②时,选择可用内存容量更大的;④当存在至少两个 第二计算节点满足条件①和条件②时,选择可用内存容量变化最慢的。其中,可用内存容量变化最慢这一条件能够保证在VM在迁移到第二计算节点,以及在第二计算节点上恢复运行期间,第二计算节点上可用的内存资源足够,也就是说,将上述一个或多个目标VM迁移到第二计算节点后不会影响该计算节点上其他VM或应用的运行。
可选的,S105可以在S104之后执行,也可以与S104同步进行,本申请实施例并不限定。
S106:内存分配装置200将上述一个或多个目标VM从第一计算节点迁移到第二计算节点。
具体地,内存分配装置200向第一计算节点发送迁移指令,其中,迁移指令用于指示第一计算节点将上述一个或多个目标VM迁移到第二计算节点。第一计算节点接收到上述迁移指令后,将上述一个或多个目标VM的迁移状态信息发送到第二计算节点,从而完成上述第一或多个目标VM的迁移。其中,上述一个或多个目标VM的迁移状态信息包括每个目标VM的配置信息(如操作系统)、每个目标VM的设备信息(如内存规格)以及每个目标VM的内存(如目标VM的初始内存、内存变更分片)。
由上述S105可知,上述一个或多个目标VM中的任意一个或多个目标VM在迁移到第二计算节点之前,可能还向第一计算节点申请了内存。可选的,上述任意一个或多个目标VM中的每个目标VM的迁移状态信息还包括该VM的GPA偏移,以及该VM迁移到第二计算节点之前向第一计算节点请求的内存容量。由上述技术术语的解释可知,VM的GPA空间是一段从零开始的连续的地址空间,因此上述任意一个或多个目标VM中的每个目标VM的GPA空间的基地址为零,那么,上述任意一个或多个目标VM中的每个目标VM的GPA在迁移前和迁移后保持不变,上述任意一个或多个目标VM中的每个目标VM的GPA偏移在迁移前和迁移后也保持不变。
本申请实施例中,第二计算节点接收到上述一个或多个目标VM的迁移状态信息之后,为了保证部署在这些目标VM上的业务不受影响,还需要在第二计算节点上恢复(resume)这些目标VM的运行。以这些目标VM中的一个为例,对其恢复运行的过程进行描述:
(1)对于在迁移到第二计算节点之前,未向第一计算节点申请内存的目标VM而言,目标VM通过以下步骤恢复运行:内存分配装置200在第二计算节点基于目标VM的迁移状态信息中的内存信息(如目标VM的初始内存、内存变更分片)为目标VM分配内存。之后,目标VM通过上述分配的内存在第二计算节点上恢复运行。
(2)对于在迁移到第二计算节点之前,向第一计算节点申请内存的目标VM而言,目标VM通过以下任一种方式步骤恢复运行,以下任一种方式适用于第一VM、或者在迁移到第二计算节点之前,向第一计算节点申请内存的第二VM。
方式1、目标VM的迁移状态信息不包括目标VM的GPA偏移,以及目标VM在迁移到第二计算节点之前向第一计算节点申请的内存容量。那么,内存分配装置200在第二计算节点基于目标VM迁移状态信息中的内存信息(如目标VM的初始内存、内存变更分片)为目标VM分配内存,这部分内存是目标VM在迁移到第二计算节点前实际占用的第一计算节点上的那一部分内存,即目标VM实际占用的内存容量对应的那一部分内存。这时,目标VM在第二计算节点上恢复了暂停前的运行状态,暂停前的运行状态包括向第一计算节点请求内存。然后,内存分配装置200在第二计算节点为目标VM分配该VM在迁移到第二计算节点之前向第一计算节点请求的内存容量。之后,目标VM便可以通过上述分配的内存在第二计算节点上恢复运行。
方式2、目标VM的迁移状态信息包括目标VM的GPA偏移,以及目标VM在迁移到第 二计算节点之前向第一计算节点申请的内存容量。那么,内存分配装置200在第二计算节点基于目标VM的迁移状态信息中的目标VM的GPA偏移和上述请求的内存容量为目标VM分配内存。应理解,通过执行上述步骤,内存分配装置200在第二计算节点为目标VM分配的是目标VM想要申请的内存,即在迁移到第二计算节点前向第一计算节点申请,但第一计算节点未分配给目标VM的内存,在迁移到第二计算节点后由第二计算节点分配给目标VM。关于目标VM占用的内存容量,即在迁移到第二计算节点前已经占用的第一计算节点上的内存容量,可参见方式1的相关叙述。之后,目标VM便可以通过上述分配好的内存在第二计算节点上恢复运行。
更具体地,目标VM基于目标VM的迁移状态信息获取目标VM的GPA偏移和目标VM在迁移到第二计算节点前向第一计算节点请求的内存容量,然后基于目标VM的GPA偏移和上述请求的内存容量向内存分配装置200发送内存申请请求。内存分配装置200接收到上述内存申请请求之后,在第二计算节点为目标VM分配该VM请求的内存。
在一些实施例中,目标VM中设置有触发条件,该触发条件是当目标VM读取了第二计算节点HVA指示的内存空间中的一个或多个字节时,目标VM向内存分配装置200发送内存申请请求。那么,目标VM基于目标VM的GPA偏移和目标VM在迁移到第二计算节点前向第一计算节点请求的内存容量向内存分配装置200发送内存申请请求,包括:目标VM基于目标VM的GPA偏移得到第二计算节点的HVA,再从上述HVA指示的内存空间中读取一个或多个字节,如此,便会触发目标VM向内存分配装置200发送内存申请请求。
需要说明的是,上述方式1和方式2中关于内存分配装置200在第二计算节点为目标VM分配内存的过程与上述内存分配装置200在第一计算节点为第一VM分配内存的过程类似,但值得注意的是,由上述S105可知,第二计算节点能够满足目标VM所需要的内存(即目标VM占用的内存容量),这说明第二计算节点上可用的内存资源足够,那么,内存分配装置200在第二计算节点为目标VM分配内存的过程具体可参见上述S102。
S107:内存分配装置200释放上述一个或多个目标VM占用的第一计算节点上的内存。
应理解,上述一个或多个目标VM迁移完成之后,内存分配装置200通过释放这些VM占用的内存可以增加第一计算节点上的可用内存容量。
S108:内存分配装置200为第一VM分配内存。
(1)当上述一个或多个目标VM包括第一VM时,说明第一VM已经迁移至第二计算节点,在这种情况下,内存分配装置200为第一VM分配内存是指内存分配装置200在第二计算节点为第一VM分配内存,其具体过程请参见上述S106中关于目标VM的恢复运行的过程。
应理解,在内存分配装置200将第一VM迁移到第二计算节点的情况下,当第一VM迁移到第二计算节点的过程中,内存分配装置200可以利用第一计算节点上剩余的可用内存资源,在第一计算节点为其上运行的其他VM分配内存。除此之外,当第一VM迁移到第二计算节点,且内存分配装置200将第一VM占用的第一计算节点上的内存释放之后,内存分配装置200还可以将这部分释放的内存分配给第一计算节点上的其他VM。
(2)当上述一个或多个目标VM不包括第一VM时,内存分配装置200为第一VM分配内存是指内存分配装置200在第一计算节点为第一VM分配内存。
与上述S102类似的,在一些实施例中,内存分配装置200在第一计算节点为第一VM分配内存,包括:内存分配装置200在第一计算节点为第一VM增加分配内存。在另一些实施例中,内存分配装置200在第一计算节点为第一VM分配内存,包括:内存分配装置200在 第一计算节点为第一VM分配第一VM运行所需的所有内存。
进一步地,当第一VM向内存分配装置200发送内存申请请求时,内存分配装置200在第一计算节点为第一VM增加分配内存,包括:内存分配装置200在第一计算节点为第一VM增加分配第一VM请求的内存容量。
更进一步地,考虑到VM的迁移需要时间,当上述一个或多个目标VM不包括第一VM时,为了尽可能不影响第一VM在第一计算节点上的运行,本申请实施例提出:内存分配装置200在第一计算节点为第一VM增加分配内存,包括:内存分配装置200在迁移上述一个或多个第二VM时,延迟在第一计算节点为第一VM增加分配内存。即,迁移上述一个或多个第二VM的相关步骤(S103-S107)与给第一VM分配内存的相关步骤并行执行。下面具体描述内存分配装置200如何延迟在第一计算节点为第一VM增加分配内存:
由前文可知,内存分配装置200在第一计算节点为第一VM分配内存之前,第一计算节点上的可用容量大于第一内存容量,以下将第一计算节点上的这部分可用内存容量对应的内存资源简称作内存资源Q。因此,内存分配装置200可以从内存资源Q中选择一部分分配给第一VM。但值得注意的一点是:在实际应用中,第一VM向内存分配装置200发送第一请求之后,还可能继续向内存分配装置200发送内存申请请求,或者第一计算节点中的其他VM继续向内存分配装置200发送内存申请请求。假设,上述内存资源Q仅支持给r个内存申请请求(包括第一VM发送的内存申请请求)分配内存,其中,r是大于或等于1的正整数。为了确保第r+1个内存申请请求也能够分配到相应的内存,需要在耗尽内存资源Q之前,保证上述一个或多个目标VM的迁移完成。为实现这一目的,内存分配装置200可能需要延迟给上述发送r个内存申请请求的VM(包括第一VM)分配内存。因此,可选的,内存分配装置200还执行以下步骤:
S109:内存分配装置200判断自身是否处于限速状态。如果内存分配装置200处于限速状态,则执行S110-S111,如果内存分配装置200未处于限速状态,则先将其设置为限速状态,再执行S110-S111。
其中,当内存分配装置200处于限速状态时,内存分配装置200将会延迟在第一计算节点给第一计算节点上的VM分配内存;当内存分配装置200未处于限速状态时,内存分配装置200不会延迟在第一计算节点给第一计算节点上的VM分配内存。
应理解,内存分配装置200处于限速状态的前提条件是第一计算节点上可用的内存资源不能够满足VM所需要的内存,因此,在第一计算节点上可用的内存资源能够满足VM所需要的内存时,内存分配装置200可以无需处于限速状态,也就是说,当内存分配装置200在执行S101时,如果确定第一计算节点能够满足第一VM所需要的内存,那么内存分配装置200在执行S102之前,还执行清除限速状态的步骤。如此,内存分配装置200将不会延迟在第一计算节点上为第一VM分配内存。
S110:内存分配装置200基于第二阈值计算延迟时间。
具体地,内存分配装置200确定目标内存容量,然后基于计算系统100的网络条件(包括计算节点300间通信时的带宽)和目标内存容量计算得到第二阈值,再基于目标内存容量和第二阈值计算得到延迟时间。
考虑到在迁移上述一个或多个第二VM的相关步骤与在第一计算节点为第一VM分配内存的相关步骤并行执行的情况下,内存分配装置200计算延迟时间时可能还未确定上述一个或多个第二VM。因此,目标内存容量可以是上述一个或多个第二VM的总内存容量,也可以不是上述一个或多个第二VM的总内存容量,内存分配装置200可以通过以下方式确定目 标内存容量:基于第一阈值确定目标内存容量,例如,目标内存容量可以是大于第一阈值的、VM实际占用的内存容量中的任意一个,或者是所有大于第一阈值的、VM实际占用的内存容量的平均值。
假设,内存资源Q的内存容量是N,上述r个内存申请请求用于申请的内存容量分别是M1、M2、…、Mr,其中,M1+M2+…+Mr≤N,目标内存容量是V,第二阈值是T1,延迟时间是D。那么,迁移内存资源Q所耗费的时间T2=(N/V)*T1,每个内存申请请求对应的延迟时间满足以下一个或多个条件:D≥T1/r,以及D≥T2/r。
在一些实施例中,当N与第一内存容量的差值小于第一阈值时,N与第一阈值接近,因此,上述延迟时间还可以满足以下条件:D≥(H/V)*T1/r,其中,H表示第一阈值。
需要说明的是,上述关于延迟时间的推导过程是以第一计算节点上的VM通过向内存分配装置200发送内存申请请求为例展开描述的,应理解,在实际应用中,在内存分配装置200定期或在预设时间为第一计算节点上的VM分配内存的情况下,延迟时间的推导过程与上述过程是类似的,为了简便,此处不再重复描述。
S111:内存分配装置200在到达延迟时间后在第一计算节点为第一VM分配内存。
具体地,内存分配装置200在到达延迟时间之后,基于第一内存容量从第一计算节点上的可用内存中选取一部分分配给第一VM。类似的,对于上述一个或多个第二VM迁移完成之前也向第一计算节点申请内存其他VM,内存分配装置200也是在到达相应的延迟时间之后再为这些VM分配相应的内存。如此,可以保证上述一个或多个第二VM迁移完成之前,第一计算节点上还拥有可用的内存资源。而且,在上述一个或多个第二VM迁移完成并释放了占用的内存之后,由于上述一个或多个第二VM占用的总内存容量大于第一阈值,因此释放上述一个或多个第二VM占用的内存之后,第一计算节点上的可用内存容量会大于第一阈值,从而保证第一计算节点上始终有内存分配给VM。
下面通过一个具体的实施例进一步描述上述内存分配方法。
本实施例基于非一致性内存访问(non-uniform memory access,NUMA)架构提出,NUMA架构是云计算模式下的计算节点通常采用的一种架构,这种架构的特点是系统中的相关硬件资源(如CPU、内存)被划分为多个节点,从而可以实现高性能计算。图6示出了一种采用NUMA架构的计算节点的结构示意图,该节点可以是多个计算节点300中的任意一个,如图6所示,计算节点400包括多个NUMA节点410,每个NUMA节点410包括处理器411和内存412,每个NUMA节点410上可以运行一个或多个VM。对于采用NUMA架构的计算节点400来说,在运行过程中是以NUMA节点作为内存容量的单位进行内存分配的,换句话说,运行在NUMA节点上的VM是由本地NUMA节点分配内存资源,因此NUMA节点上的内存资源也可以基于上述内存分配方法分配给运行在该节点上的VM。
以计算节点400上的一个NUMA节点410为例:如图7所示,NUMA节点410上运行有VM1、VM2、VM3和VM4,VM1向内存分配装置200发送内存申请请求,内存分配装置200接收到VM1发送的请求后,确定当前NUMA节点410上的可用内存容量与VM1申请的内存容量的差值大于阈值,此处的阈值与上述第一阈值的作用类似,因此,内存分配装置200直接给VM1分配内存。接下来,VM2向内存分配装置200发送内存申请请求,内存分配装置200接收到VM2发送的请求后,确定当前NUMA节点410上的可用内存容量与VM2申请的内存容量的差值小于阈值,此时,内存分配装置200执行迁移VM的相关步骤,例如,确定迁移的VM是VM4。与此同时,内存分配装置200延迟给VM2分配内存。在VM4迁移过程 中,内存分配装置200还依次接收到VM3、VM1、VM2发送的内存申请请求后,对此内存分配装置200还继续使用NUMA节点410上可用的内存资源依次给VM3、VM1、VM2分配内存。之后,VM4迁移完成,并在释放VM4占用的内存后,NUMA节点410上可用的内存资源又重新恢复到大于阈值的状态。
前文中结合图5-图7,详细描述了内存分配装置200的功能,下面结合图8-图11,从内存分配装置200的结构方面,更详细地描述内存分配装置200。
内存分配装置200可以在逻辑上分成多个部分,每个部分具有不同的功能,每个部分可以是软件模块、也可以硬件模块、还可以是软件模块和硬件模块的结合。图8示例性地展示了内存分配装置200的结构示意图。如图8所示,内存分配装置200包括内存管理模块210、策略控制模块220以及调度模块230,其中,内存管理模块210、策略控制模块220以及调度模块230协同工作,以实现上述方法实施例中内存分配装置200执行的步骤。具体地,内存管理模块210用于执行上述S101中判断第一计算节点是否能够满足第一VM所需要的内存的相关步骤,以及上述S102、S107-S108;策略控制模块220用于执行上述S103-S104,以及S109中将内存分配装置200设置为限速状态的相关步骤;调度模块230用于执行上述S105-S106,S109中判断内存分配装置200是否处于限速状态,以及S110-S111。
除此之外,由于本申请实施例中还涉及到迁移一个或多个第二VM到第二计算节点的过程,因此,内存管理模块210还用于在上述一个或多个第二VM迁移到第二计算节点后,在第二计算节点为第二VM分配内存的相关步骤。
应理解,图8所示的结构示意图仅仅是根据功能对上述内存分配装置200进行划分的一种示例性的结构划分方式,本申请并不对内存分配装置200的结构的具体划分方式进行限定。
本申请实施例中,由于内存分配装置200在逻辑上分成多个部分,因此它的部署灵活,可以单独部署在一个计算设备上,也可以分布式部署在多个计算设备上。示例性的,如图9所示,内存分配装置200中的内存管理模块210和策略控制模块220分别部署第一计算节点和第二计算节点上,内存分配装置200中的调度模块230部署其他计算节点上,例如,计算系统100包括管理节点,管理节点与各个计算节点300之间可以相互通信,用于管理上述各个计算节点300,调度模块230可以部署在管理节点上。应理解,本申请实施例不对内存分配装置200的哪些部分具体部署在哪个计算设备进行限制性的划分,实际应用格式可根据具体应用需求进行适应性的部署。
当内存分配装置200单独部署在一个计算设备上时,该计算设备可以是图10示出的计算设备500。如图10所示,计算设备500包括存储器510、处理器520、通信接口530以及总线540,其中,存储器510、处理器520、通信接口530通过总线540实现彼此间的通信连接。
存储器510可以包括只读存储器(read only memory,ROM)、静态存储设备、动态存储设备或者随机存取存储器(random access memory,RAM)等。存储器510可以存储程序代码,例如,内存管理模块210中的计算机程序代码、策略控制模块220中的计算机程序代码以及调度模块230中的计算机程序代码等。当存储器510中存储的程序代码被处理器520执行时,处理器520和通信接口530用于执行内存分配装置200所执行的部分或全部方法(包括上述S101-S111)。存储器510还可以存储数据,存储器510存储的数据包括处理器520在执行过程中产生的中间数据或结果数据,例如,第一内存容量、延迟时间等。
处理器520可以采用CPU、专用集成电路(application specificintegrated circuit,ASIC)、 图形处理器(graphics processing unit,GPU)或者一个或多个集成电路。
处理器520也可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,内存分配装置200的部分功能可以通过处理器520中的硬件的集成逻辑电路或者软件形式的指令完成。处理器520还可以是通用处理器、数据信号处理器(digital signal process,DSP)、现场可编程逻辑门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件,分立门或者晶体管逻辑器件,分立硬件组件,可以实现或者执行本申请实施例中公开的方法、步骤及逻辑框图。处理器520还可以是任何常规的处理器,结合本申请公开的方法可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器、闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器510,处理器520读取存储器510中的信息,结合其硬件完成内存分配装置200的部分或全部功能。
通信接口530使用例如但不限于收发器一类的收发模块,来实现计算设备500与其他设备或通信网络之间的通信。例如,可以通过通信接口730向第一计算设备发送迁移一个或多个目标VM的指令。
总线540可以包括在计算设备500中的各个部件(例如,存储器510、处理器520以及通信接口530)之间传送信息的通路。
当内存分配装置200分布式地部署在多个计算设备上时,内存分配装置200可以部署在如图11所示的计算设备系统600上。如图11所示,计算设备系统600包括多个计算设备700,每个计算设备700包括存储器710、处理器720、通信接口730以及总线740,其中,存储器710、处理器720、通信接口730通过总线740实现彼此之间的通信连接。
存储器710可以是ROM、RAM、静态存储设备或者动态存储设备。存储器710可以存储计算机程序代码,例如,内存管理模块210中的计算机程序代码、策略控制模块220中的计算机程序代码或者调度模块230中的计算机程序代码。当存储器710中存储的计算机程序代码被处理器720执行时,处理器720和通信接口730用于执行内存分配装置200所执行的部分方法(包括上述S101-S111所描述的任意一个或多个步骤)。存储器710还可以存储数据,存储器710中存储的数据包括处理器720在执行过程中产生的中间数据或结果数据,例如,第一内存容量、延迟时间等。
处理器720可以采用CPU、GPU、ASIC、微处理器或者一个或多个集成电路。处理器720也可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,内存分配装置200的部分功能可用通过处理器720中的硬件的集成逻辑电路或者软件形式的指令完成。处理器720还可以是DSP、FPGA、通用处理器、或者其他可编程逻辑器件、分立门、晶体管逻辑器件、分立硬件组件等,可以实现或者执行本申请实施例中公开的方法、步骤及逻辑框图。处理器720还可以是任何常规的处理器,结合本申请公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器、闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器710,处理器720读取存储器710中的信息,结合其硬件完成内存分配装置200的部分功能。
通信接口730使用例如但不限于收发器一类的收发模块,来实现计算设备700与其他设备或通信网络之间的通信。例如,可以通过通信接口730向第一计算设备发送迁移一个或多个目标VM的指令。
总线740可以包括在计算设备700中的各个部件(例如,存储器710、处理器720、通信接口730)之间传送信息的通路。
上述多个计算设备700之间通过通信网络建立通信通路,以实现内存分配装置200的功能。上述多个计算设备700可以包括第一计算节点和第二计算节点。
上述各个附图对应的流程的描述各有侧重,某个流程中没有详细描述的部分,可以参见其他流程的相关描述。
在上述实施例中,可以全部或部分地通过软件、硬件或者其组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。提供内存分配装置200的计算机程序产品包括一个或多个内存分配装置200执行的计算程序代码,在计算设备上加载和执行这些计算机程序代码时,全部或部分地产生按照本申请实施例所述的流程或功能。
上述计算设备可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。上述计算机程序代码可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,上述计算机程序代码可以从一个网站站点、计算机、服务器或数据中心通过有线(例如,同轴电缆、光纤、双绞线或无线(例如,红外、无线、微波)等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。上述计算机可读存储介质存储有提供内存分配装置200的计算机程序程序代码。所述计算机可读存储介质可以是计算设备能够存取的任何可用介质或者是包含一个或多个介质集成的服务器、数据中心等数据存储设备。上述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,光盘)、或者半导体介质(例如,SSD)。

Claims (36)

  1. 一种内存分配方法,其特征在于,包括:
    在第一计算节点不能够满足第一虚拟机VM所需要的内存时,迁移所述第一计算节点上的一个或多个第二VM到第二计算节点;
    在所述第一计算节点为所述第一VM分配内存。
  2. 根据权利要求1所述的方法,其特征在于,所述在所述第一计算节点为所述第一VM分配内存,包括:
    在所述第一计算节点为所述第一VM增加分配内存。
  3. 根据权利要求1所述的方法,其特征在于,所述在所述第一计算节点为所述第一VM分配内存,包括:
    在迁移所述一个或多个第二VM时,延迟在所述第一计算节点为所述第一VM增加分配内存。
  4. 根据权利要求1所述的方法,其特征在于,所述在所述第一计算节点为所述第一VM分配内存,包括:
    在所述第一计算节点为所述第一VM增加分配所述第一VM请求的内存容量。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,如果所述第一计算节点上的可用内存容量与所述第一VM请求的内存容量的差值小于阈值,则所述第一计算节点不能够满足所述第一VM所需要的内存。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,在所述迁移所述第一计算节点上的一个或多个第二VM到第二计算节点之前,所述方法还包括:暂停所述一个或多个第二VM。
  7. 根据权利要求5所述的方法,其特征在于,所述一个或多个第二VM满足以下一个或多个条件:所述一个或多个第二VM占用的总内存容量大于所述阈值,迁移所述一个或多个第二VM所用的时间小于耗尽所述第一计算节点上的可用内存容量所用的时间。
  8. 根据权利要求7所述的方法,其特征在于,所述第二计算节点能够满足所述一个或多个第二VM所需的总内存容量的要求,其中,所述一个或多个第二VM所需的总内存容量包括所述一个或多个第二VM占用的总内存容量。
  9. 根据权利要求8所述的方法,其特征在于,所述迁移所述第一计算节点上的一个或多个第二VM到第二计算节点,包括:
    将所述一个或多个第二VM中的目标第二VM的迁移状态信息发送到所述第二计算节点,其中,所述目标第二VM的迁移状态信息包括所述目标第二VM的物理地址偏移、以及所述目标第二VM在迁移到所述第二计算节点之前向所述第一计算节点请求的内存容量。
  10. 根据权利要求9所述的方法,其特征在于,还包括:
    在所述第二计算节点基于所述目标第二VM的物理地址偏移、以及所述目标第二VM在迁移到所述第二计算节点之前向所述第一计算节点请求的内存容量,为所述目标第二VM分配内存。
  11. 一种内存分配方法,其特征在于,包括:
    在第一计算节点不能够满足第一虚拟机VM所需要的内存时,暂停所述第一VM;
    将所述第一VM从所述第一计算节点迁移到第二计算节点;
    在所述第一计算节点为所述第一计算节点上的第二VM分配内存。
  12. 根据权利要求11所述的方法,其特征在于,如果所述第一计算节点上的可用内存容 量与所述第一VM请求的内存容量的差值小于阈值,则所述第一计算节点不能够满足所述第一VM所需要的内存。
  13. 根据权利要求12所述的方法,其特征在于,所述第二计算节点能够满足所述第一VM占用的内存容量和所述第一VM请求的内存容量的要求。
  14. 根据权利要求13所述的方法,其特征在于,还包括:在所述第二计算节点为所述第一VM分配内存。
  15. 根据权利要求12-14任一项所述的方法,其特征在于,所述将所述第一VM从所述第一计算节点迁移到第二计算节点,包括:
    将所述第一VM的迁移状态信息发送到所述第二计算节点,其中,所述第一VM的迁移状态信息包括所述第一VM请求的内存容量和所述第一VM的物理地址偏移。
  16. 根据权利要求15所述的方法,其特征在于,所述在所述第二计算节点为所述第一VM分配内存,包括:
    在所述第二计算节点基于所述第一VM请求的内存容量和所述第一VM的物理地址偏移为所述第一VM分配内存。
  17. 一种内存分配装置,其特征在于,包括:
    调度模块,用于在第一计算节点不能够满足第一虚拟机VM所需要的内存时,迁移所述第一计算节点上的一个或多个第二VM到第二计算节点;
    内存管理模块,用于在所述第一计算节点为所述第一VM分配内存。
  18. 根据权利要求17所述的装置,其特征在于,
    所述内存管理模块,用于在所述第一计算节点为所述第一VM增加分配内存。
  19. 根据权利要求17所述的装置,其特征在于,
    所述内存管理模块,用于在迁移所述一个或多个第二VM时,延迟在所述第一计算节点为所述第一VM增加分配内存。
  20. 根据权利要求17所述的装置,其特征在于,
    所述内存管理模块,用于在所述第一计算节点为所述第一VM增加分配所述第一VM请求的内存容量。
  21. 根据权利要求17-20任一项所述的装置,其特征在于,如果所述第一计算节点上的可用内存容量与所述第一VM请求的内存容量的差值小于阈值,则所述第一计算节点不能够满足所述第一VM所需要的内存。
  22. 根据权利要求17-21任一项所述的装置,其特征在于,还包括:
    策略控制模块,用于在迁移所述第一计算节点上的一个或多个第二VM到第二计算节点之前,暂停所述一个或多个第二VM。
  23. 根据权利要求21所述的装置,其特征在于,所述一个或多个第二VM满足以下一个或多个条件:所述一个或多个第二VM占用的总内存容量大于所述阈值,迁移所述一个或多个第二VM所用的时间小于耗尽所述第一计算节点上的可用内存容量所用的时间。
  24. 根据权利要求23所述的装置,其特征在于,所述第二计算节点能够满足所述一个或多个第二VM所需的总内存容量的要求,其中,所述一个或多个第二VM所需的总内存容量包括所述一个或多个第二VM占用的总内存容量。
  25. 根据权利要求24所述的装置,其特征在于,
    所述调度模块,用于将所述一个或多个第二VM中的目标第二VM的迁移状态信息发送到所述第二计算节点,其中,所述目标第二VM的迁移状态信息包括所述目标第二VM的物 理地址偏移、以及所述目标第二VM在迁移到所述第二计算节点之前向所述第一计算节点请求的内存容量。
  26. 根据权利要求25所述的装置,其特征在于,
    所述内存管理模块,还用于在所述第二计算节点基于所述目标第二VM的物理地址偏移、以及所述目标第二VM在迁移到所述第二计算节点之前向所述第一计算节点请求的内存容量,为所述目标第二VM分配内存,其中,所述目标第二VM通过所述分配的内存在所述第二计算节点上恢复运行。
  27. 一种内存分配装置,其特征在于,包括:
    策略控制模块,用于在第一计算节点不能够满足第一虚拟机VM所需要的内存时,暂停所述第一VM;
    调度模块,用于将所述第一VM从所述第一计算节点迁移到第二计算节点;
    内存管理模块,用于在所述第一计算节点为所述第一计算节点上的第二VM分配内存。
  28. 根据权利要求27所述的装置,其特征在于,如果所述第一计算节点上的可用内存容量与所述第一VM请求的内存容量的差值小于阈值,则所述第一计算节点不能够满足所述第一VM所需要的内存。
  29. 根据权利要求28所述的装置,其特征在于,所述第二计算节点能够满足所述第一VM占用的内存容量和所述第一VM请求的内存容量的要求。
  30. 根据权利要求29所述的装置,其特征在于,
    所述内存管理模块,还用于在所述第二计算节点为所述第一VM分配内存,其中,所述第一VM通过所述分配的内存在所述第二计算节点上恢复运行。
  31. 根据权利要求28-30任一项所述的装置,其特征在于,
    所述调度模块,用于将所述第一VM的迁移状态信息发送到所述第二计算节点,其中,所述第一VM的迁移状态信息包括所述第一VM请求的内存容量和所述第一VM的物理地址偏移。
  32. 根据权利要求31所述的装置,其特征在于,
    所述内存管理模块,用于在所述第二计算节点基于所述第一VM请求的内存容量和所述第一VM的物理地址偏移为所述第一VM分配内存。
  33. 一种计算系统,其特征在于,包括如前述权利要求17-26任一项所述的内存分配装置、第一计算节点以及第二计算节点,
    所述第一计算节点,运行有第一虚拟机VM、一个或多个第二VM;
    所述内存分配装置,用于在所述第一计算节点不能够满足第一VM所需要的内存时,迁移所述一个或多个第二VM到所述第二计算节点,以及在所述第一计算节点为所述第一VM分配内存。
  34. 一种计算系统,其特征在于,包括如前述权利要求27-32任一项所述的内存分配装置、第一计算节点以及第二计算节点,
    所述第一计算节点,运行有第一虚拟机VM和第二VM;
    所述内存分配装置,用于在所述第一计算节点不能够满足所述第一VM所需要的内存时,暂停所述第一VM,将所述第一VM从所述第一计算节点迁移到所述第二计算节点,以及在所述第一计算节点为所述第二VM分配内存。
  35. 一种计算设备系统,其特征在于,包括处理器和存储器,所述处理器执行所述存储器中的计算机程序代码以实现前述权利要求1-10或11-16任一项所述的方法。
  36. 一种计算机可读存储介质,其特征在于,存储有计算机程序代码,所述计算机程序代码被计算设备系统执行时,所述计算设备系统执行前述权利要求1-10或11-16任一项所述的方法。
PCT/CN2023/074930 2022-03-15 2023-02-08 一种内存分配方法及相关产品 WO2023173961A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210253470.3 2022-03-15
CN202210253470.3A CN116820732A (zh) 2022-03-15 2022-03-15 一种内存分配方法及相关产品

Publications (1)

Publication Number Publication Date
WO2023173961A1 true WO2023173961A1 (zh) 2023-09-21

Family

ID=88022242

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/074930 WO2023173961A1 (zh) 2022-03-15 2023-02-08 一种内存分配方法及相关产品

Country Status (2)

Country Link
CN (1) CN116820732A (zh)
WO (1) WO2023173961A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103198028A (zh) * 2013-03-18 2013-07-10 华为技术有限公司 一种内存数据迁移方法、装置及系统
CN105487928A (zh) * 2014-09-26 2016-04-13 联想(北京)有限公司 一种控制方法、装置及Hadoop系统
CN106598733A (zh) * 2016-12-08 2017-04-26 南京航空航天大学 一种云计算能耗关键的三维度虚拟资源调度方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103198028A (zh) * 2013-03-18 2013-07-10 华为技术有限公司 一种内存数据迁移方法、装置及系统
CN105487928A (zh) * 2014-09-26 2016-04-13 联想(北京)有限公司 一种控制方法、装置及Hadoop系统
CN106598733A (zh) * 2016-12-08 2017-04-26 南京航空航天大学 一种云计算能耗关键的三维度虚拟资源调度方法

Also Published As

Publication number Publication date
CN116820732A (zh) 2023-09-29

Similar Documents

Publication Publication Date Title
US11748278B2 (en) Multi-protocol support for transactions
US20200322287A1 (en) Switch-managed resource allocation and software execution
US10048981B2 (en) Performing virtual machine live migration within a threshold time by adding available network path in multipath network
US10592288B2 (en) Dynamic resource allocation based on data transferring to a tiered storage
US11941458B2 (en) Maintaining storage namespace identifiers for live virtualized execution environment migration
EP3825857B1 (en) Method, device, and system for controlling data read/write command in nvme over fabric architecture
US10203980B2 (en) Dynamic batch management of shared buffers for virtual machines
JP5689526B2 (ja) マルチキュー・ネットワーク・アダプタの動的再構成によるリソース・アフィニティ
US8725875B2 (en) Native cloud computing via network segmentation
WO2015196931A1 (zh) 基于磁盘io的虚拟资源分配方法及装置
US20200356402A1 (en) Method and apparatus for deploying virtualized network element device
US20210089343A1 (en) Information processing apparatus and information processing method
US10592451B2 (en) Memory access optimization for an I/O adapter in a processor complex
JP7467593B2 (ja) リソース割振り方法、記憶デバイス、および記憶システム
US11734172B2 (en) Data transmission method and apparatus using resources in a resource pool of a same NUMA node
US10754577B2 (en) Dynamic flow control for transferring data efficiently and effectively over non-linear buffered network paths
KR101716715B1 (ko) 가상 머신 환경의 네트워크 입출력 장치 가상화 방법 및 장치
US10678684B1 (en) Dynamic virtual storage creation and provisioning of virtual machine resources
US20140289728A1 (en) Apparatus, system, method, and storage medium
KR102640232B1 (ko) 가상화 환경에서의 자원 할당 방법 및 장치
Li et al. A novel disk I/O scheduling framework of virtualized storage system
WO2021120843A1 (zh) 云主机内存分配方法及云主机、设备及存储介质
WO2023173961A1 (zh) 一种内存分配方法及相关产品
EP3436938A1 (en) High density virtual machine container with copy-on-dma-write
JPWO2018173300A1 (ja) I/o制御方法およびi/o制御システム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23769472

Country of ref document: EP

Kind code of ref document: A1