Memory allocation method, memory allocation method, device, medium and program product

By constructing a distributed memory pool and determining allocation priorities based on the load status and memory resource status of computing nodes, the problem of memory upper limit limitation in traditional memory management is solved, and cross-node scheduling and load balancing of memory resources are realized, thereby improving the virtual machine carrying capacity and business processing capabilities of the server.

CN120560784BActive Publication Date: 2025-11-11INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511055563.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-11-11
Estimated Expiration
2045-07-30

AI Technical Summary

Technical Problem

Traditional memory management solutions are limited by the physical hardware boundaries of servers, making it difficult to exceed memory limits and thus restricting the virtual machine capacity and business processing capabilities of servers.

Method used

A distributed memory pool is constructed across computing nodes. The allocation priority of memory resources is determined based on the load status and memory resource status of the computing nodes. In this way, the target memory block that matches the memory allocation request is identified in the memory pool, thereby realizing cross-node memory resource scheduling.

Benefits of technology

It breaks through the physical boundary limitations of traditional single-machine memory, realizes resource supplementation when a single node is short of memory and load balancing of multiple computing nodes, and improves the carrying capacity and business processing capabilities of server virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120560784B_ABST
    Figure CN120560784B_ABST
Patent Text Reader

Abstract

This invention provides a memory allocation method, a memory configuration method, a device, a medium, and a program product, which can be applied to the field of distributed technology. The method includes: responding to a target computing node receiving a memory allocation request sent by a computing node to be allocated; determining a target memory block matching the memory allocation request from a memory pool based on the allocation priority of memory resources among 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 state and memory resource state of the computing nodes; and the memory pool includes the memory resources of the 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 can call the target memory block based on the address information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed technology, and more specifically to a memory allocation method, memory configuration method, device, medium, and program product. Background Technology

[0002] With the widespread adoption of cloud computing and virtualization technologies, multi-virtual machine environments have become the mainstream deployment mode for various service organizations' business systems. In this mode, the ability to dynamically allocate memory resources becomes key to improving overall resource utilization.

[0003] However, traditional memory management solutions are limited by the physical hardware boundaries of the server, making it difficult to exceed the memory limit, which restricts the virtual machine capacity and business processing capabilities of the server. 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] In one aspect, the present invention provides a memory allocation method, comprising: responding to a target computing node receiving a memory allocation request sent by a computing node to be allocated, determining a target memory block matching the memory allocation request from a memory pool based on an allocation priority for memory resources among 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 state and memory resource state of the computing nodes, and the memory pool includes the memory resources of the multiple computing nodes; and sending the address information of the target memory block to the computing node to be allocated, so that the computing node to be allocated can call the target memory block based on the address information.

[0006] In another aspect, the present invention provides a memory allocation method, comprising: responding to a compute node to be allocated receiving an initial memory allocation request sent by a virtual machine, comparing the initial memory request amount indicated by the initial memory allocation request with the initial available memory amount of the compute node to be allocated, and obtaining 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 compute node, so that the target compute node determines a target memory block matching the memory allocation request from a memory pool based on the allocation priority for memory resources among multiple compute nodes, wherein the multiple compute nodes include the target compute node and the compute node to be allocated, the allocation priority is determined by the load state and memory resource state of the compute nodes, and the memory pool includes the memory resources of the multiple compute nodes; receiving address information of the target memory block sent by the target compute node; and configuring the address information in the virtual machine's configuration file to bind the virtual machine to the target memory block.

[0007] Another aspect of the present invention provides a memory allocation apparatus, comprising: a determining module, configured to, in response to a target computing node receiving a memory allocation request sent by a computing node to be allocated, determine a target memory block matching the memory allocation request from a memory pool based on the allocation priority of memory resources among 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 state and memory resource state of the computing nodes, and the memory pool includes the memory resources of the multiple computing nodes; and an address sending module, configured 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 can call the target memory block based on the address information.

[0008] Another aspect of the present invention provides a memory allocation apparatus, comprising: a comparison module, configured to, in response to a compute node to be allocated receiving an initial memory allocation request sent by a virtual machine, compare the initial memory request amount indicated by the initial memory allocation request with the initial available memory amount of the compute node to be allocated, and obtain an initial comparison result; a generation module, configured to, if it is determined that the initial comparison result indicates that the initial available memory amount is less than the initial memory request amount, generate a memory allocation request based on the initial memory allocation request; a request sending module, configured to send the memory allocation request to a target compute node, so that the target compute node determines a target memory block matching the memory allocation request from a memory pool based on the allocation priority for memory resources among multiple compute nodes, wherein the multiple compute nodes include the target compute node and the compute node to be allocated, the allocation priority is determined by the load state and memory resource state of the compute nodes, and the memory pool includes the memory resources of multiple compute nodes; a receiving module, configured to receive address information of the target memory block sent by the target compute node; and a configuration module, configured to configure the address information into the virtual machine's configuration file 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 method described above.

[0010] Another aspect of the present invention provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.

[0011] Another aspect of the present invention provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.

[0012] According to the memory allocation method of the present invention, a distributed memory pool spanning multiple computing nodes is constructed, abstracting the memory resources of multiple computing nodes into a resource memory pool. The target memory block matching the memory allocation request is determined from the memory pool based on the allocation priority of memory resources in each computing node. 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. Furthermore, the allocation priority of each computing node is obtained based on its load status and memory resource status, ensuring that the load and performance of the computing nodes themselves are considered during memory resource scheduling. This at least partially solves the technical problem of limited server virtual machine capacity and decreased business processing capabilities due to the difficulty in exceeding memory limits, achieving resource supplementation when a single node's memory is insufficient, and load balancing across multiple computing nodes. Attached Figure Description

[0013] The above-mentioned contents, as well as other objects, features and advantages of the present invention, will become clearer from the following description of embodiments of the present invention with reference to the accompanying drawings.

[0014] Figure 1 An application scenario diagram of the memory allocation method and memory configuration method according to embodiments 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 illustrating the memory states of multiple memory blocks according to an embodiment of the present invention is shown.

[0017] Figure 4 A flowchart of a memory configuration method according to an embodiment of the present invention is shown.

[0018] Figure 5 A flowchart illustrating the allocation of memory for a virtual machine according to an embodiment of the present invention is shown.

[0019] Figure 6 A structural block diagram of a memory allocation apparatus according to an embodiment of the present invention is shown.

[0020] Figure 7 A structural block diagram of a memory configuration apparatus according to an embodiment of the present invention is shown.

[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 Implementation

[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 invention. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the invention for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.

[0023] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The terms “comprising,” “including,” etc., as 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 are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0025] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0026] The research revealed that dynamic allocation of memory resources in a multi-virtual machine environment is crucial for improving resource utilization. Many related technologies employ balloon-based dynamic allocation of memory resources; however, this technology dynamically reclaims or allocates memory through virtual machine memory drivers, which suffers from problems such as an insurmountable memory limit and severe memory fragmentation.

[0027] In view of this, embodiments of the present invention provide a memory allocation method, comprising: responding to a target computing node receiving a memory allocation request sent by a computing node to be allocated, determining a target memory block matching the memory allocation request from a memory pool based on the allocation priority for memory resources among 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 state and memory resource state of the computing nodes, and the memory pool includes the memory resources of the multiple computing nodes; and sending the address information of the target memory block to the computing node to be allocated, so that the computing node to be allocated can call the target memory block based on the address information.

[0028] Figure 1The diagram illustrates an application scenario of the memory allocation method and memory configuration method according to an embodiment of the present invention.

[0029] like Figure 1 As shown, 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 can 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, etc.

[0030] The first computing node 101, the second computing node 102, and the third computing node 103 can be servers. The memory resources in the first computing node 101, the second computing node 102, and the third computing node 103 can form a memory pool. Any one of the first computing node 101, the second computing node 102, and the third computing node 103 can be a target computing node or a computing node to be allocated.

[0031] It should be noted that the memory allocation method or memory configuration method provided in the embodiments 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 embodiments of the present invention can generally be disposed 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 node 101, the second computing node 102, and the third computing node 103 is merely illustrative. Depending on the implementation requirements, there can be any number of first computing nodes 101, second computing nodes 102, and third computing nodes 103.

[0033] The following will be based on Figure 1 The described scene, through Figures 2-5 The memory allocation method and memory configuration method of the embodiments of the invention will be 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 this memory allocation method can be executed by the target computing node.

[0036] In operation S210, in response to the target compute node receiving a memory allocation request sent by the compute node to be allocated, a target memory block matching the memory allocation request is determined from the memory pool based on the allocation priority of memory resources among multiple compute nodes. The multiple compute nodes include the target compute node and the compute node to be allocated. The allocation priority is determined by the load status and memory resource status of the compute nodes. The memory pool includes the memory resources of multiple compute 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 can call the target memory block based on the address information.

[0038] There are no restrictions on how computing nodes are implemented; they can be devices with computing and communication capabilities, such as servers and smart terminals.

[0039] The memory resources of multiple computing nodes that conform to the target network protocol can be used to form a memory pool. Multiple computing nodes can communicate using the target network protocol, and the memory pool is shared among multiple computing nodes.

[0040] There are no restrictions on the target network protocol; it can be a network protocol such as Compute Express Link (CXL) or Remote Direct Memory Access (RDMA).

[0041] If the target network protocol is CXL, from a hardware perspective, CXL provides a high-speed, low-latency interconnection channel. Through a CXL switch, the physical memory of multiple compute nodes can be connected together; these compute nodes can have different configurations and performance levels.

[0042] The memory resources of a compute node can be determined based on its physical memory. When managing the memory resources of multiple compute nodes, a unique identifier can be assigned to each node's memory resource based on the identifier of the physical memory corresponding to that resource. Simultaneously, a memory mapping table can be maintained to record information such as the location, available memory amount, total memory amount, and status of memory resources across multiple compute nodes. Since each memory resource comprises multiple memory blocks, the memory mapping table can also include information such as the location, address, data volume, and status of each memory block. Therefore, whenever any compute node needs to use memory, it can quickly find an available target memory block through the memory mapping table.

[0043] The target compute node can be one of multiple compute nodes used to manage the memory pool. In addition to managing the memory pool, the target compute node also executes the compute tasks it is responsible for.

[0044] When a compute node that needs to allocate memory among multiple compute nodes has insufficient memory resources, it can send a memory allocation request to the target compute node. The target compute node can then allocate memory for the compute node by executing the memory allocation method described above.

[0045] When a target compute node receives a memory allocation request, it searches its memory mapping table for a matching target memory block. If a suitable target memory block is found, it allocates it to the target compute node and updates the usage status in the memory mapping table.

[0046] The allocation priority of memory resources in each compute node can be determined based on the node's load status and memory resource status. Therefore, the allocation priority reflects the compute node's load capacity and current load status. Compute nodes with higher performance and lighter loads can be considered to have greater potential for memory resource supply, and thus their allocation priority will be relatively higher.

[0047] The process of determining the target memory block will take into account the allocation priority of memory resources in each computing node, so that memory blocks in computing nodes with high allocation priority will be 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 by performing read and write tests, to ensure the correctness and stability of the memory block mapping and avoid mapping a memory block that is damaged or being used by other computing nodes to the computing node to be allocated.

[0049] If the target memory block is determined to be available through status checks, the address of the compute node where the target memory block is located and the address of the target memory block within that compute node can be determined from the memory mapping table. This generates the address information of the target memory block and sends it to the compute node to be allocated.

[0050] According to the memory allocation method of the present invention, a distributed memory pool spanning multiple computing nodes is constructed, abstracting the memory resources of multiple computing nodes into a resource memory pool. The target memory block matching the memory allocation request is determined from the memory pool based on the allocation priority of memory resources in each computing node. 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. Furthermore, the allocation priority of each computing node is obtained based on its load status and memory resource status, ensuring that the load and performance of the computing nodes themselves are considered during memory resource scheduling. This at least partially solves the technical problem of limited server virtual machine capacity and decreased business processing capabilities due to the difficulty in exceeding memory limits, achieving resource supplementation when a single node's memory is insufficient, and load balancing across 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 the allocation priority of memory resources in multiple computing nodes may include the following operations.

[0052] The available memory of multiple computing nodes is compared with the memory request indicated by the memory allocation request to obtain multiple comparison results; from the multiple computing nodes, at least one candidate computing node is determined whose available memory is greater than the memory request, wherein the memory resources of the computing node include multiple memory blocks; 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, the target memory block that matches the memory allocation request is determined.

[0053] The available memory amounts of multiple compute nodes can be obtained from the memory mapping table. By comparing the available memory amounts with the memory request amounts, at least one candidate node with available memory amounts greater than the memory request amounts can be identified, thereby enabling the selection of candidate compute nodes that can provide additional memory resources from a large number of compute nodes.

[0054] Based on the amount of data in the available memory blocks in at least one candidate computing node, the distribution of the available memory blocks, and the allocation priority of memory resources of each candidate computing node, a target memory block matching the memory allocation request can be determined from the available memory blocks included in each of the at least one candidate computing node.

[0055] According to embodiments of the present invention, candidate computing nodes are selected by comparing the available memory of multiple computing nodes with the memory request amount indicated by the memory allocation request. Then, the target memory block is determined by combining the allocation priority of the candidate computing nodes and the distribution of available memory blocks. This allows for the selection of the target memory block from computing nodes with higher adaptability while ensuring that the memory allocation request is met.

[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. At least one closer candidate computing node is determined from the multiple candidate computing nodes that corresponds to a transmission path containing fewer than a preset node threshold. Based on the allocation priority of the memory resources of each 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 matching the memory allocation request is determined.

[0057] Multiple compute nodes can be tested for transmission, and the transmission paths between each node can be recorded. The transmission nodes can be switches. Since transmission paths with many nodes are typically long, this leads to higher data transmission latency. Therefore, distant candidate compute nodes corresponding to longer transmission paths can be eliminated from the pool of candidate compute nodes.

[0058] According to an embodiment of the present invention, by focusing on the transmission path between candidate computing nodes and the computing nodes to be assigned, and filtering out candidate computing nodes with longer transmission paths, latency 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 memory resources 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] If it is determined that the storage amount of at least one available memory block in at least one candidate computing node is less than the memory request amount, based on the distribution of available memory blocks in 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 with a data amount greater than the memory request amount is determined; the candidate available memory block belonging to the target candidate computing node in the at least one candidate available memory block is taken as the target memory block, wherein the target candidate computing node is the candidate computing node in at least one candidate computing node whose memory resource allocation priority is higher than that of other candidate computing nodes.

[0061] If it is determined that the storage amount of each of the at least one available memory blocks 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 available memory blocks in the candidate computing node, thereby obtaining adjacent available memory blocks.

[0062] The above comparison of the available memory of the computing node with the memory request amount indicated by the memory allocation request yields a first comparison result. By comparing the data volume of at least one adjacent available memory block with the memory request amount, at least one second comparison result can be obtained. Based on this second comparison result, candidate available memory blocks with a data volume greater than the memory request amount can be identified from at least one adjacent available memory block.

[0063] It is possible to determine the candidate computing nodes where each candidate available memory block is located, and then determine the target candidate computing node with the highest allocation priority, so that the candidate available memory block belonging to the target candidate computing node is used as the target memory block.

[0064] If, based on at least one second comparison result, it is determined that the storage amount 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 data amount 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 memory resources of each candidate computing node.

[0065] If a matching available memory block with a storage capacity greater than or equal to the memory request amount exists in at least one available memory block included in at least one candidate computing node, the matching available memory block can be used as the target memory block.

[0066] According to embodiments of the present invention, when the storage capacity of a single available memory block on a 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 requirements. This ensures that the allocated memory blocks are as contiguous as possible, reducing the generation of memory fragmentation. Furthermore, the target memory block is selected based on allocation priority, ensuring resource allocation from better candidate nodes, thus guaranteeing 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 address information is obtained by concatenating the node address of the target candidate computing node with the memory block address of the target memory block.

[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 clearly identifies the location of the target memory block, ensuring that the computing node to be allocated can accurately identify and access the target memory block.

[0071] According to an embodiment of the present invention, the plurality of memory blocks include an offline memory block 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 the state generation cause of the sub-state; the above memory allocation method may further include the following operations.

[0072] If, based on multiple comparison results, it is determined that the available memory of multiple computing nodes is less than the memory request amount, the offline memory blocks in the offline state are identified from the multiple memory blocks included in each of the multiple computing nodes; 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 status of a memory block includes available, offline, or in use. An available memory block is a memory block that is in an available state.

[0074] When the available memory on multiple computing nodes is less than the memory request amount, offline memory blocks that are in an offline state can be restored.

[0075] The offline state includes at least one sub-state, such as: first sub-state, second sub-state, and third sub-state. The reasons for the generation of the first sub-state, second sub-state, and third sub-state are different. For example, the memory block in the first sub-state can be an offline memory segment generated by each computing node when reducing memory in a coarse-grained manner; the memory block in the second sub-state can be a reserved page generated by each computing node when reducing memory in a fine-grained manner; and the memory block in the third sub-state can be an offline page at the end of the physical address space left by each computing node when increasing memory in a fine-grained manner.

[0076] Figure 3 A schematic diagram illustrating 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 can include memory blocks in multiple states, such as: the white part represents memory blocks in the available state, the shaded part represents memory blocks in the offline state, and the offline state can be further subdivided into the first sub-state 301, the second sub-state 302 and the third sub-state 303.

[0078] pass Figure 3 It can be seen that the memory block in the second sub-state 302 can reserve pages for smaller memory blocks adjacent to other available memory blocks. Therefore, if the memory block in the second sub-state 302 is restored, 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, recovery priorities can be set for the first sub-state 301, the second sub-state 302, and the third sub-state 303 respectively. When it is determined that the available memory of multiple computing nodes is less than the memory request amount, the recovery priorities corresponding to the first sub-state 301, the second sub-state 302, and the third sub-state 303 can be: the recovery priority of the second sub-state 302 is greater than that of the first sub-state 301, and the recovery priority of the first sub-state 301 is greater than that of the third sub-state 303.

[0081] In some embodiments, 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. Thus, when recovering memory blocks in their respective sub-states, the memory block that is earliest in the current sub-state can be preferentially recovered. For example, the earliest page that was reserved can be recovered first. That is, when memory needs to be increased, the memory block that is earliest in the second sub-state 302 can be directly taken from the head of the queue and reused, avoiding the overhead of reallocating new memory and ensuring the continuity of memory usage.

[0082] The total number of offline memory blocks, the number of offline memory blocks belonging to different sub-states, and the state generation time of each offline memory block can be managed in the memory mapping table. For example, the last generated memory block in the second sub-state 302 can be determined by the state generation time of each offline memory block.

[0083] According to an embodiment of the present invention, when the available memory of a computing node is insufficient to meet the requested amount, offline memory blocks are identified and restored to available memory blocks based on the recovery priority of the sub-state in which the offline memory blocks are located. This realizes the recovery of potential memory resources and improves the utilization rate of memory resources. At the same time, determining the recovery priority based on the cause of state generation makes the recovery process more in line with actual needs and ensures that more reusable memory blocks are restored first.

[0084] According to an embodiment of the present invention, a computing node includes multiple virtual machines; the allocation priority of memory resources of the computing node is determined in the following manner.

[0085] Based on the performance metrics of multiple virtual machines running in the compute node, a first state value representing the load state of the compute node is determined; based on the memory usage statistics of the compute node, a second state value representing the memory resource state of the compute node is determined; the first state value and the second state value are weighted and summed to obtain the memory resource allocation priority in the compute node.

[0086] By embedding monitoring points or employing monitoring tools within the multiple virtual machines included in a compute node, resource usage data can be collected for each virtual machine, such as memory read / write frequency, memory usage, and CPU usage. This data can then be used to calculate the compute node's performance metrics, such as memory utilization and CPU utilization.

[0087] According to embodiments of the present invention, a preset load state value corresponding to each performance indicator value can be determined based on the indicator value of each indicator. Then, at least one preset load state value is weighted and summed to obtain a first state value characterizing 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 weighting and summing the first preset load state value and the second preset load state value using preset weights, the first state value characterizing the load state of the computing node can be obtained.

[0088] Similarly, memory statistics for each computing node can be collected, such as memory usage, memory bandwidth, and memory utilization. Then, by using the preset resource status values ​​corresponding to the statistical sub-information included in each memory statistic, a second status value can be obtained.

[0089] A time-period task can be set or triggered after each memory allocation to calculate the allocation priority of memory resources in each compute node and perform iterative updates, so that the allocation priority of each memory resource in the compute node is effective.

[0090] According to an embodiment of the present invention, a first state value of the load status is determined by the performance indicators of the virtual machines in the computing node, and a second state value of the memory resource status is determined by combining memory usage statistics. The allocation priority is then obtained through a weighted summation. This allows the allocation priority to comprehensively reflect the actual load and memory resource status of the computing node, making memory allocation based on this more closely aligned with the node's carrying capacity and ensuring a more reasonable allocation of memory resources among multiple computing nodes.

[0091] Figure 4 A flowchart 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 this memory configuration method can be executed by the compute node to be allocated.

[0093] In operation S410, in response to the compute node to be allocated receiving an initial memory allocation request sent by the virtual machine, the initial memory request amount indicated by the initial memory allocation request is compared with the initial available memory amount of the compute node to be allocated, and an initial comparison result is obtained.

[0094] In operation S420, if the initial comparison result indicates that the initial available memory is less than the initial memory request, a memory allocation request is generated based on the initial memory allocation request.

[0095] In operation S430, a memory allocation request is sent to the target compute node so that the target compute node can determine the target memory block that matches the memory allocation request from the memory pool based on the allocation priority for memory resources in multiple compute nodes. The multiple compute nodes include the target compute node and the compute nodes to be allocated. The allocation priority is determined by the load status and memory resource status of the compute nodes. The memory pool includes the memory resources of multiple compute nodes.

[0096] During operation of S440, the address information of the target memory block sent by the target computing node is received.

[0097] When operating the S450, the address information is configured in the virtual machine's configuration file to bind the virtual machine to the target memory block.

[0098] The memory allocation can be equal to the initial memory allocation, or it can be the sum of the initial memory allocations of multiple virtual machines in the compute node to be allocated.

[0099] If the initial comparison result indicates that the initial available memory is greater than or equal to the initial memory request, it can be determined whether there exists a target initial available memory block with a storage capacity greater than or equal to the initial memory request among at least one initial available memory block included in the compute node to be allocated. If so, the target initial available memory block can be allocated to the virtual machine.

[0100] If no such block exists, the distribution of at least one initially available memory block can be used to determine if there are adjacent initially available memory blocks with a data size greater than or equal to the initial memory request size. If such a block exists, it is allocated to the virtual machine; otherwise, a memory allocation request is generated based on the initial memory allocation request. Adjacent initially available memory blocks can be obtained by merging initially available memory blocks located in adjacent positions.

[0101] In some embodiments, in response to the compute node to be allocated receiving a freed memory block released by a virtual machine, it can be determined whether there is an adjacent available memory block in the compute node to be allocated that is adjacent to the freed memory block. If so, the adjacent available memory block can be merged with the freed memory block, thereby merging them into a larger contiguous memory block. This can improve memory utilization and reduce the impact of memory fragmentation.

[0102] When the compute node to be allocated detects that the virtual machine's memory is insufficient, it will also generate an initial memory allocation request and execute the resource configuration method described above.

[0103] By configuring address information in the virtual machine's configuration file, the allocated target memory block can be mapped to the virtual machine's physical memory space. This ensures the correctness and stability of the mapping, enabling the virtual machine to correctly access the newly allocated memory.

[0104] A memory allocation request can be generated based on the initial memory allocation request.

[0105] In some embodiments, if the management component of the compute node to be allocated or any of the compute nodes detects that the virtual machine has idle memory, the redundant memory resources are released back to the memory pool for other virtual machines to use.

[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 block to which the redundant memory belongs in the memory mapping table, marking it as available. This allows other virtual machines or compute nodes to access these released memory resources.

[0107] For example, when the management component detects that a virtual machine's set memory usage threshold is 20%, and a virtual machine completes a computational task, causing its memory usage to drop from 80% to the set threshold, the management team will release the excess 60% of memory back to the memory pool. Other virtual machines that need memory can then request this released memory from the memory pool as needed.

[0108] According to an embodiment of the present invention, when the available memory blocks of the compute node to be allocated cannot satisfy the initial request of the virtual machine, a memory allocation request is generated, and the target compute node determines the target memory block from the memory pool, and then 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 that the virtual machine can obtain.

[0109] Figure 5 A data flow diagram for allocating target memory blocks to a virtual machine according to an embodiment of the present invention is shown.

[0110] like Figure 5 As shown, allocating a target memory block for a virtual machine includes operations S501 to S507.

[0111] In operation S501, the management component in the server to be allocated receives an initial memory allocation request sent by the virtual machine.

[0112] In operation S502, the management component of the compute node to be allocated determines whether the initial memory request indicated by the initial memory allocation request is greater than the initial available memory amount of the compute node to be allocated. If the initial memory request is greater than the initial available memory amount of the compute node to be allocated, operation S503 is executed. If the initial memory request is less than or equal to the initial available memory amount of the compute node to be allocated, operation S507 is executed.

[0113] When operating S503, the management component of the compute 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 compute node receiving a memory allocation request sent by the compute node to be allocated, a target memory block matching the memory allocation request is determined from the memory pool based on the allocation priority of memory resources among multiple compute nodes. The multiple compute nodes include the target compute node and the compute node to be allocated. The allocation priority is determined by the load status and memory resource status of the compute nodes. The memory pool includes the memory resources of multiple compute nodes.

[0115] During S505 operation, the target compute node sends the address information of the target memory block to the compute node to be allocated.

[0116] When operating S506, the management component of the compute node to be allocated configures the address information of the target memory block into the virtual machine's configuration file.

[0117] In operation S507, the management component of the compute node to be allocated determines the target memory block from at least one initially available memory block included in the compute node to be allocated, and performs operation S506.

[0118] According to an embodiment of the present invention, when the target network protocol is the CXL protocol and the computing node is a server, multiple servers can be connected through a CXL switch to form a memory pool.

[0119] The memory resources of multiple servers form a memory pool. Multiple servers can be connected using a CXL switch. During the connection process, it is necessary to verify whether the CXL interface of each server is working properly and whether the CXL switch is configured correctly.

[0120] After establishing connections between multiple servers, the physical memory of each server can be scanned and identified to obtain basic information about the memory resources across the servers, such as size, read / write speed, and type. 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 a memory mapping table.

[0121] You can also set some initial parameters, such as the maximum capacity of the memory pool and the allocation strategy. For example, you can set the maximum capacity of the memory pool to 1TB and the allocation strategy to prioritize the allocation of contiguous memory blocks.

[0122] In response to the virtual machines on each server being in the startup phase, initial memory blocks are allocated from the memory pool to the virtual machines on each server according to a preset policy.

[0123] When virtual machines on each server start up, initial memory blocks can be allocated from the memory pool according to a preset strategy. This preset strategy can be configured based on factors such as the type of virtual machine and performance requirements. For example, more initial memory can be allocated to high-performance virtual machines. During initial memory allocation, memory blocks matching each virtual machine can be determined from the memory mapping table. After the virtual machine starts, the system can receive initial memory allocation requests from the virtual machine and update the size and status information of each memory block in the memory mapping table in real time.

[0124] Based on the above memory allocation method, the present invention also provides a memory allocation device. The following will be combined with... Figure 6 The device is described in detail.

[0125] Figure 6 A structural block diagram of a memory allocation apparatus according to an embodiment of the present invention is shown.

[0126] like Figure 6 As shown, the memory allocation device 600 includes a determination module 610 and an address sending module 620.

[0127] The determination module 610 is used to respond to the target computing node receiving a memory allocation request sent by the computing node to be allocated, and to determine the target memory block that matches the memory allocation request from the memory pool based on the allocation priority of memory resources in multiple computing nodes. 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 nodes. 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 can call the target memory block based on the address information.

[0129] According to an embodiment of the present invention, the determining module 610 may include: a result determining submodule, a node determining submodule, and a memory block determining submodule.

[0130] The result determination submodule is used to compare the available memory of multiple computing nodes with the memory request amount indicated by the memory allocation request, and obtain multiple comparison results.

[0131] The node determination submodule is used to determine at least one candidate computing node from multiple computing nodes whose comparison results indicate 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 the target memory block that matches the memory allocation request based on the allocation priority of the memory resources 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 adjacent available memory blocks in each candidate computing node based on the distribution of available memory blocks in the candidate computing node when the storage amount of at least one available memory block in each candidate computing node is less than the memory request amount.

[0135] The candidate memory block determination unit is used to determine at least one candidate available memory block from adjacent available memory blocks whose data volume is greater than the memory request volume.

[0136] The target memory block determination unit is used to select the candidate available memory block belonging to the target candidate computing node from at least one candidate available memory block as the target memory block, wherein the target candidate computing node is the candidate computing node whose memory resource allocation priority 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 further includes 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 the cause of the sub-state's state generation. 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 the offline memory blocks that are in an offline state from the multiple memory blocks included in each of the multiple computing nodes when the available memory amount of multiple computing nodes is determined to be less than the memory request amount based on multiple comparison results.

[0141] The recovery module is used to restore offline memory blocks in at least one compute node to usable memory blocks based on the recovery priority of at least one sub-state.

[0142] According to an embodiment of the present invention, a computing node includes multiple 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 that characterizes the load state of a compute node based on the performance indicators of multiple virtual machines in the compute node during operation.

[0144] The second value determination module is used to determine a second state value that characterizes the memory resource status of a computing node based on the memory usage statistics of the computing node.

[0145] The calculation module is used to perform a weighted summation of the first and second state values ​​to obtain the allocation priority of memory resources in the computing node.

[0146] Based on the above memory configuration method, the present invention also provides a memory configuration device. The following will be combined with... Figure 7 The device is described in detail.

[0147] Figure 7 A structural block diagram of a memory configuration apparatus according to an embodiment of the present invention is shown.

[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 request indicated by the initial memory allocation request with the initial available memory of the computing node to be allocated in response to the initial memory allocation request sent by the virtual machine on the computing node to be allocated, and to obtain an initial comparison result.

[0150] The generation module 720 is used to generate a memory allocation request based on the initial memory allocation request when the initial comparison result indicates that the initial available memory is less than the initial memory request.

[0151] The request sending module 730 is used to send a memory allocation request to a target compute node so that the target compute node can determine a target memory block that matches the memory allocation request from a memory pool based on the allocation priority of memory resources among multiple compute nodes. The multiple compute nodes include the target compute node and compute nodes to be allocated, the allocation priority is determined by the load status and memory resource status of the compute nodes, and the memory pool includes the memory resources of the multiple compute nodes.

[0152] The receiving module 740 is used to receive the address information of the target memory block sent by the target computing node.

[0153] Configuration module 750 is used to configure address information into the virtual machine's configuration file to bind the virtual machine to the target memory block.

[0154] According to embodiments of the present invention, any plurality of modules among the determining module 610, address sending module 620, comparison module 710, generation module 720, request sending module 730, receiving module 740, and configuration module 750 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of the present invention, at least one of the determining module 610, address sending module 620, comparison module 710, generation module 720, request sending module 730, receiving module 740, and configuration module 750 can be at least partially implemented as hardware circuitry, 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-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in hardware or firmware, or in any one of software, hardware, and firmware implementations, or in a suitable combination of any of these. Alternatively, at least one of the determination module 610, address sending module 620, comparison module 710, generation module 720, request sending module 730, receiving module 740, and configuration module 750 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.

[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 according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage portion 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 an associated chipset 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] RAM 803 stores various programs and data required for the operation of electronic device 800. Processor 801, ROM 802, and RAM 803 are interconnected via bus 804. Processor 801 executes various operations of the method flow according to embodiments of the present invention by executing programs in ROM 802 and / or RAM 803. It should be noted that the programs may also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 may also execute various operations of the method flow according to embodiments of the present invention by executing programs stored in said one or more memories.

[0158] According to an embodiment of the present invention, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the input / output (I / O) interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the 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 it may exist independently and not assembled 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 embodiments of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of the present invention, a computer-readable storage medium may include ROM 802 and / or RAM 803 and / or one or more memories other than ROM 802 and RAM 803 described above.

[0161] Embodiments of the present invention also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the memory allocation method and memory configuration method provided in the embodiments of the present invention.

[0162] When the computer program is executed by the processor 801, it performs the functions defined in the system / apparatus of this invention. According to embodiments of the invention, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0163] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 809, and / or installed from a removable medium 811. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0164] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by processor 801, it performs the functions defined in the system of this embodiment of the invention. According to embodiments of the invention, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0165] According to embodiments of the present invention, program code for executing the computer programs provided in the embodiments of the present invention can be written in any combination of one or more programming languages. Specifically, these computational 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's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0166] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0167] Those skilled in the art will understand that the features described in the various embodiments of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments of the present invention can be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All such combinations and / or combinations fall within the scope of the present invention.

[0168] The embodiments of the present invention have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of the invention. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of the invention, and all such substitutions and modifications should fall within the scope of the invention.

Claims

1. A memory allocation method, characterized in that, The method includes: In response to the target computing node receiving a memory allocation request sent by the computing node to be allocated, a target memory block matching the memory allocation request is determined from the memory pool based on the allocation priority for memory resources among multiple computing nodes. 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 nodes. The memory pool includes the memory resources of the multiple computing nodes. 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 can call the target memory block based on the address information; The step of determining the target memory block matching the memory allocation request from the memory pool based on the allocation priority of memory resources in multiple computing nodes includes: From the plurality of computing nodes, at least one candidate computing node is determined whose available memory is greater than the memory request amount indicated by the memory allocation request; If it is determined that the storage amount 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 available memory blocks in at least one of the candidate computing nodes, the available memory blocks in adjacent positions in each of the candidate computing nodes are merged to obtain adjacent available memory blocks. From the adjacent available memory blocks, determine at least one candidate available memory block whose data volume is greater than the memory request volume; The candidate available memory block belonging to the target candidate computing node among at least one of the candidate available memory blocks is taken as the target memory block, wherein the target candidate computing node is determined based on the allocation priority of the memory resources of at least one of the candidate computing nodes and the respective transmission paths between the computing node to be allocated and at least one candidate computing node; If it is determined that the available memory of multiple computing nodes is less than the memory request amount, an offline memory block in an offline state is determined from the multiple memory blocks included in each of the multiple computing nodes. The offline state includes at least one sub-state, and at least one sub-state has a recovery priority determined by the state generation reason of the sub-state. Based on the recovery priority of at least one of the sub-states, at least one offline memory block in the computing node is restored to the available memory block, wherein the recovery priority is used to control the priority restoration of easily reusable memory blocks.

2. The method according to claim 1, characterized in that, The address information of the target memory block is generated in the following way: The address information is obtained by concatenating the node address of the target candidate computing node with the memory block address of the target memory block.

3. The method according to any one of claims 1 or 2, characterized in that, The compute node includes multiple virtual machines; the allocation priority of the compute node's memory resources is determined in the following way: Based on the performance metrics of multiple virtual machines in the computing node during operation, a first state value characterizing 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 status of the computing node is determined; The first state value and the second state value are weighted and summed to obtain the allocation priority of memory resources in the computing node.

4. A memory configuration method, characterized in that, The method includes: In response to the computing node to be allocated receiving an initial memory allocation request sent by a virtual machine, the initial memory request 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; If the initial comparison result indicates that the initial available memory is less than the initial memory request, a memory allocation request is generated based on the initial memory allocation request. The memory allocation request is sent to the target compute node, so that the target compute node determines a target memory block matching the memory allocation request from the memory pool based on the allocation priority for memory resources among multiple compute nodes. The multiple compute nodes include the target compute node and the compute node to be allocated. The allocation priority is determined by the load status and memory resource status of the compute nodes. The memory pool includes the memory resources of the multiple compute nodes. Receive the address information of the target memory block sent by the target computing node; The address information is configured in the configuration file of the virtual machine to bind the virtual machine to the target memory block. The step of determining the target memory block matching the memory allocation request from the memory pool based on the allocation priority of memory resources in multiple computing nodes includes: From the plurality of computing nodes, at least one candidate computing node is determined whose available memory is greater than the memory request amount indicated by the memory allocation request; If it is determined that the storage amount 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 available memory blocks in at least one of the candidate computing nodes, the available memory blocks in adjacent positions in each of the candidate computing nodes are merged to obtain adjacent available memory blocks. From the adjacent available memory blocks, determine at least one candidate available memory block whose data volume is greater than the memory request volume; The candidate available memory block belonging to the target candidate computing node among at least one of the candidate available memory blocks is taken as the target memory block, wherein the target candidate computing node is determined based on the allocation priority of the memory resources of at least one of the candidate computing nodes and the respective transmission paths between the computing node to be allocated and at least one candidate computing node; If it is determined that the available memory of multiple computing nodes is less than the memory request amount, an offline memory block in an offline state is determined from the multiple memory blocks included in each of the multiple computing nodes. The offline state includes at least one sub-state, and at least one sub-state has a recovery priority determined by the state generation reason of the sub-state. Based on the recovery priority of at least one of the sub-states, at least one offline memory block in the computing node is restored to the available memory block, wherein the recovery priority is used to control the priority restoration of easily reusable memory blocks.

5. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is 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 4.

6. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 4.

7. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Resource scheduling method and device, equipment, storage medium and program product

    CN120371509A