CN118210629A - Memory allocation method and electronic equipment - Google Patents
Memory allocation method and electronic equipment Download PDFInfo
- Publication number
- CN118210629A CN118210629A CN202410362722.5A CN202410362722A CN118210629A CN 118210629 A CN118210629 A CN 118210629A CN 202410362722 A CN202410362722 A CN 202410362722A CN 118210629 A CN118210629 A CN 118210629A
- Authority
- CN
- China
- Prior art keywords
- memory
- expansion device
- bandwidth
- memory expansion
- capacity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000015654 memory Effects 0.000 title claims abstract description 1887
- 238000000034 method Methods 0.000 title claims abstract description 122
- 238000004590 computer program Methods 0.000 claims description 14
- 239000000758 substrate Substances 0.000 claims 1
- 230000008569 process Effects 0.000 description 68
- 230000000875 corresponding effect Effects 0.000 description 32
- 238000010586 diagram Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 8
- 239000008186 active pharmaceutical agent Substances 0.000 description 7
- 101100498818 Arabidopsis thaliana DDR4 gene Proteins 0.000 description 6
- 230000002596 correlated effect Effects 0.000 description 6
- 230000003111 delayed effect Effects 0.000 description 6
- 238000011144 upstream manufacturing Methods 0.000 description 6
- 230000001960 triggered effect Effects 0.000 description 5
- 238000013473 artificial intelligence Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000009977 dual effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000002085 persistent effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 239000011800 void material Substances 0.000 description 2
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000007334 memory performance Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5011—Pool
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the application discloses a memory allocation method and electronic equipment, relates to the technical field of memory management, and is used for providing a memory allocation scheme of a CXL memory pool so as to improve the accuracy of memory allocation of the CXL memory pool. The method comprises the following steps: receiving a memory request of a computing device, wherein the memory request comprises allocation request information and memory demand information, the allocation request information is used for indicating an attribute index of memory expansion equipment requested by the computing device, and the attribute index is a time delay index or a bandwidth index; the memory requirement information is used for indicating a memory index requested by the computing equipment, and the memory index comprises a memory size and a memory type; determining target memory expansion equipment with category matching attribute indexes from the CXL memory pool; and allocating the memory meeting the memory requirement information for the computing device from the target memory expansion device.
Description
Technical Field
The embodiment of the application relates to the technical field of memory management, in particular to a memory allocation method and electronic equipment.
Background
The computing fast link (compute express link, CXL) is a high-speed interconnection technology, which supports multiple computing devices to commonly use a remote pooled memory pool (e.g., referred to as a CXL memory pool), reduces the memory gap between the computing devices and the central processing unit (central processing unit, CPU), and enables high-speed data transmission and memory sharing.
Currently, when performing memory allocation to a CXL memory pool, memory meeting the capacity requirement is typically allocated to a computing device based on the capacity requirement of the memory that the computing device requests to obtain.
However, in the above technical solution, only the index of the capacity requirement of the memory requested by the computing device is referred to, so that the allocated memory performance is not matched with the actual use requirement, and the accuracy of memory allocation is low.
Disclosure of Invention
The embodiment of the application provides a memory allocation method and electronic equipment, which are used for providing a memory allocation scheme of a CXL memory pool so as to improve the accuracy of memory allocation of the CXL memory pool.
In order to achieve the above purpose, the embodiment of the application adopts the following technical scheme:
in one aspect, a memory allocation method is provided, and the method is applied to a management device of a CXL memory pool, and includes:
Receiving a memory request of a computing device; the memory request comprises allocation request information and memory demand information, wherein the allocation request information is used for indicating attribute indexes of memory expansion equipment requested by the computing equipment, and the attribute indexes are time delay indexes or bandwidth indexes; the memory requirement information is used for indicating a memory index requested by the computing device, and the memory index comprises a memory size and a memory type;
determining target memory expansion equipment with the category matching the attribute index from a CXL memory pool of the computing quick link;
and allocating the memory meeting the memory requirement information for the computing device from the target memory expansion device.
In the above technical solution, by carrying allocation request information and memory requirement information in a memory request of a computing device, on one hand, attribute indexes, such as a delay index or a bandwidth index, of a memory expansion device requested by the computing device can be indicated by using the allocation request information, and on the other hand, memory indexes, such as a memory size and a memory type, requested by the computing device can be indicated by using the memory requirement information. Furthermore, the management device can determine the target memory expansion device with the category matching the attribute index from the CXL memory pool, and can realize more targeted memory allocation, thereby meeting the requirements of the computing device on memories with different attributes. And then, the memory meeting the memory demand information is allocated to the computing device from the target memory expansion device, so that the memory allocation efficiency is improved, and the memory allocation accuracy is also effectively improved.
In some possible implementations, the method further includes:
Determining a category of each memory expansion device based on a memory bandwidth or a memory bandwidth and a memory capacity of each memory expansion device in the CXL memory pool; the memory bandwidth is the smallest value of the memory channel bandwidth and the memory link bandwidth.
Thus, by determining the memory channel bandwidth and the memory link bandwidth, the bandwidth value with the smallest value is determined as the memory bandwidth of the memory expansion device. Therefore, not only the total bandwidth of a plurality of memory channels in the memory expansion device is referred, but also the link bandwidth between the memory expansion device and the CXL switch in the CXL memory pool is referred, the information quantity referred by determining the memory bandwidth is increased, and the memory bandwidth with higher accuracy can be determined.
In the implementation manner, the categories of the memory expansion devices in the CXL memory pool are divided according to the memory capacity and the memory bandwidth of the memory expansion devices, so that the CXL memory pool can be finely managed, and the target memory expansion device with the category matched with the attribute index can be quickly and efficiently determined from the category dimension of the memory expansion devices during memory allocation.
In some possible implementations, the class of memory expansion devices includes a bandwidth type memory expansion device and a capacity type memory expansion device, where the bandwidth type memory expansion device refers to a memory expansion device whose memory bandwidth satisfies a first preset condition, and the capacity type memory expansion device refers to a memory expansion device whose memory capacity satisfies a second preset condition.
Determining, from the CXL memory pool, a target memory expansion device having a class matching the attribute indicator, comprising:
under the condition that the attribute index indicated by the allocation request information is a bandwidth index, determining the bandwidth type memory expansion device as a target memory expansion device matched with the attribute index; or alternatively, the first and second heat exchangers may be,
And under the condition that the attribute index indicated by the allocation request information is a time delay index, determining the capacity type memory expansion device as a target memory expansion device matched with the attribute index.
In this way, when the attribute index indicated by the allocation request information is the bandwidth index, the bandwidth type memory expansion device is determined for the computing device, and the memory expansion device with larger bandwidth is used as the preference, so that the requirement of the computing device on bandwidth can be met. Under the condition that the attribute index indicated by the allocation request information is a time delay index, the capacity type memory expansion equipment is determined for the computing equipment, and the memory expansion equipment with larger capacity is used as the optimization, so that the requirement of the computing equipment on time delay can be met. Thus, the requirement of the computing device on different attribute memories is met by determining the target memory expansion device matched with the attribute index.
In some possible implementations, the bandwidth-type memory expansion device and the capacity-type memory expansion device each carry a latency level of memory latency. When the attribute index indicated by the allocation request information is a time delay index, determining the capacity type memory expansion device as a target memory expansion device matching the attribute index, including:
And under the condition that the attribute index indicated by the allocation request information is a time delay index, determining the capacity type memory expansion device of which the time delay level of the memory time delay meets the time delay priority condition as a target memory expansion device matched with the attribute index.
In the implementation manner, by setting the time delay priority condition, the memory expansion device with the minimum time delay can be determined for the computing device under the condition that the attribute index indicated by the allocation request information is the time delay index, and the requirement of the computing device on the time delay can be further met.
In some possible implementations, the class of memory expansion devices further includes an equalization memory expansion device, where the equalization memory expansion device refers to a memory expansion device whose memory bandwidth and memory capacity meet a third preset condition. Under the condition that the attribute index indicated by the allocation request information is a bandwidth index, the target memory expansion device matched with the attribute index further comprises the balanced memory expansion device; or, in the case that the attribute index indicated by the allocation request information is a time delay index, the target memory expansion device matching the attribute index further includes the balanced memory expansion device.
In the implementation manner, other types of memory expansion devices which can be referred to in memory allocation are added, so that when the attribute index indicated by the allocation request information is a bandwidth index or when the attribute index indicated by the allocation request information is a time delay index, the balanced memory expansion device can be used as a candidate memory expansion device, and candidates of the memory expansion device in memory allocation are enriched.
In some possible implementations, in a case where the attribute index indicated by the allocation request information is a bandwidth index, the allocation priority of the bandwidth type memory expansion device is higher than the allocation priority of the balanced type memory expansion device, and the allocation priority of the balanced type memory expansion device is higher than the allocation priority of the capacity type memory expansion device.
That is, when the attribute index indicated by the allocation request information is the bandwidth index, the memory allocation process of the bandwidth type memory expansion device is preferentially executed, the memory allocation process of the equalization type memory expansion device is next selected, and the memory allocation process of the capacity type memory expansion device is next selected. In this way, by setting the allocation priority, the bandwidth type memory expansion device is used as the preference, and the requirement of the computing device on the bandwidth can be met.
In some possible implementations, in a case where the attribute index indicated by the allocation request information is a latency index, the allocation priority of the capacity type memory expansion device is higher than the allocation priority of the balanced type memory expansion device, and the allocation priority of the balanced type memory expansion device is higher than the allocation priority of the bandwidth type memory expansion device.
That is, when the attribute index indicated by the allocation request information is a time delay index, the memory allocation process of the capacity type memory expansion device is preferentially executed, the memory allocation process of the equalization type memory expansion device is secondarily selected and executed, and the memory allocation process of the bandwidth type memory expansion device is secondarily selected and executed. In this way, by setting the allocation priority and taking the capacity type memory expansion device as the preference, the requirement of the computing device on time delay can be met.
In some possible implementations, the memory requirement information indicates that the memory size of the request is a target capacity and the memory type is a target type. Before determining, from the CXL memory pool, a target memory expansion device whose class matches the attribute index, the method further comprises: and determining that the residual memory capacity of the memory expansion device with the target type memory in the CXL memory pool is larger than the target capacity.
In the above implementation manner, by determining that the remaining memory capacity of the memory expansion device having the target type memory in the CXL memory pool is greater than the target capacity, the subsequent memory allocation procedure is executed on the premise that the remaining memory capacity of the memory expansion device having the target type memory in the CXL memory pool is sufficient, thereby improving the reliability of memory allocation.
In some possible implementations, in a case where the attribute index indicated by the allocation request information is a bandwidth index, determining, from the CXL memory pool, a target memory expansion device whose class matches the attribute index includes:
Acquiring an uplink bandwidth of the computing device, determining a bandwidth lower limit allocated to the computing device based on the uplink bandwidth, wherein the uplink bandwidth of the computing device is determined based on the number of links between the computing device and the CXL switch;
And determining whether the target memory expansion device exists or not based on the bandwidth lower limit and a first preset priority order, wherein the first preset priority order is used for indicating the order of the priorities of the memory expansion devices of different categories from high to low under the condition that the attribute index is the bandwidth index.
In the implementation manner, the first preset priority order is maintained, so that the memory allocation is executed according to the first preset priority order under the condition that the attribute index of the request of the computing device is the bandwidth index, the memory matched with the request of the computing device can be allocated preferentially, and the accuracy of the memory allocation is improved.
In some possible implementations, the bandwidth-type memory expansion device, the capacity-type memory expansion device, and the equalization-type memory expansion device each carry a latency level of a memory latency, the latency level including a first-level latency and a second-level latency, the first-level latency indicating a latency less than the second-level latency. Therefore, by carrying the time delay level of the memory time delay for each type of memory expansion equipment, the classified management on the time delay dimension can be realized, and the fine management on the CXL memory pool can be further realized.
In some possible implementations, the first preset priority order is: the system comprises a primary time delay bandwidth type memory expansion device, a primary time delay equalization type memory expansion device, a secondary time delay bandwidth type memory expansion device, a secondary time delay equalization type memory expansion device, a primary time delay capacity type memory expansion device and a secondary time delay capacity type memory expansion device.
That is, when the attribute index indicated by the allocation request information is the bandwidth index, the memory allocation process of the bandwidth type memory expansion device with the first delay is preferentially executed, the memory allocation process of the bandwidth type memory expansion device with the first delay is secondarily selected and executed, the memory allocation process of the bandwidth type memory expansion device with the second delay is secondarily selected and executed, the memory allocation process of the balance type memory expansion device with the second delay is secondarily selected and executed, the memory allocation process of the capacity type memory expansion device with the first delay is secondarily selected and executed, and the memory allocation process of the capacity type memory expansion device with the second delay is secondarily selected and executed. In this way, by setting the allocation priority, the bandwidth type memory expansion device is used as the preference, and the requirement of the computing device on the bandwidth can be met.
In some possible implementations, in a case where the attribute index indicated by the allocation request information is a latency index, determining, from the CXL memory pool, a target memory expansion device whose class matches the attribute index includes:
Determining whether the target memory expansion device exists or not based on a second preset priority order; the second preset priority order is used for indicating the order of the priorities of the memory expansion devices of different categories from high to low when the attribute index is the time delay index.
In the implementation manner, the memory allocation is executed according to the second preset priority order under the condition that the attribute index of the request of the computing device is the time delay index by maintaining the second preset priority order, so that the memory matched with the request of the computing device can be allocated preferentially to the computing device, and the accuracy of the memory allocation is improved.
In some possible implementations, the second preset priority order is: the system comprises a first-stage time delay capacity type memory expansion device, a first-stage time delay balanced type memory expansion device, a first-stage time delay bandwidth type memory expansion device, a second-stage time delay capacity type memory expansion device, a second-stage time delay balanced type memory expansion device and a second-stage time delay bandwidth type memory expansion device.
That is, when the attribute index indicated by the allocation request information is a bandwidth index, the memory allocation process of the capacity type memory expansion device with the first-order delay is preferentially executed, the memory allocation process of the balance type memory expansion device with the first-order delay is secondarily selected, the memory allocation process of the bandwidth type memory expansion device with the first-order delay is secondarily selected, the memory allocation process of the capacity type memory expansion device with the second-order delay is secondarily selected, the memory allocation process of the balance type memory expansion device with the second-order delay is secondarily selected, and the memory allocation process of the bandwidth type memory expansion device with the second-order delay is secondarily selected. In this way, by setting the allocation priority and taking the delay level as the preference, the requirement of the computing device on the delay can be met.
In some possible implementations, the memory bandwidth meeting the first preset condition includes: the memory bandwidth is within a first bandwidth range; or a first parameter value is within a first threshold range, the first parameter value being positively correlated with the memory capacity and negatively correlated with the memory bandwidth; or a second parameter value within a second threshold range, the second parameter value being inversely related to the memory capacity and positively related to the memory bandwidth.
In this implementation manner, three types of first preset conditions for judging whether the memory expansion device is the bandwidth type memory expansion device are provided, and whether the class of the memory expansion device is the bandwidth type memory expansion device can be determined based on any one of the three types of first preset conditions. In this way, the types of the first preset conditions are enriched.
In some possible implementations, the meeting the second preset condition by the memory capacity includes: the memory capacity is within a first capacity range; or the first parameter value is in a third threshold range, and the value in the first threshold range is smaller than the value in the third threshold range; the second parameter value is in a fourth threshold range, and the value in the second threshold range is larger than the value in the fourth threshold range.
In this implementation, three types of second preset conditions for determining whether the memory expansion device is a capacity type memory expansion device are provided, and whether the class of the memory expansion device is a capacity type memory expansion device may be determined based on any one of the three types of second preset conditions. In this way, the types of the second preset conditions are enriched.
In some possible implementations, the first parameter value is a ratio of the memory capacity to the memory bandwidth, or the first parameter value is a difference between the memory capacity and the memory bandwidth.
Therefore, the two types of first parameter values are provided, so that the management device can judge whether the type of the memory expansion device is the bandwidth type memory expansion device according to the ratio of the memory capacity to the memory bandwidth or the difference value of the memory capacity to the memory bandwidth, thereby improving the efficiency of determining the bandwidth type memory expansion device and improving the flexibility of determining the bandwidth type memory expansion device.
In some possible implementations, the second parameter value is a ratio of the memory bandwidth to the memory capacity, or the second parameter value is a difference between the memory bandwidth and the memory capacity. Therefore, the two types of second parameter values are provided, so that the management device can judge whether the type of the memory expansion device is the capacity type memory expansion device according to the ratio of the memory bandwidth to the memory capacity or the difference value of the memory bandwidth to the memory capacity, thereby improving the efficiency of determining the capacity type memory expansion device and improving the flexibility of determining the capacity type memory expansion device.
In some possible implementations, the meeting the third predetermined condition with the memory bandwidth and the memory capacity includes: the memory bandwidth is in a second bandwidth range and the memory capacity is in a second capacity range; or the first parameter value is within a fifth threshold range, the fifth threshold range being between the first threshold range and the third threshold range; or the second parameter value is within a sixth threshold range, the sixth threshold range being between the second threshold range and the fourth threshold range.
In this implementation, three types of third preset conditions for determining whether the memory expansion device is an equilibrium type memory expansion device are provided, and whether the class of the memory expansion device is an equilibrium type memory expansion device may be determined based on any one of the three types of third preset conditions. In this way, the types of the third preset conditions are enriched.
In some possible implementations, if the memory bandwidth of the memory expansion device meets the first preset condition, the class of the memory expansion device is determined to be a bandwidth type memory expansion device. And if the memory capacity of the memory expansion device meets the second preset condition, determining the type of the memory expansion device as the capacity memory expansion device. And if the memory bandwidth and the memory capacity of the memory expansion device meet a third preset condition, determining the type of the memory expansion device as an equilibrium type memory expansion device.
Therefore, the CXL memory pool can be divided into three types of memory expansion devices, namely bandwidth type memory expansion devices, capacity type memory expansion devices and balanced type memory expansion devices, and the CXL memory pool is finely managed.
In some possible implementations, if the memory bandwidth of the memory expansion device meets the first preset condition, determining the class of the memory expansion device as the bandwidth type memory expansion device includes:
If the memory bandwidth of the memory expansion device is within the first bandwidth range, determining the category of the memory expansion device as the bandwidth type memory expansion device; or if the first parameter value is within the first threshold range, determining the category of the memory expansion device as the bandwidth type memory expansion device; or if the second parameter value is within the second threshold range, determining the category of the memory expansion device as the bandwidth type memory expansion device.
In this implementation, three ways of determining whether a bandwidth-type memory expansion device is provided, and whether the class of the memory expansion device is a bandwidth-type memory expansion device may be determined based on any one of the three ways. Thus, the judging mode of the bandwidth type memory expansion device is enriched.
In some possible implementations, if the memory capacity of the memory expansion device meets the second preset condition, determining the class of the memory expansion device as the capacity type memory expansion device includes:
If the memory capacity of the memory expansion device is within the first capacity range, determining the type of the memory expansion device as the capacity type memory expansion device; or if the first parameter value is within the third threshold range, determining the category of the memory expansion device as the capacity memory expansion device; or if the second parameter value is within the fourth threshold range, determining the category of the memory expansion device as the capacity type memory expansion device.
In this implementation manner, three manners of determining whether the memory expansion device is a capacity type memory expansion device are provided, and whether the class of the memory expansion device is a capacity type memory expansion device may be determined based on any one of the three manners. Thus, the judging mode of the capacity type memory expansion device is enriched.
In some possible implementations, if the memory bandwidth and the memory capacity of the memory expansion device meet a third preset condition, determining the class of the memory expansion device as an equilibrium type memory expansion device includes:
If the memory bandwidth is within the second bandwidth range and the memory capacity is within the second capacity range, determining that the class of the memory expansion device is an equilibrium type memory expansion device; or if the first parameter value is within the fifth threshold range, determining the class of the memory expansion device as the balanced memory expansion device; or if the second parameter value is within the sixth threshold range, determining the class of the memory expansion device as the balanced memory expansion device.
In this implementation manner, three manners of determining whether the memory expansion device is an equilibrium-type memory expansion device are provided, and whether the class of the memory expansion device is an equilibrium-type memory expansion device may be determined based on any one of the three manners. Thus, the judging mode of the balanced memory expansion device is enriched.
In some possible implementations, allocating, from the target memory expansion device, memory for the computing device that satisfies the memory requirement information includes:
Determining whether the capacity of the target type of memory of the target memory expansion device is greater than or equal to the target capacity;
And under the condition that the capacity of the memory of the target type of the target memory expansion device is larger than or equal to the target capacity, allocating the memory of the target capacity for the computing device from the target memory expansion device.
In the implementation manner, whether the capacity of the memory of the target type of the target memory expansion device is larger than or equal to the target capacity is determined, so that the subsequent memory allocation flow is executed under the condition that the capacity of the memory of the target type of the target memory expansion device is larger than or equal to the target capacity, and the reliability of memory allocation is improved.
In another aspect, there is provided a memory allocation apparatus, the apparatus comprising:
The receiving module is used for receiving a memory request of the computing equipment; the memory request comprises allocation request information and memory demand information, wherein the allocation request information is used for indicating attribute indexes of memory expansion equipment requested by the computing equipment, and the attribute indexes are time delay indexes or bandwidth indexes; the memory requirement information is used for indicating a memory index requested by the computing device, and the memory index comprises a memory size and a memory type;
The determining module is used for determining target memory expansion equipment with the category matching the attribute index from the CXL memory pool;
and the allocation module is used for allocating the memory meeting the memory requirement information for the computing device from the target memory expansion device.
In another aspect, an electronic device is provided that includes a processor and a memory, the processor and the memory being coupled. The memory is used for storing computer program instructions, and the processor is used for calling the computer program instructions in the memory to execute the memory allocation method shown in the embodiment.
In another aspect, a computer readable storage medium is provided, which stores computer program instructions for causing an electronic device to execute the memory allocation method according to the above embodiment.
In another aspect, a computer program product is provided comprising computer program instructions which, when run on an electronic device, cause the electronic device to perform a memory allocation method as shown in the above embodiments.
Drawings
FIG. 1 is a schematic diagram of a memory allocation system according to an embodiment of the present application;
Fig. 2 is a schematic hardware structure of an electronic device according to an embodiment of the present application;
fig. 3 is a flow chart of a memory allocation method according to an embodiment of the present application;
fig. 4 is a flow chart of a memory allocation method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an example of a memory application according to an embodiment of the present application;
fig. 6 is a schematic flow chart of memory allocation according to an embodiment of the present application;
Fig. 7 is a schematic flow chart of memory allocation according to an embodiment of the present application;
Fig. 8 is an exemplary schematic diagram of a memory allocation system according to an embodiment of the present application;
FIG. 9 is a schematic diagram illustrating an example of memory management according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a memory allocation device according to an embodiment of the present application.
Detailed Description
In the description of the embodiments of the present application, unless otherwise indicated, "/" means "or" and, for example, A/B may mean A or B. "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. Furthermore, "at least one" means one or more, and "a plurality" means two or more. The terms "first," "second," and the like do not limit the number and order of execution, and the terms "first," "second," and the like do not necessarily differ.
It should be noted that, in the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment of the present application is not to be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
CXL is a high-speed interconnection technology, which supports a plurality of computing devices to commonly use a remote pooled memory pool (such as CXL memory pool), reduces memory gaps between the computing devices and CPU, between the computing devices and the computing devices, can realize high-speed data transmission and memory sharing, and provides higher data throughput and lower delay, thereby meeting the requirements of modern computing and storage systems.
Currently, when performing memory allocation to a CXL memory pool, memory meeting the capacity requirement is typically allocated to a computing device based on the capacity requirement of the memory that the computing device requests to obtain. However, in the above technical solution, only the index of the capacity requirement of the memory requested by the computing device is referred to, so that the performance of the allocated memory is not matched with the actual use requirement, and the accuracy of the allocated memory is low.
In view of this, the embodiment of the application provides a memory allocation method, which can be applied to a memory allocation scene of a CXL memory pool. By carrying allocation request information and memory requirement information in a memory request of the computing device, on one hand, attribute indexes of a memory requested by the computing device, such as a delay index or a bandwidth index, can be indicated by using the allocation request information, and on the other hand, memory indexes requested by the computing device, such as a memory size and a memory type, can be indicated by using the memory requirement information. Furthermore, the management device can determine the target memory expansion device with the category matching the attribute index from the CXL memory pool, and can realize more targeted memory allocation, thereby meeting the requirements of the computing device on memories with different attributes. And then, the memory meeting the memory demand information is allocated to the computing device from the target memory expansion device, so that the memory allocation efficiency is improved, and the memory allocation accuracy is also effectively improved.
In some embodiments, the memory allocation method provided by the embodiment of the present application may be applied to a memory allocation system as shown in fig. 1. Fig. 1 is a schematic diagram of a memory allocation system according to an embodiment of the present application. Referring to fig. 1, the memory allocation system includes: computing device 101, management device 102, CXL switch (switch) 103, and multiple memory expansion devices 104.
The computing device 101 refers to a device that applies for memory, that is, a device to which memory is to be allocated. Referring to FIG. 1, computing device 101 may be any of the Host_0 device, host_1 device, … …, host_n device shown in FIG. 1. Wherein n is a positive integer greater than 1.
In some possible implementations, the computing device 101 may be a stand-alone physical server, such as a general-purpose server, a graphics processing (graphics processing unit, GPU) server, an artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) server, or the like, or a server cluster or a distributed file system formed by a plurality of physical servers, or a cloud server that provides at least one of a cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, a content distribution network, and basic cloud computing services such as a big data or artificial intelligence platform, which embodiments of the present application are not limited.
In the embodiment of the present application, the computing device 101 is configured to send a memory request to the management device 102, so as to request the management device 102 to allocate memory for the computing device 101. In some possible implementations, the memory request may carry allocation request information, where the allocation request information is used to indicate an attribute index of the memory expansion device requested by the computing device 101, where the attribute index is a latency index or a bandwidth index. Or in other possible implementations, the memory request may also carry memory requirement information indicating a memory indicator requested by the computing device 101, such as one or more of a memory type (memory type on a memory expansion device), a memory size, a memory speed, etc.
In some possible implementations, the memory request may be triggered automatically by computing device 101. For example, the computing device may automatically trigger a memory request for a task to be processed upon receiving the task to be processed for subsequent processing of the task based on the allocated memory. The task to be processed may be a computing task or a storage task.
In other possible implementations, the memory request may be triggered manually by a user. For example, computing device 101 may be associated with a terminal device upon which a user can trigger computing device 101 to send a memory request to management device 102 by operating. The terminal equipment can be at least one of a smart phone, a desktop computer, a portable computer, a virtual reality terminal and an augmented reality terminal.
The management device 102 refers to a device for allocating memory. In some possible implementations, the management device 102 may be a management node of a CXL memory pool, such as the FM node shown in fig. 1. The management node refers to a server or a processor in the CXL memory pool, which is responsible for memory management. In other possible implementations, the management device 102 may also be other proxy nodes of the CXL memory pool. The proxy node refers to other servers or processors connected with the management node.
In some possible implementations, the management device 102 may operate with a classification management module, an application interface module, and a memory allocation module. The classification management module, the application interface module, and the memory allocation module may be deployed in the management device 102 as three independent modules, or may be deployed in the management device 102 as a single module. The embodiment of the present application is not limited thereto.
The classification management module is used for performing classification management on the memory expansion devices in the CXL memory pool. In the embodiment of the application, the category of each memory expansion device in the CXL memory pool is obtained based on the memory capacity and the memory bandwidth of the memory expansion device. For example, the memory expansion devices in the CXL memory pool may be divided into a bandwidth type memory expansion device and a capacity type memory expansion device by the classification management module. For another example, through the classification management module, the memory expansion devices in the CXL memory pool may be divided into a bandwidth type memory expansion device, a capacity type memory expansion device, and an equilibrium type memory expansion device.
The application interface module is used to provide an application programming interface (application programming interface, API) of the CXL memory pool for the computing device 101. For example, the computing device 101 may be provided with an API for applying for memory, and the computing device 101 may be provided with an API for releasing memory. For the API for applying for the memory, in some possible implementations, APIs corresponding to different attribute indexes, such as APIs corresponding to delay indexes, or APIs corresponding to bandwidth indexes, may also be provided for the computing device 101 based on different attribute indexes.
The memory allocation module is configured to allocate memory for the computing device 101.
In the embodiment of the present application, the management device 102 is configured to receive a memory request of the computing device 101. And determining the target memory expansion device with the category matching attribute indexes from the CXL memory pool. Further, memory satisfying the memory requirement information is allocated to the computing device 101 from the target memory expansion device.
In the memory allocation system shown in fig. 1, a computing device 101 is connected to a management device 102 and a plurality of memory expansion devices 104 via a CXL switch 103. Referring to fig. 1, multiple computing devices, such as host_0 device, host_1 device, etc., may share a CXL memory pool through CXL switch 103.
In one possible implementation, the memory expansion device 104 may be a memory expansion card that may include a memory bank and a CXL controller. For example, referring to FIG. 1, memory banks may be represented by the grid-hatched bars shown in FIG. 1, and CXL controllers may be represented by the diagonally hatched blocks shown in FIG. 1. In some possible implementations, the memory expansion device 104 may include at least one of an accelerator (accelerator), a Dual Inline Memory Module (DIMM), non-volatile storage (non volatile memory, NVMem), persistent memory (PERSISTENT MEMORY, PMEM). The dual inline memory module DIMM may be a fourth generation double rate synchronous dynamic random access memory (doubledata rate synchronous dynamic random access memory, DDR) or a fifth generation DDR, as shown in fig. 1.
In one possible implementation, the management device may be an electronic device, and the hardware structure of the management device may be referred to in fig. 2.
Fig. 2 is a schematic hardware structure of an electronic device according to an embodiment of the present application. The electronic device 200 may include: processor 201, memory 202, communication interface 203, and bus 204. The processor 201, the memory 202 and the communication interface 203 may be connected via a bus 204.
The processor 201 is a control center of the electronic device 200, and may be a central processing unit (central processing unit, CPU) or other types of processors. Among other types of processors, a microprocessor or the like may be used. In the embodiment of the present application, the memory allocation method may be specifically executed by the processor 201 in the electronic device 200.
As an example, processor 201 may include one or more CPUs, such as CPU0 and CPU1 shown in fig. 2.
Memory 202 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), magnetic disk storage or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
In one possible implementation, the memory 202 may exist independent of the processor 201. The memory 202 may be coupled to the processor 201 via the bus 204 for storing data, instructions or program code. The memory allocation method provided by the embodiment of the application can be implemented when the processor 201 calls and executes the instructions or program codes stored in the memory 202.
In another possible implementation, the memory 202 may also be integrated with the processor 201.
A communication interface 203 for the electronic device 200 to connect with other devices through a communication network, which may be an ethernet, a radio access network (radio access network, RAN), a wireless local area network (wireless local area networks, WLAN), etc. The communication interface 203 may include a receiving unit for receiving data, and a transmitting unit for transmitting data.
Bus 204 may be an industry standard architecture (industry standard architecture, ISA) bus, an external device interconnect (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 2, but not only one bus or one type of bus.
It should be noted that the structure shown in fig. 2 does not constitute a limitation of the electronic device 200, and the electronic device 200 may include more or less components than shown in fig. 2, or may combine some components, or may have a different arrangement of components.
Fig. 3 is a flowchart of a memory allocation method according to an embodiment of the present application, where the method is executed by a management device, for example, specifically, may be executed by a processor of the management device. Referring to fig. 3, taking as an example an interaction procedure between a computing device and a management device, the method comprises the following S301-S303:
s301, receiving a memory request of the computing device.
The memory request may include allocation request information indicating an attribute index of the memory expansion device requested by the computing device. The attribute index may be a delay index or a bandwidth index, for example.
The memory request may also include memory requirement information indicating a memory indicator requested by the computing device, such as one or more of a memory type, a memory size, a memory speed, and the like.
S302, determining target memory expansion equipment with category matching attribute indexes from the CXL memory pool.
The categories of the memory expansion devices in the CXL memory pool are obtained based on the memory capacity and the memory bandwidth of the memory expansion devices. For example, the memory expansion devices in the CXL memory pool may be divided into bandwidth-type memory expansion devices and capacity-type memory expansion devices. As another example, the memory expansion devices in the CXL memory pool may also be divided into a bandwidth type memory expansion device, a capacity type memory expansion device, and an equilibrium type memory expansion device.
S303, memory meeting the memory requirement information is allocated for the computing device from the target memory expansion device.
For example, memory banks meeting memory requirement information may be allocated for a computing device from a target memory expansion device.
According to the technical scheme provided by the embodiment of the application, the allocation request information and the memory demand information are carried in the memory request of the computing device, so that on one hand, the allocation request information can be used for indicating the attribute index, such as the time delay index or the bandwidth index, of the memory expansion device requested by the computing device, and on the other hand, the memory demand information can be used for indicating the memory index, such as the memory size and the memory type, requested by the computing device. Furthermore, the management device can determine the target memory expansion device with the category matching the attribute index from the CXL memory pool, and can realize more targeted memory allocation, thereby meeting the requirements of the computing device on memories with different attributes. And then, the memory meeting the memory demand information is allocated to the computing device from the target memory expansion device, so that the memory allocation efficiency is improved, and the memory allocation accuracy is also effectively improved.
Fig. 4 is a flowchart of a memory allocation method according to an embodiment of the present application, where the method is executed by a management device, for example, specifically, may be executed by a processor of the management device. Referring to fig. 4, taking an example of an interaction procedure between a computing device and a management device, the method includes the following S401-S406:
s401, obtaining the memory capacity and the memory bandwidth of each memory expansion device in the CXL memory pool.
The memory capacity of the memory expansion device refers to the size of the storage space of the memory expansion device.
In some possible implementations, the management device may obtain the memory capacity of each memory expansion device in the CXL memory pool through an out-of-band channel.
The memory bandwidth of the memory expansion device refers to the speed at which the memory expansion device can read and write data, and is used for measuring the capacity of carrying data from the memory expansion device in a read-write process.
In some possible implementations, the management device may obtain the memory bandwidth of each memory expansion device in the CXL memory pool through an out-of-band channel.
In some possible implementations, the memory bandwidth of the memory expansion device is the smallest of the memory channel bandwidth and the memory link bandwidth. The memory channel bandwidth refers to the total bandwidth of a plurality of memory channels in the memory expansion device. The memory link bandwidth refers to the link bandwidth between the memory expansion device and the CXL switch in the CXL memory pool.
For memory channel bandwidth, in some possible implementations, for each memory expansion device in the CXL memory pool, the management device may determine the memory channel bandwidth for that memory expansion device based on the number of memory channels included by that memory expansion device and the single channel bandwidth. Where single channel bandwidth refers to the bandwidth of a single memory channel. It should be noted that one memory expansion device may include a plurality of memory channels.
For example, the management device may determine, as the memory channel bandwidth of the memory expansion device, a product of the number of memory channels and the single channel bandwidth based on the number of memory channels included in the memory expansion device, the single channel bandwidth, and the following formula (1).
Memory channel bandwidth = number of memory channels x single channel bandwidth (1)
For the memory link bandwidth, in some possible implementations, for each memory expansion device in the CXL memory pool, the management device may determine, as the memory link bandwidth of the memory expansion device, a theoretical bandwidth of the number of links based on the number of links between the memory expansion device and the CXL switch.
For example, assuming that the number of links between the memory expansion device and the CXL switch is 8, if the memory expansion device and the CXL switch are based on the pcie5.0 protocol, the theoretical bandwidth of the number of links is 32GB/s. Assuming that the number of links between the memory expansion device and the CXL switch is 16, then the theoretical bandwidth for this number of links is 64GB/s.
Thus, the memory channel bandwidth and the memory link bandwidth are determined, so that the bandwidth value with the smallest value is determined as the memory bandwidth of the memory expansion device. Therefore, not only the total bandwidth of a plurality of memory channels in the memory expansion device is referred, but also the link bandwidth between the memory expansion device and the CXL switch in the CXL memory pool is referred, the information quantity referred by determining the memory bandwidth is increased, and the memory bandwidth with higher accuracy can be determined.
S402, determining the category of each memory expansion device based on the memory capacity and the memory bandwidth of each memory expansion device in the CXL memory pool.
In some possible implementations, if the memory bandwidth of the memory expansion device meets a first preset condition, the class of the memory expansion device is determined to be a bandwidth type memory expansion device. In the embodiment of the present application, the bandwidth type memory expansion device refers to a memory expansion device whose memory bandwidth satisfies a first preset condition.
Wherein the memory bandwidth satisfying the first preset condition may include any one of three conditions shown in (1-1) to (1-3) below.
(1-1) The memory bandwidth being within a first bandwidth range.
The first bandwidth range may be a numerical range with a bandwidth greater than or equal to a preset bandwidth threshold. The preset bandwidth threshold is a preset bandwidth threshold, such as a bandwidth threshold with a larger number. It should be appreciated that the first bandwidth range may be a range of larger bandwidth values. Thus, memory expansion equipment with larger bandwidth can be screened out.
(1-2) The first parameter value being within a first threshold range.
The first parameter value is positively correlated with the memory capacity and negatively correlated with the memory bandwidth. That is, the larger the value of the memory capacity, the larger the first parameter value, and the larger the value of the memory bandwidth, the smaller the first parameter value.
In some possible implementations, the first parameter value is a ratio of the memory capacity to the memory bandwidth. In other possible implementations, the first parameter value is a difference between the memory capacity and the memory bandwidth. The setting of the first parameter value in the embodiment of the present application is not limited.
For example, taking the first parameter value as the ratio of the memory capacity to the memory bandwidth as an example, the process of determining the first parameter value by the management device may be: based on the memory capacity, the memory channel bandwidth, the memory link bandwidth, and the following formula (2), a ratio of the memory capacity to the memory bandwidth is determined as the first parameter value.
First parameter value = memory capacity/min (memory channel bandwidth, memory link bandwidth) (2)
As another example, taking the difference between the memory capacity and the memory bandwidth as the first parameter value, the process of determining the first parameter value by the management device may be: and determining a difference between the memory capacity and the memory bandwidth as the first parameter value based on the memory capacity, the memory channel bandwidth, the memory link bandwidth and the following formula (3).
First parameter value = memory capacity-min (memory channel bandwidth, memory link bandwidth) (3)
Therefore, the two types of first parameters are provided, so that the management device can judge the type of the memory expansion device based on the ratio of the memory capacity to the memory bandwidth or the difference value of the memory capacity to the memory bandwidth, thereby improving the efficiency of classification management and the flexibility of classification management.
It should be noted that, in other possible implementations, the first parameter value may be another type of parameter value, which is only required to ensure that the first parameter value is positively correlated with the memory capacity and negatively correlated with the memory bandwidth. The embodiment of the present application is not limited thereto.
In some possible implementations, the first threshold range may be a range of values less than or equal to a first predetermined threshold, such as a range of values less than or equal to 2, such as (0, 2).
(1-3) The second parameter value being within a second threshold range.
A second parameter value is inversely related to the memory capacity and positively related to the memory bandwidth. That is, the larger the value of the memory capacity, the smaller the value of the second parameter, and the larger the value of the memory bandwidth, the larger the value of the second parameter.
In some possible implementations, the second parameter value is a ratio of the memory bandwidth to the memory capacity. In other possible implementations, the second parameter value is a difference between the memory bandwidth and the memory capacity. The setting of the second parameter value in the embodiment of the present application is not limited.
For example, taking the second parameter value as the ratio of the memory bandwidth to the memory capacity as an example, the process of determining the second parameter value by the management device may be: based on the memory capacity, the memory channel bandwidth, the memory link bandwidth, and the following equation (4), a ratio of the memory bandwidth to the memory capacity is determined as the second parameter value.
Second parameter value = min (memory channel bandwidth, memory link bandwidth)/memory capacity (4)
As another example, taking the difference between the memory bandwidth and the memory capacity as the second parameter value, the process of determining the second parameter value by the management device may be: and determining a difference between the memory bandwidth and the memory capacity as the second parameter value based on the memory capacity, the memory channel bandwidth, the memory link bandwidth and the following formula (5).
Second parameter value = min (memory channel bandwidth, memory link bandwidth) -memory capacity (5)
Therefore, two types of second parameter values are provided, so that the management device can judge the type of the memory expansion device based on the ratio of the memory bandwidth to the memory capacity or the difference value of the memory bandwidth to the memory capacity, thereby improving the efficiency of classification management and the flexibility of classification management.
It should be noted that, in other possible implementations, the second parameter value may be another type of parameter value, which is only required to ensure that the second parameter value is inversely related to the memory capacity and positively related to the memory bandwidth. The embodiment of the present application is not limited thereto.
In some possible implementations, the second threshold range may be a range of values greater than a second preset threshold, such as a range of values greater than 4, as in the case of (4, +++). It will be appreciated that the second parameter value being greater than the second preset threshold value indicates that the bandwidth capability is greater than the capacity capability. Thus, memory expansion devices with larger bandwidths can be screened out as well.
In the above (1-1) to (1-3), three types of the first preset conditions are provided, and the types of the first preset conditions are enriched. The management device may determine whether the class of the memory expansion device is a bandwidth type memory expansion device based on any one of the three types of first preset conditions.
In some possible implementations, if the memory bandwidth of the memory expansion device is within the first bandwidth range, determining the class of the memory expansion device as a bandwidth type memory expansion device; or if the first parameter value is in the first threshold range, determining the category of the memory expansion device as the bandwidth type memory expansion device; or if the second parameter value is within the second threshold range, determining the category of the memory expansion device as the bandwidth type memory expansion device. In this implementation, three ways of determining whether a bandwidth-type memory expansion device is provided, and whether the class of the memory expansion device is a bandwidth-type memory expansion device may be determined based on any one of the three ways. Thus, the judging mode of the bandwidth type memory expansion device is enriched.
In still other possible implementations, if the memory capacity of the memory expansion device meets a second preset condition, the class of the memory expansion device is determined to be the capacity type memory expansion device. In the embodiment of the present application, the capacity type memory expansion device refers to a memory expansion device whose memory capacity meets a second preset condition.
Wherein the memory capacity satisfying the second preset condition may include any one of three conditions shown in (2-1) to (2-3) below.
(2-1) The memory capacity being within a first capacity range.
The first capacity range may be a numerical range with a capacity greater than or equal to a preset capacity threshold. The preset capacity threshold is a preset capacity threshold, such as a capacity threshold with a large number. It should be understood that the first capacity range may be a range of larger capacity values. Thus, memory expansion devices with larger capacity can be screened out.
(2-2) The first parameter value being within a third threshold range.
In the embodiment of the application, the value in the first threshold range is smaller than the value in the third threshold range. That is, the third threshold range is a numerical range having a larger value than the first threshold range. For example, the third threshold range may be a range of values greater than a third preset threshold (greater than or equal to the first preset threshold), such as a range of values greater than 4, as in the case of (4, +++). It will be appreciated that the first parameter value being greater than the third preset threshold value indicates that the capacity is greater than the bandwidth capacity. Thus, memory expansion devices with larger capacity can be screened out.
(2-3) The second parameter value being within a fourth threshold range.
In the embodiment of the present application, the value in the second threshold range is larger than the value in the fourth threshold range. That is, the fourth threshold range is a smaller value range than the second threshold range. For example, the fourth threshold range may be a range of values less than or equal to a fourth predetermined threshold (less than or equal to a second predetermined threshold), such as a range of values less than or equal to 2, such as (0, 2).
In the above (2-1) to (2-3), three types of second preset conditions are provided, and the types of the second preset conditions are enriched. The management device may determine whether the class of the memory expansion device is a capacity type memory expansion device based on any one of the three types of second preset conditions.
In some possible implementations, if the memory capacity corresponding to the memory expansion device is within the first capacity range, determining the class of the memory expansion device as the capacity type memory expansion device; or if the first parameter value is in the third threshold range, determining the type of the memory expansion device as the capacity memory expansion device; or if the second parameter value is within the fourth threshold range, determining the category of the memory expansion device as the capacity type memory expansion device. In this implementation manner, three manners of determining whether the memory expansion device is a capacity type memory expansion device are provided, and the management device may determine whether the class of the memory expansion device is the capacity type memory expansion device based on any one of the three manners. Thus, the judging mode of the capacity type memory expansion device is enriched.
In other possible implementations, if the memory bandwidth and the memory capacity corresponding to the memory expansion device satisfy the third preset condition, the class of the memory expansion device is determined to be the balanced memory expansion device. In the embodiment of the present application, the balanced memory expansion device refers to a memory expansion device whose memory bandwidth and memory capacity meet a third preset condition.
Wherein the memory bandwidth and the memory capacity satisfying the third preset condition may include any one of three conditions as shown in (3-1) to (3-3) below.
(3-1) The memory bandwidth being within a second bandwidth range and the memory capacity being within a second capacity range.
The second bandwidth range may be a numerical range with a bandwidth smaller than a preset bandwidth threshold. It should be appreciated that the second bandwidth range may be a range with a smaller bandwidth value. The second capacity range may be a range of values having capacities less than a preset capacity threshold. It should be understood that the second capacity range may be a range in which the capacity value is smaller.
(3-2) The first parameter value being within a fifth threshold range.
In an embodiment of the present application, the fifth threshold range is between the first threshold range and the third threshold range. For example, the fifth threshold range may be a range of values greater than the first preset threshold and less than or equal to the third preset threshold, such as a range of values greater than 2 and less than or equal to 4, such as (2, 4).
(3-3) The second parameter value being within a sixth threshold range.
In an embodiment of the present application, the sixth threshold range is between the second threshold range and the fourth threshold range. For example, the sixth threshold range may be a range of values greater than the fourth preset threshold and less than or equal to the second preset threshold, such as a range of values greater than 2 and less than or equal to 4, such as (2, 4).
In the above (3-1) to (3-3), three types of third preset conditions are provided, and the types of the third preset conditions are enriched. The management device may determine whether the class of the memory expansion device is the balanced memory expansion device based on any one of the three types of third preset conditions.
In some possible implementations, if the memory bandwidth is within the second bandwidth range and the memory capacity is within the second capacity range, determining the class of the memory expansion device as an equilibrium type memory expansion device; or if the first parameter is in the fifth threshold range, determining the category of the memory expansion device as balanced memory expansion device; or if the second parameter is within the sixth threshold range, determining the class of the memory expansion device as the balanced memory expansion device. In this implementation manner, three manners of determining whether the memory expansion device is an equilibrium-type memory expansion device are provided, and whether the class of the memory expansion device is an equilibrium-type memory expansion device may be determined based on any one of the three manners. Thus, the judging mode of the balanced memory expansion device is enriched.
In the above embodiment, the respective memory expansion devices in the CXL memory pool are classified and managed according to the memory capacity and the memory bandwidth corresponding to the respective memory expansion devices, so that the CXL memory pool can be divided into three types of memory expansion devices, i.e., a bandwidth type memory expansion device, a capacity type memory expansion device, and an equilibrium type memory expansion device, thereby implementing the fine management of the CXL memory pool.
It should be noted that, in other possible implementations, the CXL memory pool may also be divided into two types of memory expansion devices, i.e., a bandwidth type memory expansion device and a capacity type memory expansion device. The embodiment of the present application is not limited thereto.
In addition, in some possible implementations, the bandwidth-type memory expansion device, the capacity-type memory expansion device, and the equalization-type memory expansion device may each carry a latency level of a memory latency. For example, the level of delay may include a primary delay and a secondary delay, the primary delay indicating a delay that is less than the secondary delay.
In one possible implementation, the latency level of each memory expansion device is determined based on the number of stages of the CXL switch spanned by each memory expansion device. Illustratively, a primary delay may represent a delay that occurs across a level 1 CXL switch and a secondary delay may represent a delay that occurs across a level 2 CXL switch.
Therefore, by carrying the time delay level of the memory time delay for each type of memory expansion equipment, the classified management on the time delay dimension can be realized, and the fine management on the CXL memory pool can be further realized.
S403, receiving a memory request of the computing device.
Wherein the memory request is for requesting allocation of memory in the CXL memory pool for the computing device. In some possible implementations, the memory request may carry allocation request information indicating an attribute indicator of the memory expansion device requested by the computing device. The attribute index may be a delay index or a bandwidth index, for example.
In some possible implementations, the latency indicator may be used to indicate latency indicator requirements, such as memory latency being small. It should be understood that if the attribute index indicated by the allocation request information is a latency index, it indicates that the computing device requests to obtain the memory with smaller memory latency. In some possible implementations, the delay indicator may also be used to indicate a delay indicator value or an indicator range, e.g., the indicator value may be a delay value of the memory delay, and the indicator range may be a range of values in which the memory delay is located.
In the embodiment of the application, the bandwidth index can be used for indicating the bandwidth index requirement, such as the memory bandwidth is large. It should be understood that if the attribute index indicated by the allocation request information is a bandwidth index, it indicates that the computing device requests to obtain a memory with a larger memory bandwidth. In some possible implementations, the bandwidth indicator may also be used to indicate a bandwidth indicator value or an indicator range, e.g., the indicator value may be a bandwidth value of the memory bandwidth, and the indicator range may be a range of values in which the memory bandwidth is located.
In some possible implementations, the memory request may also carry memory requirement information that indicates a memory indicator of the computing device request, such as one or more of a memory type (memory type on the memory expansion device), a memory size, a memory speed, and the like. The embodiments of the present application will be described with reference to an example in which the memory request includes allocation request information and memory requirement information.
In a scenario where a memory request is automatically triggered by a computing device, the process of triggering the memory request by the computing device may be: the computing equipment determines allocation request information and memory demand information of the current memory application according to the task to be processed, generates the memory request based on the determined allocation request information and memory demand information, and sends the memory request to the management equipment. For example, the allocation request information may be determined based on the task type of the task to be processed, e.g., different task types may correspond to different attribute indicators. Or the allocation request information may be a pre-specified attribute index, such as a default attribute index. For another example, the memory requirement information may be determined based on the data volume of the task to be processed, e.g., different data volumes may correspond to different memory metrics.
In a scenario where a memory request is manually triggered by a user, a computing device may provide a memory application interface for the user, where the memory application interface provides configuration functions of allocation request information and memory requirement information. The user can configure the allocation request information and the memory demand information in the memory application interface, and upload the configured allocation request information and the configured memory demand information to the computing device. The computing device receives the uploaded allocation request information and memory requirement information, generates the memory request based on the allocation request information and the memory requirement information, and sends the memory request to the management device. For example, the memory application interface may include a plurality of options of attribute indexes, and the user can complete configuration of the allocation request information by performing a selection operation on the option of any one of the attribute indexes. For another example, the memory application interface may include a plurality of options of memory indicators, and the user may complete configuration of the memory requirement information by performing a selection operation on an option of any one of the memory indicators. The embodiment of the present application is not limited thereto.
It is noted that in other possible implementations, the computing device may also employ other implementations to trigger the memory request. The embodiment of the present application is not limited thereto.
Fig. 5 is an exemplary schematic diagram of a memory application according to an embodiment of the present application. Referring to fig. 5, obj_type is used to refer to a memory type such as an accelerator (accelerator), a nonvolatile memory (Nvmem), a dynamic random access memory (dynamic random access memory, DRAM), etc. It should be noted that the DRAM type may include a DDR4 type or a DDR5 type. obj_attribute is used to refer to attribute indicators such as bandwidth indicator (bw_preference), latency indicator (latency_preference). Thus, by invoking a program as shown in FIG. 5, the computing device can be triggered to send a memory request to the management device requesting that memory in the CXL memory pool be allocated for the computing device. In addition, after the memory is used, the computing device may also call the void cxlfabric _free function to release the memory.
In some possible implementations, the management device further determines that the remaining memory capacity of the memory expansion device having the target type of memory in the CXL memory pool is greater than the target capacity if the memory requirement information indicates that the requested memory size is the target capacity and the memory type is the target type. That is, on the premise of ensuring that the remaining memory capacity of the memory expansion device having the target type memory in the CXL memory pool is sufficient, the subsequent memory allocation procedure is executed.
S404, determining the target memory expansion device with the category matching attribute indexes from the CXL memory pool.
In some possible implementations, taking two types of memory expansion devices, i.e., a bandwidth type memory expansion device and a capacity type memory expansion device, as an example, the CXL memory pool is divided, and in the case that the attribute index indicated by the allocation request information is a bandwidth index, the management device may determine the target memory expansion device from the bandwidth type memory expansion device. Or, in the case that the attribute index indicated by the allocation request information is a latency index, the management device may determine the target memory expansion device from the capacity type memory expansion devices. Thus, the requirement of the computing device on different attribute memories is met by determining the target memory expansion device matched with the attribute index.
In other possible implementations, taking three types of memory expansion devices, that is, the CXL memory pool is divided into a bandwidth type memory expansion device, a capacity type memory expansion device, and an equilibrium type memory expansion device as an example, where the attribute index indicated by the allocation request information is a bandwidth index, the target memory expansion device may further include the equilibrium type memory expansion device. Or, in the case that the attribute index indicated by the allocation request information is a delay index, the target memory expansion device may further include the balanced memory expansion device. In this way, other types of memory expansion devices which can be referred to in memory allocation are added, so that when the attribute index indicated by the allocation request information is a bandwidth index or when the attribute index indicated by the allocation request information is a time delay index, the balanced memory expansion device can be used as a candidate memory expansion device, and candidates of the memory expansion device in memory allocation are enriched.
For the case that the attribute index indicated by the allocation request information is a delay index, the management device may further determine the capacity type memory expansion device, in which the delay level of the memory delay meets the delay priority condition, as the target memory expansion device.
The delay priority condition may be that the delay is small, such as that the delay level is minimum. Therefore, by setting the time delay priority condition, the capacity type memory expansion device with the minimum time delay can be determined for the computing device under the condition that the attribute index indicated by the allocation request information is the time delay index, so that the requirement of the computing device on the time delay is met.
The process of determining the target memory expansion device is described below with reference to a first scenario in which the attribute index is a bandwidth index and a second scenario in which the attribute index is a delay index.
The first scene and the attribute index are bandwidth indexes.
In some possible implementations, in a case where the attribute index indicated by the allocation request information is a bandwidth index, the management device may further maintain a first preset priority order, where the first preset priority order is used to indicate that the priority of the memory expansion devices of different classes is in an order from high to low in a case where the attribute index is a bandwidth index.
The process of the management device determining the target memory expansion device with the category matching attribute index from the CXL memory pool may be: and acquiring the uplink bandwidth of the computing device, and determining the lower bandwidth limit allocated to the computing device based on the uplink bandwidth of the computing device. Further, it is determined whether the target memory expansion device is present based on the bandwidth lower limit and the first preset priority order.
Wherein the upstream bandwidth refers to a link bandwidth between the computing device and the CXL switch, and is determined based on the number of links between the computing device and the CXL switch. For example, the management device may determine, as the upstream bandwidth, a theoretical bandwidth corresponding to the number of links between the computing device and the CXL switch, based on the number of links. For example, assume that the number of links between a computing device and a CXL switch is 16, and that the theoretical bandwidth corresponding to the number of links of 16 is 64GB/s. In some possible implementations, the computing device is allocated a larger bandwidth with twice the upstream bandwidth as a lower bandwidth limit, e.g., 128 GB/s.
Illustratively, the first preset priority order may be: bandwidth type memory expansion device, equalization type memory expansion device, capacity type memory expansion device. That is, the allocation priority of the bandwidth type memory expansion device is higher than the allocation priority of the equalization type memory expansion device, and the allocation priority of the equalization type memory expansion device is higher than the allocation priority of the capacity type memory expansion device.
Also for example, in the case where the bandwidth-type memory expansion device, the capacity-type memory expansion device, and the equalization-type memory expansion device all carry latency levels of memory latency, the first preset priority order may be: the system comprises a primary time delay bandwidth type memory expansion device, a primary time delay equalization type memory expansion device, a secondary time delay bandwidth type memory expansion device, a secondary time delay equalization type memory expansion device, a primary time delay capacity type memory expansion device and a secondary time delay capacity type memory expansion device.
Therefore, by maintaining the first preset priority order so as to execute memory allocation according to the first preset priority order under the condition that the attribute index of the request of the computing device is the bandwidth index, the memory matched with the request of the computing device can be allocated preferentially, and the accuracy of memory allocation is improved.
In some possible implementations, the determining whether the target memory expansion device exists based on the bandwidth lower limit and the first preset priority order may be: and sequentially judging whether the bandwidth of the memory channel of each memory expansion device is larger than or equal to the bandwidth lower limit according to the first preset priority order so as to determine the target memory expansion device with the memory channel bandwidth larger than or equal to the bandwidth lower limit.
Specifically, in some possible implementations, the number of target memory expansion devices may be multiple. For example, the management device may determine, as the target memory expansion device, a plurality of memory expansion devices whose sum of the bandwidths of the memory channels is greater than or equal to the lower limit of the bandwidth.
Therefore, the bandwidth lower limit can be met by utilizing the combination of the memory channel bandwidths of the plurality of memory expansion devices under the condition that the memory channel bandwidth of the single memory expansion device cannot meet the bandwidth lower limit, so that the smooth proceeding of memory allocation is ensured.
And the second scene and the attribute index are time delay indexes.
In some possible implementations, in a case where the attribute index indicated by the allocation request information is a latency index, the management device may further maintain a second preset priority order, where the second preset priority order is used to indicate that the priority of the memory expansion devices of different classes is in an order from high to low in a case where the attribute index is a latency index.
The process of the management device determining the target memory expansion device with the category matching attribute index from the CXL memory pool may be: and determining whether the target memory expansion device exists or not based on the second preset priority order.
Illustratively, the second preset priority order may be: capacity type memory expansion device, equalization type memory expansion device, and bandwidth type memory expansion device. That is, the allocation priority of the capacity type memory expansion device is higher than the allocation priority of the equalization type memory expansion device, and the allocation priority of the equalization type memory expansion device is higher than the allocation priority of the bandwidth type memory expansion device.
Also for example, in the case where the bandwidth-type memory expansion device, the capacity-type memory expansion device, and the equalization-type memory expansion device all carry latency levels of memory latency, the second preset priority order may be: the system comprises a first-stage time delay capacity type memory expansion device, a first-stage time delay balanced type memory expansion device, a first-stage time delay bandwidth type memory expansion device, a second-stage time delay capacity type memory expansion device, a second-stage time delay balanced type memory expansion device and a second-stage time delay bandwidth type memory expansion device.
Therefore, by maintaining the second preset priority order so as to execute memory allocation according to the second preset priority order under the condition that the attribute index of the request of the computing device is a time delay index, the memory matched with the request of the computing device can be allocated preferentially, and the accuracy of memory allocation is improved.
S405, determining a memory meeting the memory requirement information in the target memory expansion device.
In some possible implementations, the process of determining, by the management device, the memory satisfying the memory requirement information in the target memory expansion device may include at least one of:
One possible implementation manner, in the target memory expansion device, determines a memory with the same memory type as the memory type indicated by the memory requirement information as a memory meeting the memory requirement information. Thus, the reliability of memory allocation is ensured by ensuring the matching of memory types.
In another possible implementation manner, in the target memory expansion device, a memory with a remaining memory capacity greater than or equal to the memory size indicated by the memory requirement information is determined as a memory meeting the memory requirement information. Thus, the reliability of memory allocation is ensured by ensuring sufficient residual memory capacity.
The number of the target memory expansion devices may be plural. For example, in the plurality of target memory expansion devices, a memory whose sum of the remaining memory capacities is greater than or equal to the memory size indicated by the memory demand information is determined as a memory that satisfies the memory demand information.
Therefore, under the condition that the residual memory capacity of a single memory expansion device cannot meet the memory size requirement, the combination of the residual memory capacities of a plurality of memory expansion devices is utilized to meet the memory size requirement, so that smooth proceeding of memory allocation is ensured.
In another possible implementation manner, the memory meeting the memory requirement information is determined in the memory channel with the largest remaining memory capacity among the memory channels of the target memory expansion device. Thus, by performing memory allocation from the memory channel with the largest remaining memory capacity, memory allocation equalization can be realized.
S406, memory meeting the memory requirement information is allocated for the computing device from the target memory expansion device.
In some possible implementations, if the memory requirement information indicates that the requested memory size is the target capacity and the memory type is the target type, it is determined whether the capacity of the memory of the target type of the target memory expansion device is greater than or equal to the target capacity. Further, if the capacity of the memory of the target type of the target memory expansion device is greater than or equal to the target capacity, the memory of the target capacity is allocated from the target memory expansion device to the computing device.
For the embodiments shown in S404 to S406, on the premise that the management device maintains a preset priority order, the management device may sequentially determine whether the determined target memory expansion device meets the memory requirement information according to the maintained preset priority order, and if so, allocate the memory meeting the memory requirement information for the computing device from the target memory expansion device. If the current target memory expansion device does not meet the memory requirement information, the method can continue to judge whether the determined next target memory expansion device meets the memory requirement information.
The flow of memory allocation is described below with reference to a first scenario in which the attribute index is a bandwidth index and a second scenario in which the attribute index is a delay index.
The first scene and the attribute index are bandwidth indexes.
Illustratively, in a first predetermined priority order: for example, the bandwidth type memory expansion device, the balanced type memory expansion device, and the capacity type memory expansion device, the management device preferably executes a memory allocation process of the bandwidth type memory expansion device, and the corresponding process may be: the management device determines the memory meeting the memory requirement information in the bandwidth type memory expansion device, and if the memory meeting the memory requirement information exists in the bandwidth type memory expansion device, allocates the memory meeting the memory requirement information for the computing device. If the bandwidth type memory expansion device does not have a memory meeting the memory requirement information, executing a memory allocation process of the balanced type memory expansion device, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the balanced memory expansion device, and if the memory meeting the memory requirement information exists in the balanced memory expansion device, allocates the memory meeting the memory requirement information for the computing device. If the balanced memory expansion device does not have a memory meeting the memory requirement information, executing a memory allocation process of the capacity memory expansion device, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the capacity type memory expansion device, and if the memory meeting the memory requirement information exists in the capacity type memory expansion device, allocates the memory meeting the memory requirement information for the computing device. In this way, when the attribute index indicated by the allocation request information is the bandwidth index, the bandwidth type memory expansion device is used as the preference by setting the first preset priority order, so as to meet the requirement of the computing device on the bandwidth.
Also exemplary, in a first predetermined priority order: the management device preferably executes a memory allocation process of the first-stage delayed bandwidth type memory expansion device, the first-stage delayed balanced type memory expansion device, the second-stage delayed bandwidth type memory expansion device, the second-stage delayed balanced type memory expansion device, the first-stage delayed capacity type memory expansion device, the second-stage delayed capacity type memory expansion device, and the corresponding process may be: the management device determines the memory meeting the memory requirement information in the bandwidth type memory expansion device with one-stage delay, and if the memory meeting the memory requirement information exists in the bandwidth type memory expansion device with one-stage delay, the memory meeting the memory requirement information is allocated to the computing device. If the bandwidth type memory expansion device with one-stage delay does not have a memory meeting the memory requirement information, executing a memory allocation process of the balanced type memory expansion device with one-stage delay, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the primary delay balanced memory expansion device, and if the memory meeting the memory requirement information exists in the primary delay balanced memory expansion device, the memory meeting the memory requirement information is distributed to the computing device. If the balanced memory expansion device with the first-level delay does not have a memory meeting the memory requirement information, executing a memory allocation process of the bandwidth memory expansion device with the second-level delay, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the bandwidth type memory expansion device with the second-level delay, and if the memory meeting the memory requirement information exists in the bandwidth type memory expansion device with the second-level delay, the memory meeting the memory requirement information is distributed to the computing device. If the bandwidth type memory expansion device with the second-level delay does not have a memory meeting the memory requirement information, executing a memory allocation process of the balanced type memory expansion device with the second-level delay, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the balanced memory expansion device with the second-level delay, and if the memory meeting the memory requirement information exists in the balanced memory expansion device with the second-level delay, the memory meeting the memory requirement information is distributed to the computing device. If the balanced memory expansion device with the second-level delay does not have a memory meeting the memory requirement information, executing a memory allocation process of the capacity memory expansion device with the first-level delay, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the capacity type memory expansion device with one-stage delay, and if the memory meeting the memory requirement information exists in the capacity type memory expansion device with one-stage delay, the memory meeting the memory requirement information is distributed to the computing device. If the capacity type memory expansion device with the first-stage delay does not have a memory meeting the memory requirement information, executing a memory allocation process of the capacity type memory expansion device with the second-stage delay, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the capacity type memory expansion device with the second-level delay, and if the memory meeting the memory requirement information exists in the capacity type memory expansion device with the second-level delay, the memory meeting the memory requirement information is distributed to the computing device.
It should be noted that, in other possible implementations, the first preset priority order may also be set to be in other orders that the bandwidth-type memory expansion device prioritizes, for example, the first preset priority order may also be: the system comprises a primary time delay bandwidth type memory expansion device, a secondary time delay bandwidth type memory expansion device, a primary time delay balanced type memory expansion device, a secondary time delay balanced type memory expansion device, a primary time delay capacity type memory expansion device and a secondary time delay capacity type memory expansion device. The embodiment of the present application is not limited thereto.
Exemplary, scenario one is illustrated below in connection with fig. 6. Fig. 6 is a schematic flow chart of memory allocation according to an embodiment of the present application. Referring to fig. 6, in the case where the attribute index indicated by the allocation request information is a bandwidth index, that is, in the case where the priority applies to the bandwidth type memory expansion device, the flow of memory allocation may include:
S601, the management device receives a memory request from the computing device, wherein the allocation request information carried by the memory request indicates that the attribute index is a bandwidth index, and the memory demand information carried by the memory request indicates that the memory type is a target type and the memory size is a target capacity.
That is, the memory request indicates the memory of the bandwidth-type memory expansion device of the target type to which the target capacity is allocated.
S602, the management device determines whether the residual memory capacity of the memory expansion device with the target type memory in the CXL memory pool is greater than or equal to the target capacity. If the remaining memory capacity of the memory expansion device having the target type memory in the CXL memory pool is greater than or equal to the target capacity, then S603 is performed. And if the residual memory capacity of the memory expansion device with the target type memory in the CXL memory pool is smaller than the target capacity, returning a message of failure memory allocation to the computing device.
And S603, the management device acquires the uplink bandwidth of the computing device and determines the lower limit of the bandwidth allocated to the computing device based on the uplink bandwidth.
For example, the management device may query the upstream bandwidth of the computing device and take twice the upstream bandwidth as the lower bandwidth limit allocated for the computing device.
S604, the management device determines whether a target memory expansion device exists based on the bandwidth lower limit and the first preset priority order. If so, S605 is performed. If not, a message of memory allocation failure is returned to the computing device.
Illustratively, the first preset priority order may be: the system comprises a primary time delay bandwidth type memory expansion device, a primary time delay equalization type memory expansion device, a secondary time delay (or a secondary time delay larger) bandwidth type memory expansion device, a secondary time delay (or a secondary time delay larger) equalization type memory expansion device, a primary time delay capacity type memory expansion device and a secondary time delay (or a secondary time delay larger) capacity type memory expansion device.
In some possible implementations, the management device sequentially determines, according to a first preset priority order, whether the memory channel bandwidth of each memory expansion device is greater than or equal to a bandwidth lower limit, so as to determine a target memory expansion device having a memory channel bandwidth greater than or equal to the bandwidth lower limit.
It should be noted that, when executing S604, the management device may determine, according to the first preset priority order, whether there are a plurality of memory expansion devices whose sum of the memory channel bandwidths is greater than or equal to the lower bandwidth limit based on the sum of the memory channel bandwidths of the plurality of memory expansion devices, and if so, determine the plurality of memory expansion devices as target memory expansion devices, so as to subsequently satisfy the bandwidth requirement based on the memory channel bandwidths of the plurality of memory expansion devices.
For example, if the memory channel bandwidth of the current memory expansion device is less than the bandwidth lower limit, it may be determined, according to the first preset priority order, whether the sum of the memory channel bandwidths of the current memory expansion device and the next memory expansion device is greater than or equal to the bandwidth lower limit, and if so, the current memory expansion device and the next memory expansion device are determined to be target memory expansion devices. If not, continuing to judge whether the sum of the bandwidths of the memory channels of the current memory expansion device, the next memory expansion device and the next memory expansion device is greater than or equal to the lower bandwidth limit or not until a plurality of memory expansion devices meeting the bandwidth requirement are determined.
S605, the management device determines whether the target memory expansion device meets the memory requirement information. If so, S606 is performed. If not, a message of memory allocation failure is returned to the computing device.
For example, it may be determined whether the memory type of the target memory expansion device is a target type, and whether the memory size is greater than or equal to the target capacity.
It should be noted that, when executing the determining process of whether the memory size is greater than or equal to the target capacity in S605, the management device may determine, according to the first preset priority order, whether the sum of the remaining memory capacities of the plurality of target memory expansion devices is greater than or equal to the target capacity based on the sum of the remaining memory capacities of the plurality of target memory expansion devices, and if so, execute S606 based on the memories of the plurality of target memory expansion devices.
For example, if the remaining memory capacity of the current target memory expansion device is smaller than the target capacity, it may be determined whether the sum of the remaining memory capacities of the current target memory expansion device and the next target memory expansion device is greater than or equal to the target capacity according to the first preset priority order, and if so, S606 is performed based on the memories of the current target memory expansion device and the next target memory expansion device. If not, continuing to judge whether the sum of the residual memory capacities of the current target memory expansion device, the next target memory expansion device and the next target memory expansion device is greater than or equal to the target capacity or not until the memory meeting the memory requirement information is determined.
S606, the management device allocates the memory meeting the memory requirement information for the computing device from the target memory expansion device.
In one possible implementation manner, after the management device allocates the memory meeting the memory requirement information for the computing device from the target memory expansion device, a message that the memory allocation is successful may also be returned to the computing device.
And the second scene and the attribute index are time delay indexes.
Illustratively, in a second predetermined priority order: for example, the capacity type memory expansion device, the balanced type memory expansion device, and the bandwidth type memory expansion device, the management device preferably executes a memory allocation process of the capacity type memory expansion device, and the corresponding process may be: the management device determines the memory meeting the memory requirement information in the capacity type memory expansion device, and if the memory meeting the memory requirement information exists in the capacity type memory expansion device, allocates the memory meeting the memory requirement information for the computing device. If the capacity type memory expansion device does not have a memory meeting the memory requirement information, executing a memory allocation process of the balanced type memory expansion device, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the balanced memory expansion device, and if the memory meeting the memory requirement information exists in the balanced memory expansion device, allocates the memory meeting the memory requirement information for the computing device. If the balanced memory expansion device does not have memory resources meeting the memory requirement information, executing a memory allocation process of the bandwidth memory expansion device, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the bandwidth type memory expansion device, and if the memory meeting the memory requirement information exists in the bandwidth type memory expansion device, allocates the memory meeting the memory requirement information for the computing device. In this way, when the attribute index indicated by the allocation request information is a delay index, the capacity type memory expansion device is preferable by setting the allocation priority.
Also exemplary, in a second predetermined priority order: the management device preferably executes a memory allocation process of the first-stage time-delay capacity type memory expansion device, the first-stage time-delay equalization type memory expansion device, the first-stage time-delay bandwidth type memory expansion device, the second-stage time-delay capacity type memory expansion device, the second-stage time-delay equalization type memory expansion device, and the second-stage time-delay bandwidth type memory expansion device, which may be: the management device determines the memory meeting the memory requirement information in the capacity type memory expansion device with one-stage delay, and if the memory meeting the memory requirement information exists in the capacity type memory expansion device with one-stage delay, the memory meeting the memory requirement information is distributed to the computing device. If the capacity type memory expansion device with the first-stage time delay does not have a memory meeting the memory requirement information, executing a memory allocation process of the balanced type memory expansion device with the first-stage time delay, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the primary delay balanced memory expansion device, and if the memory meeting the memory requirement information exists in the primary delay balanced memory expansion device, the memory meeting the memory requirement information is distributed to the computing device. If the balanced memory expansion device with one-stage delay does not have a memory meeting the memory requirement information, executing the memory allocation process of the bandwidth memory expansion device with one-stage delay, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the bandwidth type memory expansion device with one-stage delay, and if the memory meeting the memory requirement information exists in the bandwidth type memory expansion device with one-stage delay, the memory meeting the memory requirement information is allocated to the computing device. If the bandwidth type memory expansion device with the first-level delay does not have a memory meeting the memory requirement information, executing a memory allocation process of the capacity type memory expansion device with the second-level delay, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the capacity type memory expansion device with the second-level delay, and if the memory meeting the memory requirement information exists in the capacity type memory expansion device with the second-level delay, the memory meeting the memory requirement information is distributed to the computing device. If the capacity type memory expansion device with the second-level delay does not have a memory meeting the memory requirement information, executing a memory allocation process of the balanced type memory expansion device with the second-level delay, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the balanced memory expansion device with the second-level delay, and if the memory meeting the memory requirement information exists in the balanced memory expansion device with the second-level delay, the memory meeting the memory requirement information is distributed to the computing device. If the balanced memory expansion device with the second-level delay does not have a memory meeting the memory requirement information, executing a memory allocation process of the bandwidth memory expansion device with the second-level delay, wherein the corresponding process can be as follows: the management device determines the memory meeting the memory requirement information in the bandwidth type memory expansion device with the second-level delay, and if the memory meeting the memory requirement information exists in the bandwidth type memory expansion device with the second-level delay, the memory meeting the memory requirement information is distributed to the computing device.
It should be noted that, in other possible implementations, the second preset priority order may be set to other orders, which is not limited by the embodiment of the present application.
Exemplary, scenario two is illustrated below in connection with fig. 7. Fig. 7 is a schematic flow chart of memory allocation according to an embodiment of the present application. Referring to fig. 7, in the case where the attribute index indicated by the allocation request information is a time delay index, that is, in the case where the capacity type memory expansion device is preferentially applied, the flow of memory allocation may include:
S701, the management device receives a memory request from the computing device, wherein the allocation request information carried by the memory request indicates that the attribute index is a time delay index, and the memory demand information carried by the memory request indicates that the memory type is a target type and the memory size is a target capacity.
That is, the memory request indicates the memory of the capacity-type memory expansion device of the target type to which the target capacity is allocated.
S702, the management device determines whether the remaining memory capacity of the memory expansion device with the target type memory in the CXL memory pool is greater than or equal to the target capacity. If the remaining memory capacity of the memory expansion device having the target type memory in the CXL memory pool is greater than or equal to the target capacity, S703 is executed. And if the residual memory capacity of the memory expansion device with the target type memory in the CXL memory pool is smaller than the target capacity, returning a message of failure memory allocation to the computing device.
S703, the management device determines whether the target memory expansion device exists based on the second preset priority order.
Illustratively, the second preset priority order may be: the memory expansion device comprises a capacity type memory expansion device with primary delay, an equalization type memory expansion device with primary delay, a bandwidth type memory expansion device with primary delay, a capacity type memory expansion device with secondary delay (or more than secondary delay), an equalization type memory expansion device with secondary delay (or more than secondary delay), and a bandwidth type memory expansion device with secondary delay (or more than secondary delay).
S704, the management device determines whether the target memory expansion device meets the memory requirement information. If so, S705 is performed. If not, a message of memory allocation failure is returned to the computing device.
For example, it may be determined whether the memory type of the target memory expansion device is a target type, and whether the memory size is greater than or equal to the target capacity.
It should be noted that, when executing the determining process of whether the memory size is greater than or equal to the target capacity in S704, the management device may determine, according to the second preset priority order, whether the sum of the remaining memory capacities of the plurality of target memory expansion devices is greater than or equal to the target capacity based on the sum of the remaining memory capacities of the plurality of target memory expansion devices, and if so, execute S705 based on the memories of the plurality of target memory expansion devices.
For example, if the remaining memory capacity of the current target memory expansion device is smaller than the target capacity, it may be determined whether the sum of the remaining memory capacities of the current target memory expansion device and the next target memory expansion device is greater than or equal to the target capacity according to the second preset priority order, and if so, S705 is performed based on the memories of the current target memory expansion device and the next target memory expansion device. If not, continuing to judge whether the sum of the residual memory capacities of the current target memory expansion device, the next target memory expansion device and the next target memory expansion device is greater than or equal to the target capacity or not until the memory meeting the memory requirement information is determined.
S705, the management device allocates the memory meeting the memory requirement information for the computing device from the target memory expansion device.
In one possible implementation manner, after the management device allocates the memory meeting the memory requirement information for the computing device from the target memory expansion device, a message that the memory allocation is successful may also be returned to the computing device.
In the above embodiment, the process of performing memory allocation based on the preset priority order maintained by the management device is described by taking the first scenario in which the attribute index is the bandwidth index and the second scenario in which the attribute index is the delay index as examples.
The following describes a flow of a memory allocation method according to an embodiment of the present application based on the memory allocation system shown in fig. 8. Fig. 8 is an exemplary schematic diagram of a memory allocation system according to an embodiment of the present application. Referring to fig. 8, taking a DIMM memory expansion device (DDR 4 or DDR5 as shown in fig. 8) as an example, the DIMM memory expansion device includes six DIMM memory expansion devices, i.e., a memory expansion device a, a memory expansion device b, a memory expansion device c, a memory expansion device d, a memory expansion device e, and a memory expansion device f. When the classification management is performed based on the CXL memory pool constituted by the plurality of DIMM memory expansion devices, the attribute information of each DIMM memory expansion device in the CXL memory pool can be collected through the out-of-band channel, as shown in table 1.
TABLE 1
Table 1 illustrates attribute information for a plurality of DIMM memory expansion devices, including device encoding (e.g., DIMM encoding), memory type (e.g., DIMM type), number of memory channels, memory capacity, single channel bandwidth, latency level, number of device links, memory speed, etc., taking DIMM memory expansion devices as an example. Wherein the device code is used to uniquely identify the memory expansion device, such as a, b, c, etc. codes. The memory type refers to the type of memory expansion device in the memory expansion device, such as DDR4 or DDR5. The number of memory channels refers to the total number of memory channels included in the memory expansion device, for example, 1ch is used to indicate that 1 memory channel is included, and 2ch is used to indicate that 2 memory channels are included. The latency level may be determined based on the number of CXL switches spanned by the memory expansion device. The number of device links refers to the number of links between the memory expansion device and the CXL switch, for example, the number of links between the host_0 device and the CXL switch may be 16, represented by x 16.
Referring to fig. 8, as the memory type of the memory expansion device a (ddr4@2ch@128 GB) in fig. 8 is DDR4, the memory expansion device a may include 2 memory channels, the memory capacity of which may be 128GB, the number of CXL switches spanned by it is 1, and the number of links between it and the CXL switches is 8, as represented by x 8. The memory type of the memory expansion device b (ddr4@1ch@128 GB) is DDR4, and the memory expansion device b may include 1 memory channel, the memory capacity of which may be 128GB, the number of CXL switches spanned by the memory expansion device b is 1, and the number of links between the memory expansion device b and the CXL switches is 8, as represented by x 8. The memory type of the memory expansion device c (ddr5@2ch@128 GB) is DDR5, and the memory expansion device c may include 2 memory channels, the memory capacity of which may be 128GB, the number of CXL switches spanned by the memory expansion device c is 1, and the number of links between the memory expansion device c and the CXL switches is 16, as represented by x 16. The memory type of the memory expansion device d (ddr5@2ch@128 GB) is DDR5, and the memory expansion device d may include 2 memory channels, the memory capacity of which may be 128GB, the number of CXL switches spanned by the memory expansion device d is 1, and the number of links between the memory expansion device d and the CXL switches is 8, as represented by x 8. The memory type of the memory expansion device e (ddr4@1ch@128 GB) is DDR4, and the memory expansion device e may include 1 memory channel, the memory capacity of which may be 128GB, the number of CXL switches spanned by the memory expansion device e is 2, and the number of links between the memory expansion device and the CXL switches is 8, as represented by x 8. The memory type of the memory expansion device f (ddr5@2ch@128 GB) is DDR5, and the memory expansion device f may include 2 memory channels, the memory capacity of which may be 128GB, the number of CXL switches spanned by the memory expansion device f is 2, and the number of links between the memory expansion device f and the CXL switches is 16, as represented by x 16.
Further, the plurality of DIMM memory expansion devices are classified based on the attribute information of each DIMM memory expansion device among the plurality of DIMM memory expansion devices, and the information shown in table 2 can be obtained.
TABLE 2
Referring to table 2, taking a ratio of memory capacity to memory bandwidth as a first parameter value, setting a first preset condition as an example, the plurality of DIMM memory expansion devices may be sequentially divided into a bandwidth type memory expansion device, an equalization type memory expansion device, and a capacity type memory expansion device. Wherein, taking the first threshold range as (0, 2) as an example, if the first parameter value of the DIMM memory expansion device is within (0, 2), determining the category of the DIMM memory expansion device as a bandwidth type memory expansion device, taking the third threshold range as (4, + -infinity) as an example, if the first parameter value of the DIMM memory expansion device is within (4, + -infinity), taking the fifth threshold range as (2, 4) as an example, if the first parameter value of the DIMM memory expansion device is within (2, 4), determining the category of the DIMM memory expansion device as balanced memory expansion device, and determining the category of the memory expansion device of the DIMM as balanced memory expansion device, such as the category of the memory expansion device a and the category of the memory expansion device d as balanced memory expansion device.
After determining the class of each DIMM memory expansion device of the plurality of DIMM memory expansion devices, memory management may be performed in a management manner as shown in fig. 9. Fig. 9 is a schematic diagram illustrating an example of memory management according to an embodiment of the present application. Referring to fig. 9, memory expansion devices are classified according to different DIMM parameters. For different types of memory expansion devices, the memory expansion devices may be managed in a block (block) manner, for example, the memory expansion devices may be divided into memory blocks with a size of 512 MB.
Further, in the memory allocation system shown in fig. 8, it is assumed that the host_0 device applies for allocation of memory resources to the management device, and the attribute index of the memory requested to be obtained is a bandwidth index, the memory type is DRAM (DDR 4 or DDR 5), and the memory size is 2GB. At this time, the code called by the computing device may be void cxlfabric _alloc (DRAM, bw_reference, 2 GB). Furthermore, when the technical scheme provided by the embodiment of the application is utilized to perform memory allocation, the method can comprise the following steps one to four.
Step one, the management device judges whether the residual memory capacity of the memory expansion device with the DRAM type memory in the CXL memory pool is more than or equal to 2GB. And if the residual memory capacity of the memory expansion device with the DRAM type memory in the CXL memory pool is greater than or equal to 2GB, executing the step II. And if the residual memory capacity of the memory expansion device with the DRAM type memory in the CXL memory pool is smaller than 2GB, returning a message of memory allocation failure to the computing device.
Step two, the management device obtains the number of links between the host_0 device and the CXL memory switch, and determines the theoretical bandwidth corresponding to the number of links as the uplink bandwidth of the host_0 device. Illustratively, the number of links between the host_0 device and the CXL memory pool is 16, and the theoretical bandwidth corresponding to 16 is 64GB/s. And then takes the twice uplink bandwidth as the lower bandwidth limit, namely, the bandwidth which is larger than or equal to 128GB/s is allocated to the host_0 device.
And thirdly, the management device judges whether the target memory expansion device exists or not based on the bandwidth lower limit 128GB/s and the first preset priority order. If so, step four is performed. If not, a message of memory allocation failure is returned to the computing device.
The bandwidth of the memory channel of the target memory expansion device is greater than or equal to the lower bandwidth limit.
Illustratively, in a first predetermined priority order: the primary time delay bandwidth type memory expansion device, the primary time delay equalization type memory expansion device, the secondary time delay bandwidth type memory expansion device, the secondary time delay equalization type memory expansion device, the primary time delay capacity type memory expansion device and the secondary time delay capacity type memory expansion device are taken as examples, whether the memory channel bandwidth of the memory expansion device c is larger than or equal to the bandwidth lower limit can be preferentially judged, and it can be found that the memory channel bandwidth (76.8 GB/s) of the memory expansion device c is smaller than the bandwidth lower limit 128GB/s. At this time, it can be continuously determined whether the memory channel bandwidth of the memory expansion device a is greater than or equal to the bandwidth lower limit, and it can be found that the memory channel bandwidth (51.2 GB/s) of the memory expansion device a is also less than the bandwidth lower limit of 128GB/s, but the sum of the bandwidth (51.2 GB/s) of the memory channel of the memory expansion device a and the bandwidth (76.8 GB/s) of the memory channel of the memory expansion device c is 128GB/s, so that the bandwidth lower limit can be satisfied. Therefore, the memory expansion device a and the memory expansion device c can be regarded as target memory expansion devices.
Also exemplary, in a first predetermined priority order: the primary time delay bandwidth type memory expansion device, the secondary time delay bandwidth type memory expansion device, the primary time delay equalization type memory expansion device, the secondary time delay equalization type memory expansion device, the primary time delay capacity type memory expansion device and the secondary time delay capacity type memory expansion device are taken as examples, whether the memory channel bandwidth of the memory expansion device c is larger than or equal to the bandwidth lower limit can be preferentially judged, and it can be found that the memory channel bandwidth (76.8 GB/s) of the memory expansion device c is smaller than the bandwidth lower limit 128GB/s. At this time, it can be continuously determined whether the memory channel bandwidth of the memory expansion device f is greater than or equal to the bandwidth lower limit, and it can be found that the memory channel bandwidth (76.8 GB/s) of the memory expansion device f is also less than the bandwidth lower limit of 128GB/s, but the sum of the bandwidth (76.8 GB/s) of the memory channel of the memory expansion device c and the bandwidth (76.8 GB/s) of the memory channel of the memory expansion device f is greater than 128GB/s, so that the bandwidth lower limit can be satisfied. Therefore, the memory expansion device c and the memory expansion device f can be regarded as target memory expansion devices.
And step four, the management equipment judges whether the target memory expansion equipment meets the memory requirement information. If the memory type of the target memory expansion device is a DRAM type, and the memory size is greater than or equal to 2GB. If the target memory expansion device meets the memory requirement information, 2GB of memory of the DRAM type is allocated from the target memory expansion device to the computing device, and a message of successful memory allocation is returned to the computing device. And if the target memory expansion device does not meet the memory requirement information, returning a message of memory allocation failure to the computing device.
For example, the management device determines whether the memory expansion device a and the memory expansion device c meet the memory requirement information, for example, whether the memory types of the memory expansion device a and the memory expansion device c are DRAM types, and whether the memory size is greater than or equal to 2GB. It can be found that the memory type of the memory expansion device a is DDR4, the memory type of the memory expansion device c is DDR5, and the remaining memory capacities of the memory expansion device a and the memory expansion device c are both 100GB. The memory expansion device a and the memory expansion device c serve as target memory expansion devices, and memory requirement information (both the memory type and the memory size are met) of the computing device is met. Therefore, the 1GB capacity can be respectively applied from the two memory expansion devices and returned to the host_0 device, namely, the 1GB memories from the memory expansion device a and the memory expansion device c are returned to the host_0 device, and a message of successful memory allocation is returned to the computing device.
For example, the management device determines whether the memory expansion device c and the memory expansion device f satisfy the memory requirement information, for example, whether the memory types of the memory expansion device c and the memory expansion device f are DRAM types, and whether the memory size is greater than or equal to 2GB. It can be found that the memory types of the memory expansion device c and the memory device f are DDR5, and the remaining memory capacities of the memory expansion device c and the memory expansion device f are 100GB. The memory expansion device c and the memory expansion device f serve as target memory expansion devices, and memory requirement information (both the memory type and the memory size are met) of the computing device is met. Therefore, the 1GB capacity can be respectively applied from the two memory expansion devices and returned to the host_0 device, namely, the 1GB memories from the memory expansion device c and the memory expansion device f are returned to the host_0 device, and a message of successful memory allocation is returned to the computing device.
According to the technical scheme provided by the embodiment of the application, the allocation request information and the memory demand information are carried in the memory request of the computing device, so that on one hand, the allocation request information can be used for indicating the attribute index, such as the time delay index or the bandwidth index, of the memory requested by the computing device, and on the other hand, the memory demand information can be used for indicating the memory index, such as the memory size and the memory type, requested by the computing device. Furthermore, the management device can determine the target memory expansion device with the category matching the attribute index from the CXL memory pool, and can realize more targeted memory allocation, thereby meeting the requirements of the computing device on memories with different attributes and improving the accuracy of memory allocation. And the categories of all the memory expansion devices in the CXL memory pool are divided according to the memory capacity and the memory bandwidth corresponding to the memory expansion devices in the CXL memory pool, so that the refined management of the CXL memory pool can be realized, the target memory expansion devices with the categories matched with the allocation request information can be quickly and efficiently determined from the category dimension of the memory expansion devices during memory allocation, further, the memory resources in the target memory expansion devices are allocated for the computing devices, the memory allocation efficiency is improved, and the memory allocation accuracy is also effectively improved.
The foregoing description of the embodiments of the present application has been presented primarily in terms of methods. It should be appreciated that, in order to implement the above-described functions, the computing device (e.g., a server) in the embodiments of the present application includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
Fig. 10 is a schematic structural diagram of a memory allocation device according to an embodiment of the present application. Referring to fig. 10, the memory allocation apparatus includes a receiving module 1001, a determining module 1002, and an allocating module 1003. Wherein,
A receiving module 1001, configured to receive a memory request of a computing device; the memory request comprises allocation request information and memory demand information, wherein the allocation request information is used for indicating attribute indexes of memory expansion equipment requested by the computing equipment, and the attribute indexes are time delay indexes or bandwidth indexes; the memory requirement information is used for indicating a memory index requested by the computing device, and the memory index comprises a memory size and a memory type;
A determining module 1002, configured to determine, from the CXL memory pool, a target memory expansion device having a class matching the attribute index;
An allocation module 1003, configured to allocate, from the target memory expansion device, a memory that satisfies the memory requirement information for the computing device.
According to the technical scheme provided by the embodiment of the application, the allocation request information and the memory demand information are carried in the memory request of the computing device, so that on one hand, the allocation request information can be used for indicating the attribute index, such as the time delay index or the bandwidth index, of the memory expansion device requested by the computing device, and on the other hand, the memory demand information can be used for indicating the memory index, such as the memory size and the memory type, requested by the computing device. Furthermore, the management device can determine the target memory expansion device with the category matching attribute indexes from the CXL memory pool, and can realize more targeted memory allocation, thereby meeting the requirements of the computing device on memories with different attributes. And then, the memory meeting the memory demand information is allocated to the computing device from the target memory expansion device, so that the memory allocation efficiency is improved, and the memory allocation accuracy is also effectively improved.
In some possible implementations, the apparatus further includes a classification module to:
determining a category of each memory expansion device based on the memory capacity and the memory bandwidth of each memory expansion device in the CXL memory pool; the memory bandwidth is the minimum value of the memory channel bandwidth and the memory link bandwidth;
the categories of the memory expansion device include bandwidth type memory expansion device, capacity type memory expansion device and balanced type memory expansion device.
In some possible implementations, the bandwidth type memory expansion device refers to a memory expansion device in which a ratio of the memory capacity and the memory bandwidth satisfies a first preset condition;
The capacity type memory expansion device refers to a memory expansion device in which the ratio of the memory capacity to the memory bandwidth satisfies a second preset condition;
The balanced memory expansion device is a memory expansion device in which a ratio of the memory capacity to the memory bandwidth satisfies a third preset condition.
In some possible implementations, the memory requirement information indicates that the memory size of the request is a target capacity and the memory type is a target type; the determining module 1002 is further configured to determine that a remaining memory capacity of a memory expansion device having a target type of memory in the CXL memory pool is greater than the target capacity.
In some possible implementations, in the case where the attribute index indicated by the allocation request information is a bandwidth index, the determining module 1002 is specifically configured to: acquiring an uplink bandwidth of the computing device, and determining a bandwidth lower limit allocated to the computing device based on the uplink bandwidth; the upstream bandwidth of the computing device is determined based on the number of links between the computing device and the CXL switch;
Determining whether the target memory expansion device exists based on the bandwidth lower limit and a first preset priority order; the first preset priority order is used for indicating the order of the priorities of the memory expansion devices of different categories from high to low when the attribute index is the bandwidth index.
In some possible implementations, the first preset priority order is: the system comprises a primary time delay bandwidth type memory expansion device, a primary time delay equalization type memory expansion device, a secondary time delay bandwidth type memory expansion device, a secondary time delay equalization type memory expansion device, a primary time delay capacity type memory expansion device and a secondary time delay capacity type memory expansion device.
In some possible implementations, in the case where the attribute index indicated by the allocation request information is a delay index, the determining module 1002 is specifically configured to: determining whether the target memory expansion device exists or not based on a second preset priority order; the second preset priority order is used for indicating the order of the priorities of the memory expansion devices of different categories from high to low when the attribute index is the time delay index.
In some possible implementations, the second preset priority order is: the system comprises a first-stage time delay capacity type memory expansion device, a first-stage time delay balanced type memory expansion device, a first-stage time delay bandwidth type memory expansion device, a second-stage time delay capacity type memory expansion device, a second-stage time delay balanced type memory expansion device and a second-stage time delay bandwidth type memory expansion device.
In some possible implementations, the allocation module 1003 is specifically configured to:
Determining whether the capacity of the target type of memory of the target memory expansion device is greater than or equal to the target capacity;
And under the condition that the capacity of the memory of the target type of the target memory expansion device is larger than or equal to the target capacity, allocating the memory of the target capacity for the computing device from the target memory expansion device.
The embodiment of the application also provides electronic equipment, which comprises a processor and a memory, wherein the processor and the memory are coupled. The memory is used for storing computer program instructions, and the processor is used for calling the computer program instructions in the memory to execute the memory allocation method shown in the embodiment.
The embodiment of the application also provides a computer readable storage medium, which stores computer program instructions for causing an electronic device to execute the memory allocation method according to the above embodiment.
The embodiment of the application also provides a computer program product, which comprises computer program instructions, wherein the computer program instructions, when running on electronic equipment, cause the electronic equipment to execute the memory allocation method as shown in the embodiment.
Wherein the electronic device, the computer-readable storage medium or the computer program product provided by the embodiments of the present application are each configured to perform the corresponding method provided above. Therefore, the advantages achieved by the method can be referred to as the advantages in the corresponding method provided above, and will not be described herein.
It will be apparent to those skilled in the art from this disclosure that, for convenience and brevity, only the above-described division of functional modules is illustrated, and in practical applications, the above-described functional allocation may be performed by different functional modules, that is, the internal structure of the apparatus (e.g., electronic device) is divided into different functional modules, so as to perform all or part of the above-described functions. The specific working processes of the above-described system, apparatus (e.g., electronic device) and unit may refer to the corresponding processes in the foregoing method embodiments, which are not described herein again.
In the several embodiments provided herein, it should be understood that the disclosed systems, apparatuses (e.g., electronic devices) and methods may be implemented in other ways. For example, the above-described embodiments of an apparatus (e.g., an electronic device) are merely illustrative, and the division of the module or unit is merely a logical function division, and may be implemented in other ways, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method of the various embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic or optical disk, and the like.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (10)
1. The memory allocation method is characterized by comprising the following steps:
Receiving a memory request of a computing device; the memory request comprises allocation request information and memory demand information, wherein the allocation request information is used for indicating attribute indexes of memory expansion equipment requested by the computing equipment, and the attribute indexes are time delay indexes or bandwidth indexes; the memory requirement information is used for indicating a memory index requested by the computing device, and the memory index comprises a memory size and a memory type;
determining target memory expansion equipment with the category matching the attribute index from a CXL memory pool of the computing quick link;
and distributing the memory meeting the memory requirement information for the computing device from the target memory expansion device.
2. The method according to claim 1, wherein the method further comprises:
Determining the category of each memory expansion device based on the memory bandwidth or the memory bandwidth and the memory capacity of each memory expansion device in the CXL memory pool; the memory bandwidth is the minimum value of the memory channel bandwidth and the memory link bandwidth;
The categories of the memory expansion devices comprise bandwidth type memory expansion devices, capacity type memory expansion devices and balanced type memory expansion devices.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
The bandwidth type memory expansion device is memory expansion device that the ratio of the memory capacity to the memory bandwidth meets a first preset condition;
The capacity type memory expansion device refers to a memory expansion device in which the ratio of the memory capacity to the memory bandwidth meets a second preset condition;
the balanced memory expansion device is a memory expansion device in which a ratio of the memory capacity to the memory bandwidth satisfies a third preset condition.
4. A method according to any of claims 1-3, wherein the memory requirement information indicates that the memory size requested is a target capacity and the memory type is a target type;
before determining, from the CXL memory pool, a target memory expansion device having a class matching the attribute indicator, the method further comprising:
And determining that the residual memory capacity of the memory expansion device with the target type memory in the CXL memory pool is larger than the target capacity.
5. The method according to claim 4, wherein, in the case where the attribute index indicated by the allocation request information is a bandwidth index, determining, from the CXL memory pool, a target memory expansion device whose class matches the attribute index, includes:
Acquiring uplink bandwidth of the computing equipment, and determining a bandwidth lower limit allocated to the computing equipment based on the uplink bandwidth; the uplink bandwidth of the computing device is determined based on the number of links between the computing device and the CXL switch;
Determining whether the target memory expansion device exists or not based on the bandwidth lower limit and a first preset priority order; the first preset priority order is used for indicating the order of the priorities of the memory expansion devices of different categories from high to low when the attribute index is the bandwidth index.
6. The method of claim 5, wherein the first predetermined priority order is: the system comprises a primary time delay bandwidth type memory expansion device, a primary time delay equalization type memory expansion device, a secondary time delay bandwidth type memory expansion device, a secondary time delay equalization type memory expansion device, a primary time delay capacity type memory expansion device and a secondary time delay capacity type memory expansion device.
7. The method according to claim 4, wherein, in the case where the attribute index indicated by the allocation request information is a latency index, determining, from the CXL memory pool, a target memory expansion device whose class matches the attribute index, includes:
Determining whether the target memory expansion device exists or not based on a second preset priority order; the second preset priority order is used for indicating the order of the priorities of the memory expansion devices of different categories from high to low when the attribute index is the time delay index.
8. The method of claim 7, wherein the second predetermined priority order is: the system comprises a first-stage time delay capacity type memory expansion device, a first-stage time delay balanced type memory expansion device, a first-stage time delay bandwidth type memory expansion device, a second-stage time delay capacity type memory expansion device, a second-stage time delay balanced type memory expansion device and a second-stage time delay bandwidth type memory expansion device.
9. The method of any of claims 4-8, wherein allocating memory from the target memory expansion device for the computing device that meets the memory requirement information comprises:
determining whether the capacity of the memory of the target type of the target memory expansion device is greater than or equal to the target capacity;
And under the condition that the capacity of the memory of the target type of the target memory expansion device is larger than or equal to the target capacity, allocating the memory of the target capacity for the computing device from the target memory expansion device.
10. An electronic device comprising a processor and a memory; the processor and the memory are coupled;
the memory is used for storing computer program instructions;
The processor for invoking computer program instructions in the memory to perform the method of any of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410362722.5A CN118210629A (en) | 2024-03-27 | 2024-03-27 | Memory allocation method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410362722.5A CN118210629A (en) | 2024-03-27 | 2024-03-27 | Memory allocation method and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118210629A true CN118210629A (en) | 2024-06-18 |
Family
ID=91447245
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410362722.5A Pending CN118210629A (en) | 2024-03-27 | 2024-03-27 | Memory allocation method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118210629A (en) |
-
2024
- 2024-03-27 CN CN202410362722.5A patent/CN118210629A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10637916B2 (en) | Method and device for storage resource allocation for video cloud storage | |
CN110120915B (en) | Three-level decomposed network architecture system, device and method for ensuring service quality in three-level decomposed network architecture | |
US9225668B2 (en) | Priority driven channel allocation for packet transferring | |
EP3293969A1 (en) | Method of terminal-based conference load-balancing, and device and system utilizing same | |
CN110096220B (en) | Distributed storage system, data processing method and storage node | |
US10616134B1 (en) | Prioritizing resource hosts for resource placement | |
CN110244901B (en) | Task allocation method and device and distributed storage system | |
US20140036680A1 (en) | Method to Allocate Packet Buffers in a Packet Transferring System | |
CN112306651A (en) | Resource allocation method and resource borrowing method | |
CN108228350B (en) | Resource allocation method and device | |
CN112052100A (en) | Virtual machine communication method and equipment based on shared memory | |
CN114595043A (en) | IO (input/output) scheduling method and device | |
CN108399102A (en) | A kind of resource allocation methods and device | |
CN110515728B (en) | Server scheduling method and device, electronic equipment and machine-readable storage medium | |
CN116483740B (en) | Memory data migration method and device, storage medium and electronic device | |
CN113672171A (en) | Distributed object storage method, device and system and metadata server | |
CN109995667A (en) | The method and sending device of transmitting message | |
CN111831451A (en) | Cloud host memory allocation method, cloud host, cloud device and storage medium | |
CN118210629A (en) | Memory allocation method and electronic equipment | |
CN115878309A (en) | Resource allocation method, device, processing core, equipment and computer readable medium | |
CN110046040B (en) | Distributed task processing method and system and storage medium | |
CN113472591A (en) | Method and device for determining service performance | |
CN111092817A (en) | Data transmission method and device | |
CN113992572B (en) | Routing method, device and storage medium for shared storage resource path in heterogeneous network | |
US20220231963A1 (en) | Resource management device, control circuit, storage medium, and resource management method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |