Dynamic memory grading method and device
Through PEBS technology and SLA judgment, the memory layer resources are dynamically adjusted and filled in descending order of memory page popularity, which solves the problems of low memory utilization and inaccurate data differentiation in the existing technology and improves system performance.
Patent Information
- Application Number
- CN202411026205.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-08-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technology cannot achieve dynamic memory adjustment, resulting in low performance utilization, and lacks accurate distinction between hot data and cold data, resulting in hot data not being placed in fast storage in a timely manner, reducing overall system performance.
PEBS technology is used to periodically obtain the access data of co-located loads, determine the popularity of memory pages, determine whether the access delay meets the SLA index, dynamically adjust the resource configuration of the performance layer and capacity layer, fill in descending order of memory page popularity, and prioritize the most popular memories. Pages are placed in the performance tier.
It realizes dynamic memory adjustment, improves performance utilization, accurately distinguishes hot data and cold data, enables hot data to be placed in fast storage in a timely manner, and improves overall system performance.
Smart Images

Figure CN118550845A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of cloud computing, and in particular relates to a dynamic memory grading method and device. Background Art
[0002] In recent years, with the rapid development of big data business, the cost of memory usage has continued to rise. In order to improve performance, memory-intensive applications generally adopt data caching strategies to allocate memory resources as much as possible to reduce slow hard disk I / O. This leads to a high server memory allocation rate, but only a small part of the data is actually frequently used. The ratio of virtual machine memory capacity to CPU core number is gradually increasing, while the ratio on physical machines shows the opposite trend, mainly because application loads tend to have large working sets and low locality. Due to the limited growth of physical memory capacity and the increasing cost investment, the industry has begun to explore lower-cost storage media alternatives and high-speed interconnect technologies, such as the development of low-speed, large-capacity storage media.
[0003] CPU and memory resources are allocated to virtual machines in a tightly coupled manner, resulting in uneven resource allocation and fragmentation. Memory pooling technology in separate data centers allows CPU and memory resources to be reused across nodes, but it also raises challenges such as increased latency and performance degradation in accessing remote memory. Memory hierarchical dynamic management has attracted the attention of researchers in recent years by establishing a hierarchical architecture to achieve efficient resource management between different storage media. Memory hierarchical management needs to solve the page migration problem, that is, determining which memory data should reside in fast storage and which can be accessed in slow storage without migration.
[0004] However, existing technologies mainly use passive system-level management to expand memory. When memory is insufficient, data is eliminated and swapped in. Dynamic memory adjustment cannot be achieved, resulting in low performance utilization. When facing cache replacement, there is a lack of accurate distinction between hot data and cold data, resulting in hot data not being placed in fast storage in time, and cold data occupying valuable fast storage resources, thereby reducing overall system performance. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the purpose of the invention is to provide a dynamic memory grading method and device, by exchanging the performance layer memory resources owned by each co-located load in the performance layer resource candidate set reduced and the performance layer resource candidate set increased, the performance layer resource configuration and the capacity layer resource configuration are updated, and according to the updated performance layer resource configuration and the capacity layer resource configuration, the memory pages with higher heat ranking are filled into the performance layer in descending order of their heat, so as to realize dynamic memory adjustment and improve performance utilization; at the same time, hot data and cold data are accurately distinguished to improve overall performance.
[0006] A first aspect of the present invention provides a dynamic memory classification method, comprising: S1, periodically obtains access data of multiple co-located loads through PEBS technology; S2, determining the heat of each memory page corresponding to the virtual address associated with the co-located load according to the access data; S3, obtaining memory resource access time of the performance layer and the capacity layer, and determining the access latency of each co-located load according to the memory resource access time; S4, determining whether the access latency of each co-located load meets the SLA indicator. If so, adding the co-located load that meets the SLA indicator to the candidate set of reducing performance layer resources; otherwise, adding the co-located load that does not meet the SLA indicator to the candidate set of increasing performance layer resources; S5, exchanging the performance layer memory resources owned by each co-located load in the candidate set for reducing performance layer resources and the candidate set for increasing performance layer resources, and updating the performance layer resource configuration and the capacity layer resource configuration; S6, according to the updated performance layer resource configuration and capacity layer resource configuration, the memory pages with higher heat ranking are filled into the performance layer first in descending order of heat.
[0007] Furthermore, after S3, the method further includes: S7: Reserve a first preset proportion of performance layer memory resources for each of the co-located loads as a temporary storage area.
[0008] Furthermore, the proportion of the performance layer memory resources used for exchange processing of the co-located load to the total performance layer memory resources is less than a second preset proportion.
[0009] Furthermore, the S2 specifically includes: S201, determining a virtual address of each of the co-located loads according to the access data; S202, counting and counting the memory pages corresponding to the virtual address according to the virtual address; S203, based on a preset time, perform aging processing on the memory page count statistics result to obtain the memory page access count: Where C[t] represents the memory page access count at time t, x[t] represents the latest sampled count of the memory page at time t, C[t-1] represents the memory page access count at time t-1, and a represents the aging factor; S204, using the memory page access count as the heat of the memory page.
[0010] Furthermore, the S6 is specifically: Fill each memory page one by one in descending order of heat to determine whether the performance layer has remaining capacity. If so, fill the current memory page into the performance layer; otherwise, fill the current memory page into the capacity layer.
[0011] A second aspect of the present invention provides a dynamic memory hierarchical device, comprising: An acquisition module, used for periodically acquiring access data of multiple co-located loads through PEBS technology; A first determination module, configured to determine the heat of each memory page corresponding to each of the co-located load-related virtual addresses according to the access data; A second determination module is used to obtain memory resource access time of the performance layer and the capacity layer, and determine the access delay of each co-located load according to the memory resource access time; A judgment module is used to judge whether the access delay of each co-located load meets the SLA indicator. If so, the co-located load that meets the SLA indicator is added to the candidate set of reducing performance layer resources; otherwise, the co-located load that does not meet the SLA indicator is added to the candidate set of increasing performance layer resources; An updating module, configured to exchange the performance layer memory resources owned by each co-located load in the candidate set for reducing performance layer resources and the candidate set for increasing performance layer resources, and update the performance layer resource configuration and the capacity layer resource configuration; The filling module is used to fill the memory pages with higher heat ranking into the performance layer first according to the updated performance layer resource configuration and capacity layer resource configuration, in descending order of the heat of the memory pages.
[0012] Furthermore, the device comprises: A reservation module is used to reserve a first preset ratio of performance layer memory resources for each of the co-located loads as a temporary storage area Furthermore, the proportion of the performance layer memory resources used for exchange processing of the co-located load to the total performance layer memory resources is less than a second preset proportion.
[0013] Furthermore, the first determining module is used for: Determining a virtual address of each of the co-located loads according to the access data; According to the virtual address, counting statistics are performed on the memory page corresponding to the virtual address; Based on the preset time, the memory page count statistics are aged to obtain the memory page access count: Where C[t] represents the memory page access count at time t, x[t] represents the latest sampled count of the memory page at time t, C[t-1] represents the memory page access count at time t-1, and a represents the aging factor; The memory page access count is used as the memory page heat.
[0014] Furthermore, the filling module is used for: Fill each memory page one by one in descending order of heat to determine whether the performance layer has remaining capacity. If so, fill the current memory page into the performance layer; otherwise, fill the current memory page into the capacity layer.
[0015] The beneficial effects of the present invention are as follows: The method and device of the present invention determine whether the access delay of each co-located load meets the SLA indicator. If so, the co-located load that meets the SLA indicator is added to the candidate set for reducing performance layer resources; otherwise, the co-located load that does not meet the SLA indicator is added to the candidate set for increasing performance layer resources, and the performance layer memory resources owned by each co-located load in the candidate set for reducing performance layer resources and the candidate set for increasing performance layer resources are exchanged, the performance layer resource configuration and the capacity layer resource configuration are updated, dynamic memory adjustment is achieved, and performance utilization is improved; by filling the memory pages in descending order of heat according to the updated performance layer resource configuration and capacity layer resource configuration, the memory pages with higher heat ranking are filled into the performance layer first, hot data and cold data are accurately distinguished, hot data is placed in fast storage in a timely manner, and the overall system performance is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0017] Figure 1 A schematic diagram of a flow chart of a dynamic memory classification method provided by an embodiment of the present invention; Figure 2 A schematic diagram of a flow chart of another dynamic memory classification method provided by an embodiment of the present invention; Figure 3 A schematic diagram of the structure of a dynamic memory classification device provided by an embodiment of the present invention; Figure 4 A schematic diagram of the structure of a dynamic memory hierarchical system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0019] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0020] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0021] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and devices consistent with some aspects of the present invention as detailed in the appended claims.
[0022] The present invention proposes a dynamic memory classification method and device, which solves the problem that the existing technology mainly expands memory through passive system-level management, and only eliminates and replaces data when the memory is insufficient, and cannot realize dynamic memory adjustment, resulting in low performance utilization. When facing cache replacement, there is a lack of accurate distinction between hot data and cold data, resulting in hot data not being placed in fast storage in time, cold data occupying valuable fast storage resources, thereby reducing the overall system performance and other problems.
[0023] Method Embodiment Reference Manual Attached Figure 1 , showing a flow chart of a dynamic memory grading method provided in an embodiment of the present invention.
[0024] Reference Manual Attached Figure 2 , showing a flow chart of another dynamic memory classification method provided by an embodiment of the present invention.
[0025] An embodiment of the present invention provides a dynamic memory classification method, comprising: Specifically, the method includes steps S1 to S6.
[0026] S1, periodically obtains access data of multiple co-located loads through PEBS technology.
[0027] Specifically, the CPU's PEBS technology is used to perform lightweight memory access sampling to obtain the process number and virtual address of the load.
[0028] In the present invention, the access data of multiple co-located loads are periodically obtained through the PEBS technology, and the PEBS technology of the CPU is specifically used to perform lightweight memory access sampling. Real-time monitoring and fine-grained analysis of the system memory access behavior can be achieved under the premise of low overhead and high precision, thereby optimizing resource allocation, improving system performance and stability, and ensuring service quality.
[0029] S2, determining the heat of the memory pages corresponding to the virtual addresses associated with each co-located load according to the access data.
[0030] In a possible implementation, S2 specifically includes: S201, determining the virtual address of each co-located load according to the access data.
[0031] S202: Count and count the memory pages corresponding to the virtual addresses according to the virtual addresses.
[0032] It should be noted that in order to reflect the changes in access trends and capture the dynamic variability of the load regarding memory access, the page count statistics recorded for each load will be aged at regular intervals. The present invention uses an exponential moving average algorithm for aging. This process ages the load's past access statistics on memory pages according to weights, and pays more attention to the latest sampling results.
[0033] S203, based on a preset time, perform aging processing on the memory page count statistics result to obtain the memory page access count: Wherein, C[t] represents the memory page access count at time t, x[t] represents the latest sampled count of the memory page at time t, C[t-1] represents the memory page access count at time t-1, and α represents the aging factor.
[0034] In the present invention, an exponential moving average algorithm is used for aging processing to ensure high sensitivity to the latest access data while maintaining the influence of historical data, thereby providing a more reliable heat calculation result.
[0035] It should be noted that those skilled in the art can set the preset time according to actual needs, and the present invention is not limited thereto.
[0036] S204, using the memory page access count as the heat of the memory page.
[0037] In the present invention, the access count is used as the memory page heat to provide a basis for resource allocation, ensuring that high-heat memory pages can be processed first and improve system performance. At the same time, by aging the memory page access count, it is possible to avoid memory pages that have not been used for a long time from occupying high-performance memory resources, thereby improving system stability and resource utilization efficiency.
[0038] S3 obtains the memory resource access time of the performance layer and the capacity layer, and determines the access latency of each co-located load based on the memory resource access time.
[0039] It should be noted that after sampling is completed, it is necessary to maintain the performance statistics of the load's memory access during all sampling processes, and use the method of sending non-time-effective access instructions in the background to obtain the memory resource access time of the performance layer and the capacity layer respectively, which is used to characterize the latency of each event in the sampling record. Here, the periodic sampling results are regarded as streaming data, and the online percentile calculation method with low memory overhead such as DDSketch is used to maintain the P90 latency of each load on memory access (assuming that the P90 latency is about 150ns as the load SLA). The present invention assumes that the memory access SLA requirements of the loads co-located on the same node are the same.
[0040] Among them, DDSketch is a histogram-based data structure for probabilistic data streams, mainly used to efficiently estimate high quantiles and other statistics of distributions. Its design goal is to provide highly accurate quantile estimates while maintaining high efficiency in memory and computation.
[0041] In the present invention, by obtaining the memory resource access time of the performance layer and the capacity layer, efficient and accurate latency monitoring and optimization can be achieved. It can provide high-precision quantile estimation and respond to system load changes in real time under the premise of low memory and computing overhead, ensuring that system performance always meets SLA requirements, thereby improving the overall performance and stability of the system.
[0042] In a possible implementation manner, after S3, the following steps are further included: S7: Reserve a first preset proportion of performance layer memory resources for each co-located load as a temporary storage area.
[0043] In the present invention, when the load suddenly increases, the reserved performance layer memory resources can be used for temporary buffering to ensure that the system can smoothly cope with burst traffic, avoid sudden performance drops, and provide higher stability and flexibility in various complex scenarios.
[0044] It should be noted that those skilled in the art can set the size of the first preset ratio according to actual needs, and the present invention is not limited thereto.
[0045] S4, determining whether the access latency of each co-located load meets the SLA indicator, if so, adding the co-located load that meets the SLA indicator to the candidate set for reducing performance layer resources, otherwise, adding the co-located load that does not meet the SLA indicator to the candidate set for increasing performance layer resources.
[0046] Among them, the Service-Level-Agreement (SLA) is an agreement reached between a service provider and a customer, which aims to clarify the expectations and obligations of both parties in terms of service quality, performance and response time.
[0047] Specifically, based on the observed satisfaction, the loads are divided into +slack and -slack types, which represent the urgency and abundance of resources for different loads to meet the access latency target. +slack means that the access latency does not meet the SLA requirements, and the larger the value, the more serious the load performance degradation. -slack means that the access latency meets the SLA requirements, and the smaller the value, the better the load performance. By exchanging the performance layer memory resources of the +slack and -slack sets of loads, the memory access latency performance differences of different loads can be reduced.
[0048] In the present invention, by adding the load that meets the SLA index and the load that does not meet the SLA index to the candidate set of reducing and increasing performance layer resources, and adjusting resources according to +slack and -slack, resource allocation can be dynamically optimized, the overall performance and stability of the system can be improved, the service quality can be ensured to meet expectations, the resource utilization efficiency can be maximized, and the load environment can be adapted to changes. This method can not only improve the service level of the system, but also reduce the performance differences between different loads and enhance the elasticity and resilience of the system.
[0049] S5: Exchange the performance layer memory resources owned by each co-located load in the reduced performance layer resource candidate set and the increased performance layer resource candidate set, and update the performance layer resource configuration and the capacity layer resource configuration. Specifically, the exchange granularity of the performance layer memory resources between different loads is performed at a granularity of 2MB. The loads in the +slack set are traversed from large to small, and the loads in the -slack set arranged from small to large are traversed and exchanged in a circular manner.
[0050] For example, the +slack set is {20,10,5}, and the -slack set is {-5,-3}. Then the load represented by 20 will obtain 2MB of performance layer memory resources from the load represented by -5, the load represented by 10 will obtain 2MB of performance layer memory resources from the load represented by -3, and the load represented by 5 will obtain 2MB of performance layer memory resources from the load represented by -5 again. It should be pointed out that for each load, the reduction / increase of performance layer memory resources means the increase / decrease of capacity layer memory resources.
[0051] In the present invention, the system can adjust resource allocation in real time according to load changes, adapt to changing workload requirements, maintain efficient operation and stability of the system, and improve the adaptability and flexibility of the system.
[0052] In a possible implementation manner, the proportion of performance layer memory resources used for exchange processing of the co-located load to the total performance layer memory resources is less than a second preset proportion.
[0053] Specifically, each load is restricted to release a second preset proportion of performance layer memory resources to other loads at most, so as to impose resource restrictions on a small number of "neighbor-disturbing" loads.
[0054] It should be noted that those skilled in the art can set the size of the second preset ratio according to actual needs, and the present invention is not limited thereto.
[0055] In the present invention, the proportion of performance layer memory resources used for co-located load exchange processing to total performance layer memory resources is less than a second preset proportion, ensuring that the resource exchange process does not lead to excessive resource allocation or waste, in compliance with a preset resource management strategy.
[0056] In summary, through the above methods, the resource utilization efficiency of the system can be effectively optimized, the service quality can be improved, and the operating cost and management complexity can be reduced, which brings significant improvements to resource management in a multi-load co-location environment.
[0057] S6, according to the updated performance layer resource configuration and capacity layer resource configuration, the memory pages with higher heat ranking are filled into the performance layer first in descending order of heat.
[0058] In a possible implementation manner, S6 specifically includes: In descending order of popularity, each memory page is filled one by one to determine whether there is remaining capacity in the performance layer. If so, the current memory page is filled to the performance layer. Otherwise, the current memory page is filled to the capacity layer.
[0059] In the present invention, high-heat memory pages are filled into the performance layer first, which can significantly reduce the access delay of these memory pages. At the same time, through the heat sorting filling method, the system can place the most frequently accessed memory pages in the performance layer to ensure the maximum utilization of the memory resources of the performance layer.
[0060] Furthermore, by optimizing the distribution of memory pages, the system load and resource competition can be reduced, and the stability and reliability of the system can be improved. This helps reduce performance fluctuations and unexpected system behaviors caused by resource competition. At the same time, the degree-sorted filling method can dynamically adjust the resource allocation strategy according to the changes in the memory page access pattern to adapt to load changes. This flexibility can effectively cope with the challenges brought by different workloads and keep the system running efficiently.
[0061] The beneficial effects of the present invention are as follows: By judging whether the access delay of each co-located load meets the SLA indicator, if so, the co-located load that meets the SLA indicator is added to the candidate set for reducing performance layer resources; otherwise, the co-located load that does not meet the SLA indicator is added to the candidate set for increasing performance layer resources, the performance layer memory resources owned by each co-located load in the candidate set for reducing performance layer resources and the candidate set for increasing performance layer resources are exchanged, the performance layer resource configuration and the capacity layer resource configuration are updated, dynamic memory adjustment is achieved, and performance utilization is improved; by filling the memory pages in descending order of their heat according to the updated performance layer resource configuration and capacity layer resource configuration, the memory pages with higher heat ranking are filled into the performance layer first, hot data and cold data are accurately distinguished, hot data is placed in fast storage in time, and the overall system performance is improved.
[0062] Device Embodiment Reference Manual Attached Figure 3 , showing a schematic structural diagram of a dynamic memory grading device provided in an embodiment of the present invention.
[0063] An embodiment of the present invention provides a dynamic memory classification device 20, comprising: An acquisition module 201 is used to periodically acquire access data of multiple co-located loads through PEBS technology; A first determination module 202, configured to determine the heat of each memory page corresponding to each of the co-located load-related virtual addresses according to the access data; The second determination module 203 is used to obtain the memory resource access time of the performance layer and the capacity layer, and determine the access delay of each co-located load according to the memory resource access time; The judgment module 204 is used to judge whether the access delay of each co-located load meets the SLA indicator. If so, the co-located load that meets the SLA indicator is added to the candidate set of reducing performance layer resources; otherwise, the co-located load that does not meet the SLA indicator is added to the candidate set of increasing performance layer resources; An updating module 205 is used to exchange the performance layer memory resources owned by each co-located load in the candidate set for reducing performance layer resources and the candidate set for increasing performance layer resources, and update the performance layer resource configuration and the capacity layer resource configuration; The filling module 206 is used to fill the memory pages with higher heat ranking into the performance layer first according to the updated performance layer resource configuration and capacity layer resource configuration and in descending order of the heat of the memory pages.
[0064] In a possible implementation, the device includes: A reservation module is used to reserve a first preset proportion of performance layer memory resources for each of the co-located loads as a temporary storage area. In a possible implementation manner, the proportion of the performance layer memory resources used for exchange processing of the co-located load to the total performance layer memory resources is less than a second preset proportion.
[0065] In a possible implementation manner, the first determining module 202 is configured to: Determining a virtual address of each of the co-located loads according to the access data; According to the virtual address, counting statistics are performed on the memory page corresponding to the virtual address; Based on the preset time, the memory page count statistics are aged to obtain the memory page access count: Where C[t] represents the memory page access count at time t, x[t] represents the latest sampled count of the memory page at time t, C[t-1] represents the memory page access count at time t-1, and α represents the aging factor; The memory page access count is used as the memory page heat.
[0066] In a possible implementation, the filling module 206 is used to: Fill each memory page one by one in descending order of heat to determine whether the performance layer has remaining capacity. If so, fill the current memory page into the performance layer; otherwise, fill the current memory page into the capacity layer.
[0067] The dynamic memory grading device 20 provided by the present invention can implement various dynamic memory grading methods in the above method embodiments and can obtain the same technical effects. To avoid repetition, the present invention will not go into details.
[0068] System Example Reference Manual Attached Figure 4 , showing a schematic diagram of the structure of a dynamic memory hierarchical system provided by an embodiment of the present invention.
[0069] The present invention proposes a dynamic memory hierarchical system 30 , including: a memory 303 and one or more processors 301 .
[0070] One or more application programs are stored in the memory 303 , and the one or more application programs are suitable for being executed by the one or more processors 301 to implement the dynamic memory grading method described in the method embodiment.
[0071] The dynamic memory hierarchical system 30 includes: a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, for example, via a bus 302.
[0072] The structure of the dynamic memory hierarchical system 30 does not constitute a limitation on the embodiment of the present invention.
[0073] Processor 301 may be a CPU, a general purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0074] The bus 302 may include a path to transmit information between the above components. The bus 302 may be a PCI bus or an EISA bus, etc. The bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0075] The memory 303 can be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including a compressed optical disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0076] Computer Readable Storage Medium Embodiments The present invention provides a computer-readable storage medium on which a computer program is stored. The computer program can be loaded and executed by a processor according to the dynamic memory classification method described in the first aspect.
[0077] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.
[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. A dynamic memory classification method, characterized in that: include: S1, periodically obtains access data of multiple co-located loads through PEBS technology; S2, determining the heat of each memory page corresponding to the virtual address associated with the co-located load according to the access data; S3, obtaining memory resource access time of the performance layer and the capacity layer, and determining the access latency of each co-located load according to the memory resource access time; S4, determining whether the access latency of each co-located load meets the SLA indicator. If so, adding the co-located load that meets the SLA indicator to the candidate set of reducing performance layer resources; otherwise, adding the co-located load that does not meet the SLA indicator to the candidate set of increasing performance layer resources; S5, exchanging the performance layer memory resources owned by each co-located load in the candidate set for reducing performance layer resources and the candidate set for increasing performance layer resources, and updating the performance layer resource configuration and the capacity layer resource configuration; S6, according to the updated performance layer resource configuration and capacity layer resource configuration, the memory pages with higher heat ranking are filled into the performance layer first in descending order of heat.
2. The dynamic memory grading method according to claim 1, characterized in that: After S3, the following is also included: S7: Reserve a first preset proportion of performance layer memory resources for each of the co-located loads as a temporary storage area.
3. The dynamic memory classification method according to claim 1, characterized in that: The proportion of the performance layer memory resources used for exchange processing of the co-located load to the total performance layer memory resources is less than a second preset proportion.
4. The dynamic memory classification method according to claim 1, characterized in that: The S2 specifically includes: S201, determining a virtual address of each of the co-located loads according to the access data; S202, counting and counting the memory pages corresponding to the virtual address according to the virtual address; S203, based on a preset time, perform aging processing on the memory page count statistics result to obtain the memory page access count: Where C[t] represents the memory page access count at time t, x[t] represents the latest sampled count of the memory page at time t, C[t-1] represents the memory page access count at time t-1, and α represents the aging factor; S204, using the memory page access count as the heat of the memory page.
5. The dynamic memory grading method according to claim 1, characterized in that: The S6 is specifically: Fill each memory page one by one in descending order of heat to determine whether the performance layer has remaining capacity. If so, fill the current memory page into the performance layer; otherwise, fill the current memory page into the capacity layer.
6. A dynamic memory hierarchical device, characterized in that: The device comprises: An acquisition module, used for periodically acquiring access data of multiple co-located loads through PEBS technology; A first determination module, configured to determine the heat of each memory page corresponding to each of the co-located load-related virtual addresses according to the access data; A second determination module is used to obtain memory resource access time of the performance layer and the capacity layer, and determine the access delay of each co-located load according to the memory resource access time; A judgment module is used to judge whether the access delay of each co-located load meets the SLA indicator. If so, the co-located load that meets the SLA indicator is added to the candidate set of reducing performance layer resources; otherwise, the co-located load that does not meet the SLA indicator is added to the candidate set of increasing performance layer resources; An updating module, configured to exchange the performance layer memory resources owned by each co-located load in the candidate set for reducing performance layer resources and the candidate set for increasing performance layer resources, and update the performance layer resource configuration and the capacity layer resource configuration; The filling module is used to fill the memory pages with higher heat ranking into the performance layer first according to the updated performance layer resource configuration and capacity layer resource configuration, in descending order of the heat of the memory pages.
7. The dynamic memory hierarchical device according to claim 6, characterized in that: The device comprises: The reservation module is used to reserve a first preset proportion of performance layer memory resources for each of the co-located loads as a temporary storage area.
8. The dynamic memory hierarchical device according to claim 6, characterized in that: The proportion of the performance layer memory resources used for exchange processing of the co-located load to the total performance layer memory resources is less than a second preset proportion.
9. The dynamic memory hierarchical device according to claim 6, characterized in that: The first determining module is used for: Determining a virtual address of each of the co-located loads according to the access data; According to the virtual address, counting statistics are performed on the memory page corresponding to the virtual address; Based on the preset time, the memory page count statistics are aged to obtain the memory page access count: Where C[t] represents the memory page access count at time t, x[t] represents the latest sampled count of the memory page at time t, C[t-1] represents the memory page access count at time t-1, and α represents the aging factor; The memory page access count is used as the memory page heat.
10. The dynamic memory hierarchical device according to claim 6, characterized in that: The filling module is used for: Fill each memory page one by one in descending order of heat to determine whether the performance layer has remaining capacity. If so, fill the current memory page into the performance layer; otherwise, fill the current memory page into the capacity layer.
Citation Information
Patent Citations
Memory management method, memory management device and memory device
CN104536909A
Hierarchical resource management method, device and system for hyper-converged infrastructure
CN108073457A
Data movement between storage tiers of clustered storage system based on predicted data access frequency trend patterns
CN115202563A
Data block activeness valuation and data migration method based on access behavior
CN116204117A
Storage managing system, computer system, and storage managing method
US20120311260A1
