Memory allocation method, memory configuration method, equipment, medium and program product
By building a distributed memory pool and determining allocation priority based on the load state and memory resource state of the computing node, the problem of memory upper limit in traditional memory management is solved, cross-node memory resource scheduling and load balancing are realized, and the performance of the server virtual machine is improved.
Patent Information
- Application Number
- CN202511055563.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-07-30
AI Technical Summary
Traditional memory management solutions are limited by the server's hardware physical boundaries, making it difficult to break through the memory limit, limiting the server's virtual machine carrying capacity and business processing capabilities.
A distributed memory pool across computing nodes is constructed, and the allocation priority of memory resources is determined based on the load state and memory resource state of the computing node, so as to determine the target memory block matching the memory allocation request in the memory pool, and realize memory resource scheduling across nodes.
It breaks through the physical boundary limit of traditional stand-alone memory, realizes resource supplementation when a single node is insufficient and load balancing of multiple computing nodes, and improves the load capacity and business processing capabilities of the server virtual machine.
Smart Images

Figure CN120560784A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed technology, and in particular to a memory allocation method, a memory configuration method, a device, a medium and a program product. Background Art
[0002] With the widespread adoption of cloud computing and virtualization technologies, multi-virtual machine environments have become the mainstream model for deploying business systems in various service organizations. In this model, the dynamic allocation of memory resources is crucial for improving overall resource utilization.
[0003] However, traditional memory management solutions are limited by the physical boundaries of the server's hardware and are unable to break through the memory limit, which limits the server's virtual machine carrying capacity and business processing capabilities. Summary of the Invention
[0004] In view of the above problems, the present invention provides a memory allocation method, a memory configuration method, an apparatus, a device, a medium and a program product.
[0005] One aspect of the present invention provides a memory allocation method, comprising: in response to a target computing node receiving a memory allocation request sent by a computing node to be allocated, determining a target memory block that matches the memory allocation request from a memory pool based on the allocation priority of memory resources in multiple computing nodes, wherein the multiple computing nodes include a target computing node and a computing node to be allocated, the allocation priority is determined by the load status and memory resource status of the computing node, and the memory pool includes the memory resources of multiple computing nodes; and sending address information of the target memory block to the computing node to be allocated so that the computing node to be allocated calls the target memory block based on the address information.
[0006] Another aspect of the present invention provides a memory configuration method, comprising: in response to a computing node to be allocated receiving an initial memory allocation request sent by a virtual machine, comparing the initial memory application amount indicated by the initial memory allocation request with the initial available memory amount of the computing node to be allocated to obtain an initial comparison result; when it is determined that the initial comparison result indicates that the initial available memory amount is less than the initial memory application amount, generating a memory allocation request based on the initial memory allocation request; sending the memory allocation request to a target computing node so that the target computing node determines a target memory block matching the memory allocation request from a memory pool based on an allocation priority for memory resources in a plurality of computing nodes, wherein the plurality of computing nodes include a target computing node and a computing node to be allocated, the allocation priority is determined by a load status and a memory resource status of the computing node, and the memory pool includes memory resources of a plurality of computing nodes; receiving address information of the target memory block sent by the target computing node; and configuring the address information into a configuration file of the virtual machine to bind the virtual machine to the target memory block.
[0007] Another aspect of the present invention provides a memory allocation device, including: a determination module, for determining, in response to a target computing node receiving a memory allocation request sent by a computing node to be allocated, a target memory block matching the memory allocation request from a memory pool based on the allocation priority of memory resources in multiple computing nodes, wherein the multiple computing nodes include a target computing node and a computing node to be allocated, the allocation priority is determined by the load status and memory resource status of the computing node, and the memory pool includes the memory resources of multiple computing nodes; an address sending module, for sending the address information of the target memory block to the computing node to be allocated, so that the computing node to be allocated calls the target memory block based on the address information.
[0008] Another aspect of the present invention provides a memory configuration device, including: a comparison module, for comparing the initial memory application amount indicated by the initial memory allocation request with the initial available memory amount of the computing node to be allocated in response to the computing node to be allocated receiving the initial memory allocation request sent by the virtual machine, to obtain an initial comparison result; a generation module, for generating a memory allocation request based on the initial memory allocation request when it is determined that the initial comparison result indicates that the initial available memory amount is less than the initial memory application amount; a request sending module, for sending the memory allocation request to the target computing node, so that the target computing node determines a target memory block matching the memory allocation request from a memory pool based on the allocation priority of memory resources in multiple computing nodes, wherein the multiple computing nodes include the target computing node and the computing node to be allocated, the allocation priority is determined by the load status and memory resource status of the computing node, and the memory pool includes the memory resources of multiple computing nodes; a receiving module, for receiving the address information of the target memory block sent by the target computing node; and a configuration module, for configuring the address information into the configuration file of the virtual machine to bind the virtual machine to the target memory block.
[0009] Another aspect of the present invention provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0010] Another aspect of the present invention further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the computer program or instructions are executed by a processor.
[0011] Another aspect of the present invention further provides a computer program product, comprising a computer program or instructions, which implement the steps of the above method when executed by a processor.
[0012] According to the memory allocation method of the present invention, by constructing a distributed memory pool across computing nodes, the memory resources of multiple computing nodes are abstracted into a resource memory pool, and based on the allocation priority of the memory resources in each computing node, the target memory block that matches the memory allocation request is determined from the memory pool. Since the memory pool is constructed based on the memory resources of multiple computing nodes, it breaks through the physical boundary limitations of traditional single-machine memory, and the allocation priority of each computing node is obtained based on the load status and memory resource status of each computing node, so that the load and performance status of the computing node itself are taken into account when performing memory resource scheduling. It at least partially solves the technical problem that it is difficult to break through the memory upper limit, resulting in limited server virtual machine load and reduced business processing capabilities, and realizes resource replenishment when a single node has insufficient memory, as well as load balancing of multiple computing nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above contents and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings.
[0014] Figure 1 An application scenario diagram of a memory allocation method and a memory configuration method according to an embodiment of the present invention is shown.
[0015] Figure 2 A flowchart of a memory allocation method according to an embodiment of the present invention is shown.
[0016] Figure 3 A schematic diagram showing the memory states of multiple memory blocks according to an embodiment of the present invention is shown.
[0017] Figure 4 A flow chart of a memory configuration method according to an embodiment of the present invention is shown.
[0018] Figure 5 A flowchart of allocating memory to a virtual machine according to an embodiment of the present invention is shown.
[0019] Figure 6 Shown is a structural block diagram of a memory allocation device according to an embodiment of the present invention.
[0020] Figure 7 Shown is a structural block diagram of a memory configuration device according to an embodiment of the present invention.
[0021] Figure 8 A block diagram of an electronic device suitable for implementing a memory allocation method and a memory configuration method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0022] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concept of the present invention.
[0023] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise," "include," etc. used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0024] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0025] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0026] During the research, we discovered that dynamic allocation of memory resources in a multi-virtual machine environment is key to improving resource utilization. Related technologies often use balloon driver technology to dynamically allocate memory resources. However, this technology dynamically reclaims or allocates memory through the virtual machine memory driver, resulting in issues such as an insurmountable memory limit and severe memory fragmentation.
[0027] In view of this, an embodiment of the present invention provides a memory allocation method, comprising: in response to a target computing node receiving a memory allocation request sent by a computing node to be allocated, determining a target memory block that matches the memory allocation request from a memory pool based on the allocation priority of memory resources in multiple computing nodes, wherein the multiple computing nodes include a target computing node and a computing node to be allocated, the allocation priority is determined by the load status and memory resource status of the computing node, and the memory pool includes the memory resources of multiple computing nodes; sending the address information of the target memory block to the computing node to be allocated, so that the computing node to be allocated calls the target memory block based on the address information.
[0028] Figure 1An application scenario diagram of a memory allocation method and a memory configuration method according to an embodiment of the present invention is shown.
[0029] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first computing node 101, a second computing node 102, and a third computing node 103. The first computing node 101, the second computing node 102, and the third computing node 103 may communicate with each other via a network. The network may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0030] First computing node 101, second computing node 102, and third computing node 103 may be servers. Memory resources in first computing node 101, second computing node 102, and third computing node 103 may constitute a memory pool. Any one of first computing node 101, second computing node 102, and third computing node 103 may be a target computing node or a computing node to be assigned.
[0031] It should be noted that the memory allocation method or memory configuration method provided in the embodiment of the present invention can generally be executed by any one of the first computing node 101, the second computing node 102, and the third computing node 103. Accordingly, the memory allocation device or memory configuration device provided in the embodiment of the present invention can generally be set in any one of the first computing node 101, the second computing node 102, and the third computing node 103.
[0032] It should be understood that Figure 1 The number of the first computing nodes 101, the second computing nodes 102, and the third computing nodes 103 in FIG is merely illustrative. Any number of the first computing nodes 101, the second computing nodes 102, and the third computing nodes 103 may be provided according to implementation requirements.
[0033] The following will be based on Figure 1 The scene described by Figures 2 to 5 The memory allocation method and memory configuration method of the embodiments of the present invention are described in detail.
[0034] Figure 2 A flowchart of a memory allocation method according to an embodiment of the present invention is shown.
[0035] like Figure 2 As shown, the method includes operations S210 to S220, and the memory allocation method can be executed by the target computing node.
[0036] In operation S210, in response to the target computing node receiving a memory allocation request sent by the computing node to be allocated, based on the allocation priority of memory resources in multiple computing nodes, a target memory block matching the memory allocation request is determined from a memory pool, wherein the multiple computing nodes include the target computing node and the computing node to be allocated, the allocation priority is determined by the load status and memory resource status of the computing node, and the memory pool includes the memory resources of multiple computing nodes.
[0037] In operation S220 , the address information of the target memory block is sent to the computing node to be allocated, so that the computing node to be allocated calls the target memory block based on the address information.
[0038] There is no limitation on the implementation of computing nodes, which can be servers, smart terminals, and other devices with computing and communication capabilities.
[0039] The memory resources of multiple computing nodes that comply with the target network protocol can be formed into a memory pool. Multiple computing nodes can communicate using the target network protocol, and the memory pool is shared among the multiple computing nodes.
[0040] There is no restriction on the target network protocol, and it can be a network protocol such as the Compute Express Link (CXL) protocol and the Remote Direct Memory Access (RDMA) protocol.
[0041] If the target network protocol is CXL, CXL provides a high-speed, low-latency interconnection channel from a hardware perspective. Through CXL switches, the physical memory of multiple compute nodes can be connected together, and these multiple compute nodes can have different configurations and performance.
[0042] The memory resources of a compute node can be determined based on the physical memory of that compute node. When managing the memory resources of multiple compute nodes, a unique identifier can be assigned to each compute node's memory resource based on the identifier of the physical memory corresponding to each memory resource. Simultaneously, a memory mapping table can be maintained to record information such as the location, available memory capacity, total memory capacity, and status of each of the multiple compute nodes' memory resources. Since each memory resource includes multiple memory blocks, the memory mapping table can also include information such as the location, address, data capacity, and status of each memory block. Therefore, whenever any of the multiple compute nodes needs to use memory, it can quickly locate an available target memory block using the memory mapping table.
[0043] The target computing node may be a computing node among the multiple computing nodes for managing the memory pool. In addition to managing the memory pool, the computing node also executes computing tasks that the target computing node itself is responsible for.
[0044] When a computing node to be allocated among multiple computing nodes needs insufficient memory resources, a memory allocation request can be sent to a target computing node, so that the target computing node can allocate memory to the computing node to be allocated by executing the above memory allocation method.
[0045] When the target compute node receives a memory allocation request, it searches the memory mapping table for a target memory block that matches the request. If a suitable target memory block is found, it is allocated to the target compute node and its usage status in the memory mapping table is updated.
[0046] The memory resource allocation priority for each compute node is determined based on the node's load and memory resource status. Therefore, the allocation priority reflects the node's load capacity and current load status. Compute nodes with higher performance and lower loads are considered to have greater potential for memory resource supply and, therefore, receive a higher allocation priority.
[0047] When determining the target memory block, the allocation priority of the memory resources in each computing node will be considered, so that the memory blocks in the computing nodes with high allocation priority will be preferentially allocated as target memory blocks to the computing nodes to be allocated, so as to achieve balanced allocation of memory resources.
[0048] After obtaining the target memory block, the status of the target memory block can be checked, such as performing read and write tests on the target memory block, so as to ensure the correctness and stability of the memory block mapping and avoid mapping damaged memory blocks or memory blocks being used by other computing nodes to the computing node to be allocated.
[0049] When it is determined through status check that the target memory block is in an available state, the address of the computing node where the target memory block is located and the address of the target memory block in the computing node can be determined from the memory mapping table, thereby generating the address information of the target memory block and sending it to the computing node to be allocated.
[0050] According to the memory allocation method of the present invention, by constructing a distributed memory pool across computing nodes, the memory resources of multiple computing nodes are abstracted into a resource memory pool, and based on the allocation priority of the memory resources in each computing node, the target memory block that matches the memory allocation request is determined from the memory pool. Since the memory pool is constructed based on the memory resources of multiple computing nodes, it breaks through the physical boundary limitations of traditional single-machine memory, and the allocation priority of each computing node is obtained based on the load status and memory resource status of each computing node, so that the load and performance status of the computing node itself are taken into account when performing memory resource scheduling. It at least partially solves the technical problem that it is difficult to break through the memory upper limit, resulting in limited server virtual machine load and reduced business processing capabilities, and realizes resource replenishment when a single node has insufficient memory, as well as load balancing of multiple computing nodes.
[0051] According to an embodiment of the present invention, determining a target memory block matching a memory allocation request from a memory pool based on allocation priorities of memory resources in multiple computing nodes may include the following operations.
[0052] Compare the available memory amounts of multiple computing nodes with the memory request amounts indicated by the memory allocation request to obtain multiple comparison results; determine, from the multiple computing nodes, at least one candidate computing node whose available memory amount indicated by the comparison result is greater than the memory request amount, wherein the memory resources of the computing node include multiple memory blocks; and determine a target memory block that matches the memory allocation request based on the allocation priority of each memory resource of the at least one candidate computing node and the distribution of available memory blocks in the at least one candidate computing node.
[0053] The available memory amounts of multiple computing nodes can be obtained from the memory mapping table. By comparing the available memory amount with the memory request amount, at least one candidate node with an available memory amount greater than the memory request amount is determined, thereby enabling selection of candidate computing nodes that can provide additional memory resources from a large number of computing nodes.
[0054] Based on the data amount of the available memory blocks in at least one candidate computing node, the distribution of the available memory blocks, and the allocation priority of the memory resources of each candidate computing node, a target memory block that matches the memory allocation request can be determined from the available memory blocks included in at least one candidate computing node.
[0055] According to an embodiment of the present invention, candidate compute nodes are screened by comparing the available memory amounts of multiple compute nodes with the memory requested in a memory allocation request. A target memory block is then determined based on the candidate compute node's allocation priority and the distribution of available memory blocks. This allows for preferential selection of target memory blocks from compute nodes with higher adaptability, while ensuring that the memory allocation request is satisfied.
[0056] According to an embodiment of the present invention, when there are multiple candidate computing nodes, the transmission paths between the computing node to be allocated and each of the multiple candidate computing nodes can be obtained, and at least one closer candidate computing node corresponding to a transmission path including fewer than a preset node threshold can be determined from the multiple candidate computing nodes. Furthermore, based on the allocation priority of each memory resource of the at least one closer candidate computing node and the distribution of available memory blocks in the at least one closer candidate computing node, a target memory block that matches the memory allocation request can be determined.
[0057] You can perform transmission tests on multiple compute nodes and record the transmission paths between them. Transmission nodes can be switches. Because transmission paths with more transmission nodes are typically longer, this results in higher data transmission latency. Therefore, you can eliminate the more distant candidate compute nodes corresponding to longer transmission paths.
[0058] According to an embodiment of the present invention, by focusing on the transmission path between the candidate computing nodes and the computing nodes to be assigned and screening out candidate computing nodes with longer transmission paths, delay control during cross-node memory access can be achieved.
[0059] According to an embodiment of the present invention, determining a target memory block that matches a memory allocation request based on the allocation priority of each memory resource of at least one candidate computing node and the distribution of available memory blocks in at least one candidate computing node may include the following operations.
[0060] When it is determined that the storage capacity of at least one available memory block included in at least one candidate computing node is less than the memory application amount, based on the distribution of the available memory blocks in the at least one candidate computing node, the available memory blocks in adjacent positions in each candidate computing node are merged to obtain adjacent available memory blocks; from the adjacent available memory blocks, at least one candidate available memory block whose data volume is greater than the memory application amount is determined; and the candidate available memory block belonging to the target candidate computing node in the at least one candidate available memory block is used as the target memory block, wherein the target candidate computing node is a candidate computing node whose memory resource allocation priority in the at least one candidate computing node is higher than that of other candidate computing nodes.
[0061] When it is determined that the storage capacity of at least one available memory block included in at least one candidate computing node is less than the memory request amount, for each candidate computing node, the available memory blocks in adjacent positions in the candidate computing node can be merged based on the distribution of the available memory blocks in the candidate computing node, so as to obtain adjacent available memory blocks.
[0062] The comparison of the available memory amount of the computing node with the memory request amount indicated by the memory allocation request may yield a first comparison result. Comparing the data amount of at least one adjacent available memory block with the memory request amount may yield at least one second comparison result. Based on the at least one second comparison result, a candidate available memory block having a data amount greater than the memory request amount may be identified from the at least one adjacent available memory block.
[0063] The candidate computing nodes where each candidate available memory block is located can be determined, and a target candidate computing node with the highest allocation priority can be determined, so that the candidate available memory blocks belonging to the target candidate computing node are used as target memory blocks.
[0064] When it is determined based on at least one second comparison result that the storage capacity of at least one adjacent available memory block is less than or equal to the memory request amount, at least two target memory blocks with a total amount of data equal to the memory request amount can be determined from at least one adjacent available memory block and / or the available memory blocks of each candidate computing node based on the allocation priority of the respective memory resources of at least one candidate computing node.
[0065] When it is determined that a matching available memory block having a storage capacity greater than or equal to the memory request capacity exists in at least one available memory block included in at least one candidate computing node, the matching available memory block may be used as a target memory block.
[0066] According to an embodiment of the present invention, when the available memory capacity of each candidate computing node is less than the requested amount, adjacent available memory blocks are merged to form a candidate available memory block that meets the requirement, thereby ensuring that the allocated memory blocks are contiguous as much as possible and reducing memory fragmentation. Furthermore, the target memory block is selected based on allocation priority, ensuring that resources are allocated from the most preferred candidate node based on priority, thus ensuring load balancing across multiple servers to a certain extent.
[0067] According to an embodiment of the present invention, the address information of the target memory block is generated in the following manner.
[0068] The node address of the target candidate computing node is concatenated with the memory block address of the target memory block to obtain the address information.
[0069] The node address of the target candidate computing node and the memory block address of the target memory block in the target candidate computing node can be obtained from the memory mapping table.
[0070] According to an embodiment of the present invention, address information is generated by concatenating the node address of the target candidate computing node with the memory block address of the target memory block. This can clearly identify the location of the target memory block, ensuring that the computing node to be assigned can accurately identify and call the target memory block.
[0071] According to an embodiment of the present invention, the multiple memory blocks include offline memory blocks whose status is offline; the offline state includes at least one sub-state, and the at least one sub-state has a recovery priority determined by the state generation reason of the sub-state; the above-mentioned memory allocation method may also include the following operations.
[0072] When it is determined based on multiple comparison results that the available memory amounts of multiple computing nodes are all less than the memory request amount, offline memory blocks in an offline state are determined from multiple memory blocks included in each of the multiple computing nodes; and based on the recovery priority of at least one sub-state, the offline memory blocks in at least one computing node are restored to available memory blocks.
[0073] The states of a memory block include available, offline, or in use. An available memory block is a memory block in the available state.
[0074] When the available memory of multiple computing nodes is less than the memory application amount, the offline memory blocks in the offline state can be restored.
[0075] The offline state includes at least one substate, such as a first substate, a second substate, and a third substate. The first substate, the second substate, and the third substate are generated for different reasons. For example, a memory block in the first substate may be an offline memory segment generated by each computing node during coarse-grained memory reduction, a memory block in the second substate may be a reserved page generated by each computing node during fine-grained memory reduction, and a memory block in the third substate may be an offline page at the end of the physical address space left behind by each computing node during fine-grained memory increase.
[0076] Figure 3 A schematic diagram showing the memory states of multiple memory blocks according to an embodiment of the present invention is shown.
[0077] like Figure 3 As shown, the memory pool may include memory blocks in various states, such as: the white part represents the memory block in the available state, the shaded part represents the memory block in the offline state, and the offline state can be further subdivided into a first sub-state 301, a second sub-state 302 and a third sub-state 303.
[0078] pass Figure 3 It can be seen that the memory block in the second sub-state 302 can be a smaller memory block adjacent to other available memory blocks, namely a reserved page, so that if the memory block in the second sub-state 302 is recovered, multiple memory blocks in adjacent positions can be obtained.
[0079] And through Figure 3It can be seen that the memory block in the first sub-state 301 can be a memory block with a large amount of data, that is, it can be considered as a memory segment. Therefore, if the memory block in the first sub-state 301 is restored, a memory block with a large amount of data can be obtained.
[0080] Therefore, the recovery priority can be set for the first substate 301, the second substate 302 and the third substate 303 respectively. When it is determined that the available memory of multiple computing nodes is less than the memory application amount, the recovery priority corresponding to the first substate 301, the second substate 302 and the third substate 303 can be: the recovery priority of the second substate 302 is greater than that of the first substate 301, and the recovery priority of the first substate 301 is greater than that of the third substate 303.
[0081] In some embodiments, in order to speed up the recovery of each memory block, a first-in-first-out queue can be established for memory blocks in different sub-states, so that when recovering memory blocks in their respective sub-states, the memory block that is earliest in the current sub-state can be restored preferentially, such as: giving priority to restoring the earliest retained page, that is, when additional memory is needed, the memory block that is earliest in the second sub-state 302 is directly taken out from the head of the queue and reactivated, avoiding the overhead of reallocating new memory while ensuring the consistency of memory use.
[0082] The total number of offline memory blocks, the number of offline memory blocks belonging to different sub-states, the state generation time of each offline memory block, etc. can be managed in the memory mapping table. For example, the last generated memory block in the second sub-state 302 can be determined based on the state generation time of each offline memory block.
[0083] According to an embodiment of the present invention, when the available memory amount of the computing node cannot meet the requested amount, the offline memory block is determined and restored to the available memory block based on the recovery priority of the sub-state of the offline memory block, thereby realizing the recovery of potential memory resources and improving the utilization rate of memory resources. At the same time, the recovery priority is determined according to the cause of the state generation, which can make the recovery process more in line with actual needs and ensure that the memory blocks that are more easily reused are restored first.
[0084] According to an embodiment of the present invention, a computing node includes multiple virtual machines; the allocation priority of the memory resources of the computing node is determined in the following manner.
[0085] Based on the performance indicators of multiple virtual machines in the computing node during operation, a first state value representing the load state of the computing node is determined; based on the memory usage statistics of the computing node, a second state value representing the memory resource state of the computing node is determined; the first state value and the second state value are weightedly summed to obtain the allocation priority of the memory resources in the computing node.
[0086] You can track data or use monitoring tools on multiple virtual machines within a compute node to collect resource usage data from each virtual machine, such as memory read and write frequency, memory usage, and central processing unit (CPU) usage. This allows you to calculate compute node performance metrics, such as memory usage and CPU usage.
[0087] According to an embodiment of the present invention, based on the indicator value of each performance indicator, a preset load state value corresponding to each indicator value can be determined, thereby performing a weighted summation of at least one preset load state value to obtain a first state value representing the load state of the computing node. For example, if the CPU utilization rate of the computing node is 70%, the corresponding first preset load state value is 7; if the memory utilization rate of the computing node is 80%, the corresponding second preset load state value is 8. By weightedly summing the first preset load state value and the second preset load state value using the preset weights, the first state value representing the load state of the computing node can be obtained.
[0088] Similarly, memory statistics of each computing node may be collected, such as memory occupied amount, memory bandwidth, memory usage, etc. Thus, the second status value may be obtained through the preset resource status values corresponding to the statistical sub-information included in each memory statistical information.
[0089] A time-periodic task can be set or triggered after each memory allocation to calculate the allocation priority of memory resources in each computing node and perform iterative updates, so that the allocation priority of each memory resource in the computing node is valid.
[0090] According to an embodiment of the present invention, a first state value of the load state is determined by using the performance indicators of the virtual machines in the computing node, a second state value of the memory resource state is determined by combining memory usage statistics, and then an allocation priority is obtained through weighted summation. This allocation priority comprehensively reflects the actual load and memory resource status of the computing node, allowing memory allocation based on this to better match the node's carrying capacity and ensure a more reasonable distribution of memory resources across multiple computing nodes.
[0091] Figure 4 A flow chart of a memory configuration method according to an embodiment of the present invention is shown.
[0092] like Figure 4 As shown, the method includes operations S410 to S450, and the memory configuration method can be executed by the computing node to be allocated.
[0093] In operation S410, in response to the computing node to be allocated receiving an initial memory allocation request sent by the virtual machine, the initial memory application amount indicated by the initial memory allocation request is compared with the initial available memory amount of the computing node to be allocated to obtain an initial comparison result.
[0094] In operation S420 , if it is determined that the initial comparison result indicates that the initial available memory amount is less than the initial memory request amount, a memory allocation request is generated based on the initial memory allocation request.
[0095] In operation S430, a memory allocation request is sent to a target computing node so that the target computing node determines a target memory block that matches the memory allocation request from a memory pool based on an allocation priority for memory resources in a plurality of computing nodes, wherein the plurality of computing nodes include a target computing node and computing nodes to be allocated, the allocation priority is determined by a load status and a memory resource status of the computing node, and the memory pool includes memory resources of a plurality of computing nodes.
[0096] In operation S440 , address information of a target memory block sent by a target computing node is received.
[0097] In operation S450 , the address information is configured into a configuration file of the virtual machine to bind the virtual machine to the target memory block.
[0098] The memory request amount can be equal to the initial memory request amount, or can be the sum of the initial memory request amounts of multiple virtual machines in the computing node to be allocated.
[0099] If it is determined that the initial comparison result indicates that the initial available memory amount is greater than or equal to the initial memory request amount, it can be determined whether a target initial available memory block with a storage amount greater than or equal to the initial memory request amount exists in at least one initial available memory block included in the to-be-allocated computing node. If so, the target initial available memory block can be allocated to the virtual machine.
[0100] If no such block exists, a determination can be made based on the distribution of at least one initial available memory block to determine whether an adjacent initial available memory block exists with a data volume greater than or equal to the initial memory request volume. If such an adjacent initial available memory block exists, the adjacent initial available memory block with a data volume greater than or equal to the initial memory request volume is allocated to the virtual machine. If such an adjacent initial available memory block does not exist, a memory allocation request is generated based on the initial memory allocation request. The adjacent initial available memory block can be obtained by merging adjacent initial available memory blocks.
[0101] In some embodiments, in response to the computing node to be allocated receiving the released memory block released by the virtual machine, it can be determined whether there is an adjacent available memory block in the computing node to be allocated that is adjacent to the released memory block. If so, the adjacent available memory block can be merged with the released memory block, thereby merging the two into a larger continuous memory block. This can improve memory utilization and reduce the impact of memory fragmentation.
[0102] When the computing node to be allocated detects that the memory of the virtual machine is insufficient, it will also generate an initial memory allocation request and execute the above resource configuration method.
[0103] By configuring the address information in the virtual machine's configuration file, the requested target memory block can be mapped to the virtual machine's physical memory space. This ensures the correctness and stability of the mapping, allowing the virtual machine to correctly access the newly allocated memory.
[0104] The memory allocation request is generated based on the initial memory allocation request. The memory allocation request may be generated based on the initial memory request amount included in the initial memory allocation request.
[0105] In some embodiments, if the management component of the computing node to be allocated or any of the multiple computing nodes detects that the virtual machine has idle memory, the redundant memory resources are released back to the memory pool for use by other virtual machines.
[0106] When idle memory is detected in a virtual machine, the management component releases the redundant memory back to the memory pool. It also updates the usage status of the memory blocks in the memory map, marking them as available. This allows other virtual machines or compute nodes to access the released memory resources.
[0107] For example, if the management component detects that a virtual machine's memory usage has reached a lower threshold of 20%, and a virtual machine completes a computing task and its memory usage drops from 80% to the set threshold, the management group will release the excess 60% of memory back to the memory pool. Other virtual machines that need memory can then request the released memory from the memory pool as needed.
[0108] According to an embodiment of the present invention, when the available memory blocks of a target compute node cannot satisfy the initial request of a virtual machine, it generates a memory allocation request. The target compute node then determines the target memory block from the memory pool and configures the address information into the virtual machine configuration file to complete the binding. This enables cross-node memory resource scheduling and expands the range of memory resources available to virtual machines.
[0109] Figure 5 A data flow diagram is shown for allocating a target memory block to a virtual machine according to an embodiment of the present invention.
[0110] like Figure 5 As shown, allocating a target memory block to a virtual machine includes operations S501 to S507.
[0111] In operation S501 , a management component in a server to be allocated receives an initial memory allocation request sent by a virtual machine.
[0112] In operation S502, the management component of the computing node to be allocated determines whether the initial memory request amount indicated by the initial memory allocation request is greater than the initial available memory amount of the computing node to be allocated. If the initial memory request amount is greater than the initial available memory amount of the computing node to be allocated, operation S503 is performed. If the initial memory request amount is less than or equal to the initial available memory amount of the computing node to be allocated, operation S507 is performed.
[0113] In operation S503 , the management component of the computing node to be allocated generates a memory allocation request based on the initial memory allocation request.
[0114] In operation S504, in response to the target computing node receiving the memory allocation request sent by the computing node to be allocated, based on the allocation priority of memory resources in multiple computing nodes, a target memory block matching the memory allocation request is determined from the memory pool, wherein the multiple computing nodes include the target computing node and the computing node to be allocated, the allocation priority is determined by the load status and memory resource status of the computing node, and the memory pool includes the memory resources of multiple computing nodes.
[0115] In operation S505 , the target computing node sends the address information of the target memory block to the computing node to be allocated.
[0116] In operation S506 , the management component of the computing node to be allocated configures the address information of the target memory block into the configuration file of the virtual machine.
[0117] In operation S507 , the management component of the computing node to be assigned determines a target memory block from at least one initially available memory block included in the computing node to be assigned, and executes operation S506 .
[0118] According to an embodiment of the present invention, when the target network protocol is the CXL protocol and the computing nodes are servers, multiple servers can be connected via a CXL switch to form a memory pool.
[0119] The memory resources of multiple servers form a memory pool. Multiple servers can be connected through a CXL switch. During the connection process, you need to verify that the CXL interface of each server is working properly and that the CXL switch is configured correctly.
[0120] After the connection between multiple servers is completed, the physical memory of each server can be scanned and identified to obtain basic information about the memory resources in multiple servers, such as size, read and write speed, type, etc. A unique identifier can also be assigned to each memory resource, and the basic information and unique identifier of the physical memory can be recorded in the memory mapping table.
[0121] You can also set some initial parameters, such as the memory pool's upper capacity limit, allocation strategy, etc. For example, you can set the memory pool's upper capacity limit to 1TB and the allocation strategy to prioritize contiguous memory blocks.
[0122] In response to the virtual machines in the servers being in the startup phase, initial memory blocks are allocated to the virtual machines in the servers from the memory pool according to a preset policy.
[0123] When virtual machines on each server start up, initial memory blocks are allocated from the memory pool according to preset policies. These policies can be set based on factors such as the virtual machine type and performance requirements. For example, a high-performance virtual machine can be allocated more initial memory. When allocating initial memory, the memory map table identifies the memory blocks that match each virtual machine. After a virtual machine starts up, the system receives initial memory allocation requests from the virtual machine and updates the size and status of each memory block in the memory map table in real time.
[0124] Based on the above memory allocation method, the present invention also provides a memory allocation device. Figure 6 The device is described in detail.
[0125] Figure 6 Shown is a structural block diagram of a memory allocation device according to an embodiment of the present invention.
[0126] like Figure 6 As shown, the memory allocation device 600 includes a determination module 610 and an address sending module 620 .
[0127] Determination module 610 is used to determine, in response to the target computing node receiving a memory allocation request sent by the computing node to be allocated, a target memory block that matches the memory allocation request from a memory pool based on the allocation priority of memory resources in multiple computing nodes, wherein the multiple computing nodes include the target computing node and the computing node to be allocated, the allocation priority is determined by the load status and memory resource status of the computing node, and the memory pool includes the memory resources of multiple computing nodes.
[0128] The address sending module 620 is used to send the address information of the target memory block to the computing node to be allocated, so that the computing node to be allocated calls the target memory block based on the address information.
[0129] According to an embodiment of the present invention, the determination module 610 may include: a result determination submodule, a node determination submodule, and a memory block determination submodule.
[0130] The result determination submodule is used to compare the available memory amounts of multiple computing nodes with the memory application amounts indicated by the memory allocation request to obtain multiple comparison results.
[0131] The node determination submodule is used to determine at least one candidate computing node from multiple computing nodes, the comparison result indicating that the available memory amount is greater than the memory request amount, wherein the memory resources of the computing node include multiple memory blocks.
[0132] The memory block determination submodule is used to determine a target memory block that matches the memory allocation request based on the allocation priority of each memory resource of at least one candidate computing node and the distribution of available memory blocks in at least one candidate computing node.
[0133] According to an embodiment of the present invention, the memory block determination submodule may include: an adjacent memory block determination unit, a candidate memory block determination unit, and a target memory block determination unit.
[0134] The adjacent memory block determination unit is used to merge the available memory blocks in adjacent positions in each candidate computing node based on the distribution of available memory blocks in at least one candidate computing node when it is determined that the storage capacity of at least one available memory block included in at least one candidate computing node is less than the memory application amount, so as to obtain adjacent available memory blocks.
[0135] The candidate memory block determination unit is used to determine at least one candidate available memory block whose data amount is greater than the memory application amount from adjacent available memory blocks.
[0136] A target memory block determination unit is used to select a candidate available memory block belonging to a target candidate computing node among at least one candidate available memory block as a target memory block, wherein the target candidate computing node is a candidate computing node whose memory resource allocation priority among at least one candidate computing node is higher than that of other candidate computing nodes.
[0137] According to an embodiment of the present invention, the memory allocation device further includes: an information generation module.
[0138] The information generation module is used to concatenate the node address of the target candidate computing node with the memory block address of the target memory block to obtain address information.
[0139] According to an embodiment of the present invention, the plurality of memory blocks also include offline memory blocks in an offline state. The offline state includes at least one sub-state, and the at least one sub-state has a recovery priority determined by a state generation reason of the sub-state. The memory allocation device 600 may further include an offline memory block determination module and a recovery module.
[0140] The offline memory block determination module is used to determine an offline memory block in an offline state from the multiple memory blocks respectively included in the multiple computing nodes when it is determined based on multiple comparison results that the available memory amounts of the multiple computing nodes are all less than the memory application amount.
[0141] The recovery module is configured to recover the offline memory blocks in at least one computing node into available memory blocks based on the recovery priority of at least one sub-state.
[0142] According to an embodiment of the present invention, the computing node includes a plurality of virtual machines. The memory allocation device 600 may further include a first value determination module, a second value determination module, and a computing module.
[0143] The first value determination module is used to determine a first state value representing the load state of the computing node based on performance indicators of multiple virtual machines in the computing node during operation.
[0144] The second value determination module is used to determine a second state value representing the memory resource state of the computing node based on the memory usage statistical information of the computing node.
[0145] The calculation module is used to perform weighted summation on the first state value and the second state value to obtain the allocation priority of the memory resource in the computing node.
[0146] Based on the above memory configuration method, the present invention also provides a memory configuration device. Figure 7 The device is described in detail.
[0147] Figure 7 Shown is a structural block diagram of a memory configuration device according to an embodiment of the present invention.
[0148] like Figure 7 As shown, the memory configuration device 700 includes a comparison module 710 , a generation module 720 , a request sending module 730 , a receiving module 740 and a configuration module 750 .
[0149] The comparison module 710 is used to compare the initial memory application amount indicated by the initial memory allocation request with the initial available memory amount of the computing node to be allocated in response to the computing node to be allocated receiving the initial memory allocation request sent by the virtual machine to obtain an initial comparison result.
[0150] The generating module 720 is configured to generate a memory allocation request based on the initial memory allocation request if it is determined that the initial comparison result indicates that the initial available memory amount is less than the initial memory request amount.
[0151] A request sending module 730 is used to send a memory allocation request to a target computing node so that the target computing node determines a target memory block that matches the memory allocation request from a memory pool based on an allocation priority for memory resources in a plurality of computing nodes, wherein the plurality of computing nodes include a target computing node and computing nodes to be allocated, the allocation priority is determined by a load status and a memory resource status of the computing node, and the memory pool includes memory resources of a plurality of computing nodes.
[0152] The receiving module 740 is configured to receive the address information of the target memory block sent by the target computing node.
[0153] The configuration module 750 is used to configure the address information into the configuration file of the virtual machine to bind the virtual machine to the target memory block.
[0154] According to an embodiment of the present invention, any multiple modules among the determination module 610, the address sending module 620, the comparison module 710, the generation module 720, the request sending module 730, the receiving module 740, and the configuration module 750 may be combined into a single module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in a single module. According to an embodiment of the present invention, at least one of the determination module 610, the address sending module 620, the comparison module 710, the generation module 720, the request sending module 730, the receiving module 740, and the configuration module 750 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or may be implemented in hardware or firmware through any other reasonable means of circuit integration or packaging, or may be implemented in any one of software, hardware, and firmware, or any appropriate combination of these. Alternatively, at least one of the determination module 610, the address sending module 620, the comparison module 710, the generation module 720, the request sending module 730, the receiving module 740 and the configuration module 750 can be at least partially implemented as a computer program module, which can perform the corresponding function when it is executed.
[0155] Figure 8 A block diagram of an electronic device suitable for implementing a memory allocation method and a memory configuration method according to an embodiment of the present invention is shown.
[0156] like Figure 8As shown, an electronic device 800 according to an embodiment of the present invention includes a processor 801, which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 802 or programs loaded from a storage unit 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or related chipsets and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0157] Various programs and data required for the operation of the electronic device 800 are stored in the RAM 803. The processor 801, ROM 802, and RAM 803 are connected to each other via a bus 804. The processor 801 executes the programs in the ROM 802 and / or RAM 803 to perform various operations according to the method flow of the embodiment of the present invention. It should be noted that the programs may also be stored in one or more memories other than the ROM 802 and RAM 803. The processor 801 may also execute the programs stored in the one or more memories to perform various operations according to the method flow of the embodiment of the present invention.
[0158] According to an embodiment of the present invention, electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to bus 804. Electronic device 800 may also include one or more of the following components connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 808 including a hard disk; and a communication section 809 including a network interface card such as a LAN card or modem. Communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. Removable media 811, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 810 as needed, so that computer programs read from the removable media can be installed into storage section 808 as needed.
[0159] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present invention.
[0160] According to an embodiment of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium, and may include, for example, but not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present invention, a computer-readable storage medium may include the ROM 802 and / or RAM 803 described above, and / or one or more memories other than ROM 802 and RAM 803.
[0161] Embodiments of the present invention also include a computer program product comprising a computer program containing program code for executing the method shown in the flowchart. When the computer program product is executed in a computer system, the program code is used to cause the computer system to implement the memory allocation method and memory configuration method provided in the embodiments of the present invention.
[0162] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when executed by the processor 801. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0163] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0164] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 809 and / or installed from a removable medium 811. When the computer program is executed by the processor 801, the above-described functions defined in the system of the embodiment of the present invention are performed. According to the embodiment of the present invention, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.
[0165] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).
[0166] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0167] It will be understood by those skilled in the art that the features described in the various embodiments of the present invention may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in the present invention. In particular, the features described in the various embodiments of the present invention may be combined and / or coupled in various ways without departing from the spirit and teachings of the present invention. All such combinations and / or couplings fall within the scope of the present invention.
[0168] The above describes embodiments of the present invention. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A memory allocation method, characterized in that: The method comprises: In response to the target computing node receiving a memory allocation request sent by the to-be-allocated computing node, determining, from a memory pool, a target memory block that matches the memory allocation request based on allocation priorities of memory resources in a plurality of computing nodes, wherein the plurality of computing nodes include the target computing node and the to-be-allocated computing node, the allocation priorities are determined by a load status and a memory resource status of the computing nodes, and the memory pool includes memory resources of the plurality of computing nodes; The address information of the target memory block is sent to the to-be-allocated computing node, so that the to-be-allocated computing node calls the target memory block based on the address information.
2. The method according to claim 1, characterized in that The determining, from a memory pool, a target memory block matching the memory allocation request based on allocation priorities of memory resources in a plurality of computing nodes comprises: Comparing the available memory amounts of the plurality of computing nodes with the memory application amounts indicated by the memory allocation request to obtain a plurality of comparison results; Determine, from the plurality of computing nodes, at least one candidate computing node whose comparison result indicates that the available memory amount is greater than the memory request amount, wherein the memory resource of the computing node includes a plurality of memory blocks; Based on the allocation priority of each memory resource of at least one of the candidate computing nodes and the distribution of available memory blocks in at least one of the candidate computing nodes, a target memory block matching the memory allocation request is determined.
3. The method according to claim 2, characterized in that The determining, based on the allocation priority of the memory resources of the at least one candidate computing node and the distribution of available memory blocks in the at least one candidate computing node, a target memory block that matches the memory allocation request comprises: When it is determined that the storage capacity of at least one available memory block included in at least one of the candidate computing nodes is less than the memory request amount, based on the distribution of the available memory blocks in the at least one candidate computing node, merging the available memory blocks in adjacent positions in each of the candidate computing nodes to obtain adjacent available memory blocks; Determine at least one candidate available memory block from the adjacent available memory blocks, wherein the amount of data is greater than the memory request amount; A candidate available memory block belonging to a target candidate computing node among at least one of the candidate available memory blocks is used as the target memory block, wherein the target candidate computing node is a candidate computing node whose memory resource allocation priority among at least one of the candidate computing nodes is higher than that of other candidate computing nodes.
4. The method according to claim 3, characterized in that The address information of the target memory block is generated in the following manner: The node address of the target candidate computing node is concatenated with the memory block address of the target memory block to obtain the address information.
5. The method according to claim 2, characterized in that The plurality of memory blocks include an offline memory block in an offline state; the offline state includes at least one sub-state, and at least one of the sub-states has a recovery priority determined by a state generation reason of the sub-state; the method further includes: When it is determined based on the comparison results that the available memory amounts of the plurality of computing nodes are all less than the memory application amount, determining an offline memory block in an offline state from the plurality of memory blocks respectively included in the plurality of computing nodes; Based on the restoration priority of at least one of the sub-states, the offline memory blocks in at least one of the computing nodes are restored as the available memory blocks.
6. The method according to any one of claims 1 or 2, characterized in that The computing node includes multiple virtual machines; the allocation priority of the memory resources of the computing node is determined by: Determining a first state value representing a load state of the computing node based on performance indicators of multiple virtual machines in the computing node during operation; Determining a second state value representing a memory resource state of the computing node based on the memory usage statistical information of the computing node; Performing a weighted summation on the first status value and the second status value to obtain an allocation priority of the memory resource in the computing node.
7. A memory configuration method, characterized in that: The method comprises: In response to the computing node to be allocated receiving the initial memory allocation request sent by the virtual machine, comparing the initial memory application amount indicated by the initial memory allocation request with the initial available memory amount of the computing node to be allocated to obtain an initial comparison result; If it is determined that the initial comparison result indicates that the initial available memory amount is less than the initial memory request amount, generating a memory allocation request based on the initial memory allocation request; Sending the memory allocation request to a target computing node, so that the target computing node determines a target memory block matching the memory allocation request from a memory pool based on allocation priorities for memory resources in a plurality of computing nodes, wherein the plurality of computing nodes include the target computing node and the computing node to be allocated, the allocation priorities are determined by a load status and a memory resource status of the computing node, and the memory pool includes memory resources of the plurality of computing nodes; Receiving the address information of the target memory block sent by the target computing node; The address information is configured into a configuration file of the virtual machine to bind the virtual machine to the target memory block.
8. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Memory expansion method, memory access method, device and system
CN118714104A
Resource scheduling method and device, equipment, storage medium and program product
CN120371509A
Method, device, and system for dynamically allocating memory
WO2017181853A1
Memory management method and system, client, server and storage medium
WO2021254330A1