Memory scheduling method and device, electronic equipment, medium and program product

By dividing the memory hierarchy in the hybrid memory system, configuring hot and cold thresholds based on the container's memory data attributes and access heat map, dynamically scanning the container access heat, and performing memory page scheduling based on the container's importance weight, the problem of unreasonable hot and cold scheduling in the hybrid memory system is solved, and system performance and resource utilization efficiency are improved.

CN120653367APending Publication Date: 2025-09-16CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510779919.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In the existing technology, the hot and cold scheduling of memory pages in hybrid memory systems is unreasonable, which leads to challenges in system performance. In particular, the read and write performance of heterogeneous memory is lower than that of local memory, and it is impossible to effectively identify and schedule fine-grained load differences within containers, affecting the overall performance of the system.

Method used

By dividing the memory tiers in the hybrid memory system, configuring hot and cold thresholds based on the container's memory data attributes and access heat map, dynamically scanning the container access heat, and performing memory page scheduling based on the container importance weight, hot and cold data are identified and migrated to the appropriate memory tier.

Benefits of technology

It achieves the globality and rationality of memory page scheduling, improves the performance of hybrid memory architecture in container technology environments, ensures the performance of core business containers, and optimizes the allocation and utilization of memory resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653367A_ABST
    Figure CN120653367A_ABST
Patent Text Reader

Abstract

The invention provides a memory scheduling method and device, electronic equipment, a medium and a program product, and relates to the technical field of computers. The memory scheduling method comprises the steps of dividing memory hierarchies for the hybrid memory system on the basis of a performance index of a far-end memory; dynamically scanning the container based on the attribute of the memory data in the container to obtain a container access heat map; configuring a cold and hot threshold value of the container for the importance weight allocated to the container and the memory hierarchy based on the container access heat map; and performing memory page scheduling on the container based on the cold and hot threshold and the container access heat map. According to the technical scheme, scheduling of the memory page in the container gives consideration to data heat, container importance and dynamic data features, and rationality of cold and hot scheduling of the memory page is improved while global scheduling of the memory page is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a memory scheduling method, a memory scheduling device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the continuous evolution of computing system architecture, hybrid memory systems are formed by expanding local and remote heterogeneous memory architectures. Although hybrid memory systems implement dynamic allocation and optimized management of memory resources to improve system scalability, the read and write performance of expanded heterogeneous memory is far lower than that of local memory, posing performance challenges to the system. Therefore, a solution for reasonable hot and cold scheduling of memory pages is urgently needed.

[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the Invention

[0004] The purpose of the present disclosure is to provide a memory scheduling method, scheduling device, electronic device, storage medium and computer program product, which at least to some extent overcome the problem of unreasonable hot and cold scheduling of memory pages in related technologies.

[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.

[0006] According to one aspect of the present disclosure, a memory scheduling method is provided, which is applied to an electronic device, wherein the electronic device is configured with a hybrid memory system including remote memory, and the electronic device is also deployed with multiple containers. The memory scheduling method includes: dividing the hybrid memory system into memory hierarchies based on performance indicators of the remote memory; dynamically scanning the containers based on memory data attributes within the containers to obtain a container access heat map; configuring hot and cold thresholds of the containers based on the container access heat map, the importance weights assigned to the containers, and the memory hierarchies; and performing memory page scheduling on the containers based on the hot and cold thresholds and the container access heat map.

[0007] In one embodiment of the present disclosure, dynamically scanning the container based on memory data attributes within the container to obtain a container access heat map includes: configuring scanning parameters for the container based on the memory data attributes, the scanning parameters including a scanning interval; and dynamically scanning the container based on the scanning parameters to obtain the container access heat map.

[0008] In one embodiment of the present disclosure, the memory data attributes include page attributes and / or life cycle attributes, the page attributes include whether the memory data is an anonymous page or a file page, and the life cycle attributes include whether the memory data is temporary data or long-term data. The scanning parameters for the container are configured based on the memory data attributes, including: determining a first proportion of the anonymous pages based on the anonymous pages and the file pages; determining a second proportion of the temporary data based on the temporary data and the long-term data; determining a third proportion based on the ratio between the access frequency of the memory data and the statistical average frequency of the multiple containers; determining an evaluation result of the memory data attributes based on the first proportion and the corresponding first weight, the second proportion and the corresponding third weight, and the third proportion and the corresponding third weight; and configuring the corresponding scanning parameters based on the evaluation result.

[0009] In one embodiment of the present disclosure, the container is dynamically scanned based on the scanning parameters to obtain the container access heat map, including: calling a dynamic access monitor to scan the page table entries of the memory pages of the local memory and the remote memory of the electronic device based on the scanning parameters, respectively, to obtain local scanning results and remote scanning results, wherein, based on whether the access bit in the page table entry is set, it is judged whether the memory page is accessed within the time period corresponding to the scanning interval; a local access heat map is generated based on the page interval range of the local memory and the local scanning result; a remote access heat map is generated based on the page interval range of the remote memory and the remote scanning result; and a filter of the control group is called to filter the local access heat map and the remote access heat map based on the container representation, respectively, to obtain the container access heat map of each of the containers, wherein each of the containers corresponds to a group of the control group.

[0010] In one embodiment of the present disclosure, the scanning parameters also include a scanning area, and calling the dynamic access monitor to scan the page table entries of the memory pages in the local memory and the remote memory of the electronic device based on the scanning parameters, including: calling the dynamic access monitor to scan the page table entries in the scanning area in the local memory and the remote memory of the electronic device based on the scanning interval.

[0011] In one embodiment of the present disclosure, the filter of the control group is called to filter the local access heat map and the remote access heat map based on the container representation to obtain the container access heat map of each container, including: calling the filter to traverse each page interval in the local access heat map and the remote access heat map to determine the process identifier that has accessed the page interval; obtaining the corresponding control group name based on the process identifier to accumulate the number of visits to the page interval under the same control group to the heat map of the control group; based on the mapping relationship between the control group and the corresponding container representation, determining the heat map of the control group as the container access heat map.

[0012] In one embodiment of the present disclosure, configuring the hot and cold thresholds of the container based on the container access heat map, the importance weight assigned to the container, and the memory hierarchy includes: obtaining a corresponding weighted heat map based on the container access heat map and the corresponding importance weight, wherein the importance weight is determined based on the memory data attribute; merging the weighted heat maps of the multiple containers and arranging them according to the heat value to obtain an aggregated heat map; and configuring the hot and cold thresholds of the container based on the memory hierarchy.

[0013] In one embodiment of the present disclosure, configuring the hot and cold thresholds of the container based on the memory hierarchy includes: traversing the aggregate heat map based on the start and end addresses of the local memory of the electronic device and the start and end addresses of the remote memory; determining the first hot and cold thresholds based on the heat value at the intersection of the local memory and the remote memory; the remote memory includes at least two levels, and determining the heat value at the intersection of any two levels of the remote memory as the second hot and cold thresholds.

[0014] In one embodiment of the present disclosure, memory page scheduling is performed on the container based on the hot and cold thresholds and the container access heat map, including: for any of the containers, memory page scheduling is performed based on the relationship between the weighted heat map and the first hot and cold thresholds and / or the second hot and cold thresholds.

[0015] In one embodiment of the present disclosure, the remote memory includes a first-level remote memory and a second-level remote memory, and the memory page scheduling is performed based on the relationship between the weighted heat map and the first hot and cold threshold and / or the second hot and cold threshold, including: based on the weighted heat map, detecting that the container has a first group of memory pages with a heat value less than the second hot and cold threshold, and the first group of memory pages is not in the second-level remote memory, then scheduling the memory data of the first group of memory pages to the second-level remote memory; detecting that the container has a second group of memory pages, the heat value of the second group of memory pages is greater than the second hot and cold threshold and less than the first hot and cold threshold, and the second group of memory pages is not in the first-level remote memory, then scheduling the memory data of the second group of memory pages to the first-level remote memory; detecting that the container has a third group of memory pages with a heat value greater than the first hot and cold threshold, and the third group of memory pages is not in the local memory, then scheduling the memory data of the third group of memory pages to the local memory.

[0016] In one embodiment of the present disclosure, memory page scheduling is performed on the container based on the hot and cold thresholds and the container access heat map, further comprising: calling a configured physical memory page migration function to allocate a new target physical page to the scheduled target node; creating a temporary mapping to copy data from the source memory page to the target physical page; traversing all processes that use the source memory page and modifying page table entries in the process based on the target physical page; refreshing the translation backup buffer to make the temporary mapping effective; and releasing the source memory page.

[0017] In one embodiment of the present disclosure, the hybrid memory system is divided into memory tiers based on the performance indicators of the remote memory, including: performing a stress test on the hybrid memory system based on the performance indicators, the performance indicators including at least one of read / write latency, bandwidth, and input / output operations per second (IOPS); determining an indicator value of the performance indicator based on a result of the stress test; and dividing the memory tiers based on the indicator value.

[0018] According to another aspect of the present disclosure, a memory scheduling device is provided, including: a partitioning module for partitioning the memory hierarchy for the hybrid memory system based on the performance indicators of the remote memory; a scanning module for dynamically scanning the container based on the memory data attributes in the container to obtain a container access heat map; a configuration module for configuring the hot and cold thresholds of the container based on the container access heat map, the importance weight assigned to the container, and the memory hierarchy; and a scheduling module for performing memory page scheduling on the container based on the hot and cold thresholds and the container access heat map.

[0019] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; the processor is configured to execute the memory scheduling method of the first aspect above by executing the executable instructions.

[0020] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned memory scheduling method is implemented.

[0021] According to another aspect of the present disclosure, a computer program product is provided, on which a computer program is stored. When the computer program is executed by a processor, the computer program implements the above-mentioned memory scheduling method.

[0022] The memory scheduling scheme provided by the embodiments of the present disclosure can configure the hot and cold thresholds of the container in combination with the importance weight of the container by determining the memory hierarchy of the hybrid memory system and the container access heat map of each container, and schedule memory pages according to the threshold and the heat map. The introduction of the container access heat map and the importance weight can capture the data access characteristics of the container by means of the container access heat map, and enable the scheduling operation to identify the importance of the container memory data with the help of the container importance weight. The importance of the container is considered when generating the hot and cold thresholds of the container, and the performance of the relatively isolated container is perceived from the outside, so that the scheduling of the memory pages in the container takes into account the data heat, container importance and dynamic data characteristics, and realizes the globality of memory page scheduling while improving the rationality of the hot and cold scheduling of memory pages. It is also conducive to ensuring the performance of the core business container and the performance of the hybrid memory architecture in the container technology application environment.

[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort.

[0025] Figure 1 A schematic diagram of a memory scheduling system according to an embodiment of the present disclosure is shown;

[0026] Figure 2 A flow chart of a memory scheduling method according to an embodiment of the present disclosure is shown;

[0027] Figure 3A schematic diagram showing a memory scheduling solution in an embodiment of the present disclosure is shown;

[0028] Figure 4 A schematic diagram showing another memory scheduling solution in an embodiment of the present disclosure;

[0029] Figure 5 A schematic diagram showing another memory scheduling solution in an embodiment of the present disclosure is shown;

[0030] Figure 6 A schematic diagram showing another memory scheduling system according to an embodiment of the present disclosure is shown;

[0031] Figure 7 A schematic diagram of a memory scheduling device according to an embodiment of the present disclosure is shown;

[0032] Figure 8 A structural block diagram of a computer device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0034] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0035] With the continuous evolution of computing system architecture, more flexible and efficient memory architectures are needed to improve overall system performance. The combination of NVM (Non-Volatile Memory) and CXL (Compute Express Link) can break the limitations of traditional memory architecture, build a more flexible heterogeneous memory hierarchy, and realize dynamic allocation and optimized management of memory resources, thereby improving system performance and scalability. However, since the read and write performance of extended memory such as NVM and CXL is far lower than that of local memory, system performance has been challenged.

[0036] In order to improve system performance, in a hybrid memory system consisting of local memory and remote extended memory, hot and cold scheduling of memory pages is required, such as Figure 1 As shown, the process runs on the CPU, and the CPU accesses the memory of the "local node" (i.e., local memory) at high speed and the memory of the "remote node" (i.e., remote memory) at low speed. For pages of the local node, if the access frequency is low, they are regarded as cold pages, which will trigger page degradation and migration to the remote node. For pages of the remote node, if the access frequency is high, they are regarded as hot pages, which will trigger page upgrade and migration to the local node. That is, frequently accessed hot pages and infrequently accessed cold pages are identified, and hot pages are placed in the local memory with high read and write performance, while cold pages are placed in the remote memory with lower performance. Since the processing method is mainly concentrated in the operating system, the operating system manages the memory, tracks the memory access, divides the memory data into cold data and hot data, and downgrades the cold data to the remote memory, and upgrades the hot data to the local memory.

[0037] In some embodiments, since container technology is also applied to hybrid memory systems, but there is currently no hybrid memory management design for container systems, current containers can only rely on the host operating system's memory hierarchical scheduling. The container uses the host's kernel, that is, from the host kernel's perspective, the container is a process group (Cgroup) and cannot perceive the fine-grained load differences within the container. The host kernel may uniformly schedule data in different containers according to global heat, while ignoring the characteristics of the container. For example, some containers have very important functions and cannot be scheduled in the same way as general containers. Even if the access heat is low, they should be placed in local memory to ensure the overall performance of the system, so that the scheduling operation will have a negative impact on the overall performance of the system.

[0038] Therefore, there is an urgent need for a hot and cold memory grading solution based on the container system to achieve memory scheduling.

[0039] To facilitate understanding, several terms involved in this application are first explained below.

[0040] Hybrid memory systems: New memory devices such as NVM (Non Volatile Memory), HBM (High Bandwidth Memory), and remote memory enabled by interconnect technologies like Compute Express Link (CXL) and Remote Direct Memory Access (RDMA) can be accessed by processes as remote nodes. While access latency and bandwidth performance of remote nodes are lower than those of local nodes, remote node memory offers advantages such as large capacity and low cost. A hybrid memory system is composed of both local and remote node memory.

[0041] Hot and cold memory tiering: Due to the different access characteristics of local and remote memory pages, frequently accessed hot data is placed on the local node to improve process performance, while infrequently accessed cold data is placed on the remote node to save local node memory space.

[0042] Data hot and cold scheduling: While ensuring application performance, data is placed in remote memory as much as possible to save more local memory to accommodate more services, which can effectively improve the efficiency of the data center.

[0043] Container technology: Leveraging the kernel features of the operating system to isolate applications. Containers are essentially applications running on a host, isolated from each other using Cgroup technology.

[0044] Below, each step of the memory scheduling method in this example implementation will be described in more detail with reference to the accompanying drawings and embodiments.

[0045] Figure 2 A flow chart of a memory scheduling method in an embodiment of the present disclosure is shown.

[0046] like Figure 2 As shown, a memory scheduling method according to an embodiment of the present disclosure is applied to an electronic device, wherein the electronic device is configured with a hybrid memory system including a remote memory and multiple containers are deployed in the electronic device. The memory scheduling method includes:

[0047] Step S202 : dividing the hybrid memory system into memory tiers based on the performance indicators of the remote memory.

[0048] In some embodiments, remote memory refers to memory resources that are physically separated from the current computing node (such as a local server) and connected via a network or high-speed interconnection protocol (such as CXL). It can expand the local memory capacity, but the performance such as access latency is different from that of local memory.

[0049] In some embodiments, performance indicators are used to measure parameters of remote memory performance, including but not limited to IOPS (input and output operations per second, reflecting the frequency of read and write operations), read and write latency (the time it takes to read and write data), bandwidth (data transmission volume per unit time), etc.

[0050] Step S204: Dynamically scan the container based on the memory data attributes in the container to obtain a container access heat map.

[0051] In some embodiments, memory data attributes refer to characteristics of the memory data itself, including but not limited to data access frequency, access pattern, data size, necessity of data retention, and page content type.

[0052] In some embodiments, dynamic scanning refers to periodically monitoring the status and access status of memory data in the container according to a certain strategy, and can timely capture changes in data attributes, such as when data changes from low-frequency access to high-frequency access within a certain period of time, so that subsequent scheduling strategies are reliable.

[0053] In some embodiments, a container access heat map refers to presenting the frequency distribution of access to different memory data in a container in the form of visual or structured data, allowing users to intuitively see which data is "hot data" (high-frequency access) and which is "cold data" (low-frequency access).

[0054] Step S206 : configuring hot and cold thresholds of the container based on the container access heat map, the importance weight assigned to the container, and the memory hierarchy.

[0055] In some embodiments, the importance weight refers to a weight value assigned to a container based on factors such as the criticality and priority of the business carried by the container.

[0056] In some embodiments, the hot / cold threshold of a container refers to a critical standard for distinguishing hot and cold memory data in the container.

[0057] Step S208 : performing memory page scheduling on the container based on the hot and cold thresholds and the container access heat map.

[0058] In some embodiments, hot data and cold data in the container access heat map can be identified based on hot and cold thresholds. Then, combined with the memory hierarchy, hot data can be scheduled to a high-performance, high-memory hierarchy, such as local DRAM, and cold data can be scheduled to a relatively low-performance but large-capacity, low-cost memory hierarchy, such as remote NVM, to optimize memory resource allocation and balance performance and cost.

[0059] In this embodiment, by determining the memory hierarchy of the hybrid memory system and the container access heat map of each container, the hot and cold thresholds of the container can be configured in combination with the container's importance weight, and memory pages are scheduled based on the thresholds and the heat map. The introduction of the container access heat map and the importance weight enables the container access characteristics to be captured by the container access heat map, and the importance weight of the container enables the scheduling operation to identify the importance of the container memory data. The importance of the container is considered when generating the hot and cold thresholds of the container, and the performance of the relatively isolated container is perceived from the outside, so that the scheduling of the memory pages in the container takes into account the data heat, container importance and dynamic data characteristics, and realizes the globality of memory page scheduling while improving the rationality of the hot and cold scheduling of memory pages. It is also beneficial to ensure the performance of the core business container and the performance of the hybrid memory architecture in the container technology application environment.

[0060] In one embodiment of the present disclosure, a container is dynamically scanned based on memory data attributes within the container to obtain a container access heat map, including:

[0061] Configure the container's scanning parameters based on memory data attributes, including the scanning interval. Dynamically scan the container based on the scanning parameters to obtain a container access heat map.

[0062] In some embodiments, memory data attributes in each container are obtained, and the memory data attributes include page attributes and / or life cycle attributes. The page attributes include whether the memory data is an anonymous page or a file page, and the life cycle attributes include whether the memory data is temporary data or long-term data.

[0063] Among them, temporary data refers to data used for short-term calculations, temporary caching, or single-task services. It does not need to be retained for a long time. It refers to data that needs to exist for a long time and still needs to be used across sessions or system restarts. For example, data older than one year can be considered long-term data.

[0064] Based on the attribute evaluation of memory data, determine the scanning parameters for monitoring each container. For example, for containers with a large number of anonymous pages and temporary data, where data changes frequently, use more fine-grained scanning parameters to capture changes in data access. For pages with a longer life cycle or file pages, use more coarse-grained scanning parameters.

[0065] In some embodiments, the scanning interval refers to a scanning frequency that is dynamically adjusted according to the characteristics of the container load.

[0066] In this embodiment, by configuring scanning parameters based on memory data attributes and dynamically scanning containers, the flexible configuration of scanning parameters can adapt to the load characteristics of different containers. The dynamic scanning mechanism ensures the timeliness of data and realizes fine-grained monitoring and visualization of memory access patterns in containers. The container access heat map generated thereby can reflect the active status of memory data in the container, making up for the defect that traditional host global scheduling cannot perceive the local access characteristics of the container, and providing a decision basis for subsequent page scheduling operations based on the container's own load characteristics.

[0067] In one embodiment of the present disclosure, configuring scan parameters for a container based on memory data attributes includes:

[0068] A first proportion of anonymous pages is determined based on anonymous pages and file pages; a second proportion of temporary data is determined based on temporary data and long-term data; a third proportion is determined based on a ratio between an access frequency of memory data and an average frequency of a plurality of containers obtained by statistics; an evaluation result of a memory data attribute is determined based on the first proportion and a corresponding first weight, the second proportion and a corresponding third weight, and the third proportion and a corresponding third weight; and corresponding scanning parameters are configured based on the evaluation result.

[0069] In some embodiments, anonymous pages (such as heap and stack memory) represent dynamically generated temporary data. A high proportion of anonymous pages may mean that the container load changes rapidly and requires high-frequency scanning. Temporary data (such as cache and session information) has a short life cycle and large fluctuations in access patterns. A high proportion indicates that the scanning interval needs to be shortened to capture rapid changes. By comparing the ratio of the current container to the average access frequency of the cluster, "abnormal" containers (such as containers with sudden high access) are identified. The larger the ratio, the more it indicates that the scanning interval needs to be shortened.

[0070] In some embodiments, based on the positive correlation between anonymous pages and / or temporary data and access frequency, the negative correlation between file pages and / or long-term data and access frequency, and the full anonymous page scan is performed on anonymous pages and / or temporary data, and the file page metadata scan is performed on file pages and / or long-term data, and the scanning parameters are configured.

[0071] In some embodiments, different weights are assigned to the three dimensions and a comprehensive evaluation result is calculated:

[0072] Evaluation result = first proportion × first weight + second proportion × second weight + third proportion × third weight.

[0073] In some embodiments, the evaluation results are mapped to scanning parameters, with high evaluation values ​​corresponding to high-frequency scanning and low evaluation values ​​corresponding to low-frequency scanning.

[0074] In this embodiment, by comprehensively considering multi-dimensional memory data attributes such as the proportion of anonymous pages, the proportion of temporary data, and the deviation of access frequency, and combining weighted evaluation to dynamically configure container scanning parameters, the scanning strategy is coupled with the container load characteristics. The scanning frequency is automatically increased for containers with a high proportion of anonymous pages, a large amount of temporary data, or abnormal access frequency, to capture dynamic changes in memory access, prevent omission of hot data or misjudgment of cold data, and reduce the scanning frequency for containers with stable access patterns, thereby reducing system monitoring overhead and helping to optimize resource utilization.

[0075] In one embodiment of the present disclosure, dynamically scanning a container based on a scanning parameter to obtain a container access heat map includes:

[0076] The dynamic access monitor is called to scan the page table entries of the memory pages of the local memory and remote memory of the electronic device based on the scanning parameters, and local scanning results and remote scanning results are obtained, wherein whether the memory page is accessed within the time period corresponding to the scanning interval is determined based on whether the access bit in the page table entry is set.

[0077] In some embodiments, the Linux DAMON module, i.e., the dynamic access monitor, is called to scan the page PTE (Page Table Entry, each page table entry corresponds to a page in the virtual address space, recording the mapping relationship of the page in the physical memory and related status information) of the local memory and the remote memory respectively, and whether the page is accessed during the interval is determined based on whether the PAGE_ACCESSED bit of the PTE, i.e., the access bit, is set.

[0078] Generates a local access heat map based on the page range of local memory and local scan results.

[0079] Generate a remote access heat map based on the page range of the remote memory and the remote scan results.

[0080] In some embodiments, the access heat map of the local memory and the access heat map of the remote memory obtained by DAMON scanning are obtained. The data of the access heat map is as follows:

[0081]

[0082] Among them, start_address and end_address represent the range of the page interval, and accesses represents the popularity of the access.

[0083] The filter of the control group is called to filter the local access heat map and the remote access heat map based on the container representation to obtain the container access heat map of each container, wherein each container corresponds to a group of the control group.

[0084] In some embodiments, a Cgroup Filter is called, i.e., a filter of the control group is used to filter the local memory access heat map and the remote memory access heat map respectively, and separate the pages that match the Cgroup name of each container, thereby obtaining the local memory access heat map of each container and the remote memory access heat map of the container.

[0085] In this embodiment, by calling the dynamic access monitor in combination with the scanning parameters, the page table entries of the local memory and the remote memory are scanned, and the memory page access status is judged by using the page table entry access bit to capture the memory access event, and further based on the memory page interval range, local and remote access heat maps are generated respectively to achieve a visual presentation of the memory access situation. Finally, the control group filter is filtered based on the container identifier to accurately map the global memory access data to each container, thereby obtaining an access heat map exclusive to each container. Through the control group filtering mechanism, the division of memory access data based on the container dimension is realized, providing a reliable basis for the intelligent scheduling of container memory resources.

[0086] In one embodiment of the present disclosure, the scanning parameters also include a scanning area, and calling the dynamic access monitor to scan the page table entries of the memory pages of the local memory and remote memory of the electronic device based on the scanning parameters, including: calling the dynamic access monitor to scan the page table entries in the scanning area in the local memory and remote memory of the electronic device based on the scanning interval.

[0087] In this embodiment, a flexible memory scanning strategy is constructed by introducing a scanning area parameter and a scanning interval. During scanning, the dynamic access monitor only scans the page table entries PTE within the pre-set scanning area according to the scanning interval, and can efficiently obtain the access status of the memory pages in the target area to reduce scanning overhead.

[0088] In one embodiment of the present disclosure, the filter of the control group is called to filter the local access heat map and the remote access heat map based on the container representation to obtain the container access heat map of each container, including:

[0089] The filter is called to traverse each page interval in the local access heat map and the remote access heat map to determine the process ID that has accessed the page interval; based on the process ID, the corresponding control group name is obtained to accumulate the number of accesses to the page interval under the same control group into the control group's heat map; based on the mapping relationship between the control group and the corresponding container representation, the control group's heat map is determined as the container access heat map.

[0090] In some embodiments, based on the resource isolation characteristics of the control group (Cgroup) in the container technology, a filter is called to traverse the access heat map of the local and remote memory, identify the process identifier PID corresponding to each page interval, and the identifier uniquely points to the process that initiates the memory access operation. The binding relationship between the process identifier and the control group name is used to accumulate the number of accesses to all page intervals under the same control group to form a heat statistic of the control group dimension. Based on the pre-established mapping relationship between the control group and the container identifier, the heat map of the control group is directly mapped to a container-specific access heat map to attribute the global memory access data to each container instance.

[0091] like Figure 3 As shown, the container memory monitoring module drives DAMON (Data-Access Monitor) to perform memory scanning on the system memory (local memory, first-level remote memory, and second-level remote memory) to generate a local memory heat map, a level 1 remote memory heat map, and a level 2 remote memory heat map. The heat map can be used to quantitatively identify hot data and cold data. The Cgroup Filter is called to filter and separate the heat map according to the container representation based on the resource limits of the Cgroup to which the container belongs, thereby obtaining a container access heat map.

[0092] In this embodiment, global memory access data is divided into container granularity through the association between process identifiers and control groups, and the mapping of control groups and container identifiers enables a one-to-one correspondence between memory access heat maps and container instances, which is conducive to improving the resource management granularity of the hybrid memory system, enabling key containers to preferentially obtain high-performance memory resources based on real access characteristics, optimizing the overall performance of containerized applications, and reducing resource waste.

[0093] In one embodiment of the present disclosure, configuring hot and cold thresholds for containers based on a container access heat map, importance weights assigned to containers, and memory hierarchies includes:

[0094] Based on the container access heat map and the corresponding importance weights, a corresponding weighted heat map is obtained. The importance weights are determined based on the memory data attributes. The weighted heat maps of multiple containers are merged and arranged according to the heat value to obtain an aggregated heat map. The hot and cold thresholds of the container are configured based on the memory hierarchy.

[0095] In some embodiments, the heat in the heat map of each container is multiplied by the weight of the container to obtain a weighted heat map. The weight value of the container is determined according to the importance of the container. The more important the container is, the greater the weight value is. The weighting is based on the memory data attributes. The more long-term data, the greater the weight value.

[0096] Arrange the weighted heat map in descending order of heat accesses, for example:

[0097]

[0098] Traverse the sorted overall weighted heat map from the beginning to find the heat value with the capacity equal to the local memory capacity. The capacity of each area can be obtained by end_address – start_address. This heat value is defined as the first hot and cold threshold. Based on a similar method, derive the remote memory demarcation points of other levels to obtain the second hot and cold threshold. The first hot and cold threshold is the hot threshold, the second hot and cold threshold is the cold threshold, and the first hot and cold threshold is greater than the second hot and cold threshold.

[0099] In this embodiment, a weighted heat map is calculated based on the container access heat map and the importance weight, and the container business priority is integrated into the memory access characteristics, which can amplify the heat of high-weight containers, and sort the weighted heat maps of multiple containers to form an aggregate heat map that reflects the global container memory access status. The hot and cold thresholds are divided in the aggregate heat map in combination with the memory hierarchy, and the dynamic configuration of the hot and cold thresholds is achieved by integrating the container access heat, importance weight and memory hierarchy information. The weighted calculation of importance weight and heat solves the problem of ignoring the particularity of container business in scheduling operations, and ensures the memory resources of key containers. The combination of the aggregate heat map and the memory hierarchy makes the division of hot and cold thresholds more in line with the performance characteristics of heterogeneous memory, and realizes the optimized allocation of hot data to high-performance memory and cold data migration to low-cost memory.

[0100] In one embodiment of the present disclosure, configuring hot and cold thresholds of a container based on the memory hierarchy includes:

[0101] The aggregate heat map is traversed based on the start and end addresses of the local memory of the electronic device and the start and end addresses of the remote memory; the heat value at the intersection of the local memory and the remote memory is used to determine the first hot and cold threshold; the remote memory includes at least two levels, and the heat value at the intersection of any two levels of remote memory is determined as the second hot and cold threshold.

[0102] In some embodiments, hot and cold thresholds are configured based on various demarcation points of the memory, such as Figure 4 As shown, a weight is assigned to the original heat map of each container (container 1, container 2, ... container m). That is, the heat of each container is multiplied by the corresponding weight of each container to obtain a weighted heat map. The weighted heat is sorted as a whole, and the weighted temperature of each dividing point is selected as the hot and cold threshold. The hot and cold threshold is distributed to each container. Among them, the temperature of the dividing point between the local memory capacity and the first-level remote memory is the first hot and cold threshold. Data above this temperature is considered hot data and will be placed in the local memory. The temperature of the dividing point between the first-level remote memory and the second-level remote memory is the second hot and cold threshold, which is used to allocate data to the remote memory.

[0103] In some embodiments, each hot and cold threshold data is sent to each container to implement the scheduling of memory pages in units of containers.

[0104] In this embodiment, the aggregate heat map is traversed based on the start and end addresses of the local memory and the remote memory to find the physical intersection points of different memory levels, and the heat value at the intersection of the local memory and the remote memory is determined as the first hot and cold threshold value, which is used to distinguish between hot data suitable for local high-performance memory storage and cold data that can be migrated to the remote memory. For a remote memory containing at least two levels, the heat value at the intersection of any two levels is determined as the second hot and cold threshold value, and the hot and cold data stratification in the remote memory is further refined. The threshold is divided based on the physical boundary of the memory, and the low latency and high bandwidth characteristics of the local memory are fully utilized to ensure that hot data is stored in the high-performance area first, effectively improving the response speed of key services, and setting the tiered threshold for multi-level remote memory. According to the performance differences of different levels, data of different heat levels can be reasonably allocated to achieve refined scheduling and management of memory resources.

[0105] In one embodiment of the present disclosure, memory page scheduling is performed on containers based on hot and cold thresholds and a container access heat map, including: for any container, memory page scheduling is performed based on a relationship between a weighted heat map and a first hot and cold threshold and / or a second hot and cold threshold.

[0106] In this embodiment, pages with a heat value higher than a first threshold are retained or migrated to the local high-performance memory, pages between the first and second thresholds are stored in the high-performance layer of the remote memory, and pages below the second threshold are stored in the low-performance layer of the remote memory. Through threshold-driven scheduling logic, data of different heats are migrated to matching storage areas, realizing dynamic adaptive management of container loads by the hybrid memory system.

[0107] In one embodiment of the present disclosure, the remote memory includes a first-level remote memory and a second-level remote memory, and memory page scheduling is performed based on a relationship between a weighted heat map and a first hot / cold threshold and / or a second hot / cold threshold, including:

[0108] Based on the weighted heat map, it is detected that the container has a first group of memory pages with a value less than a second hot and cold threshold, and the first group of memory pages is not in the second-level remote memory, then the memory data of the first group of memory pages is scheduled to the second-level remote memory.

[0109] If it is detected that there is a second group of memory pages in the container, the heat value of the second group of memory pages is greater than the second hot and cold threshold and less than the first hot and cold threshold, and the second group of memory pages is not in the first-level remote memory, the memory data of the second group of memory pages is scheduled to the first-level remote memory.

[0110] If it is detected that the container has a third group of memory pages with a value greater than the first hot / cold threshold, and the third group of memory pages is not in the local memory, the memory data of the third group of memory pages is scheduled to the local memory.

[0111] In some embodiments, if the weighted heat of a memory area of ​​the container is lower than a second hot / cold threshold, the data in the memory area is determined to be cold data, and the data is not in the second-level remote memory, then the memory data is downgraded to the second-level remote memory.

[0112] If the weighted heat of a memory area in a container is higher than the second hot / cold threshold and lower than the first hot / cold threshold, and the memory area is not in the first-level remote memory, then the memory area is migrated to the first-level remote memory.

[0113] If the weighted heat of a memory area of ​​the container is higher than the first hot / cold threshold, the data in the memory area is determined to be hot data, and the data is not in the local memory, then the memory data is upgraded to the local memory.

[0114] In this embodiment, gradient optimization scheduling of memory pages is achieved through dynamic matching of three-level memory hierarchies, namely local memory, first-level remote memory, and second-level remote memory, and dual thresholds, namely first hot and cold thresholds and second hot and cold thresholds.

[0115] In one embodiment of the present disclosure, memory paging of a container is performed based on hot and cold thresholds and a container access heat map, further comprising:

[0116] Call the configured physical memory page migration function to allocate a new target physical page for the scheduled target node; create a temporary mapping and copy the data of the source memory page to the target physical page; traverse all processes that use the source memory page and modify the page table entries in the process based on the target physical page; flush the translation backup buffer to make the temporary mapping effective; and release the source memory page.

[0117] In some embodiments, the kernel function migrate_page is called, and its input variables are the memory page number and the migration target node number. The memory number and the target memory node number of the identified memory block are input to the migrate_page function, and the kernel function completes the migration.

[0118] like Figure 5 As shown, according to a memory migration solution of an embodiment of the present disclosure, the weighted heat of each container is first compared with the hot and cold thresholds of each container, and then the hot and cold attributes of the data are determined based on whether it is higher than the hot and cold thresholds of the container, so as to divide it into hot data, warm data and cold data. Whether to migrate is determined based on the nodes where the hot and cold data are located. When migration is required, the corresponding migration task is completed, including upgrading hot data, migrating warm data and downgrading cold data.

[0119] In this embodiment, when it is determined that a page needs to be migrated based on the hot and cold thresholds, a physical memory page migration function is called to allocate a new physical page to the target node, ensure that resources are ready, create a temporary mapping and copy data to prevent data loss during the migration process, and implement address mapping switching by traversing all processes that use the source page and modifying the page table entries. The translation lookaside buffer (TLB) is refreshed to make the new mapping effective, eliminating address translation delays, and finally the source page is released to reclaim resources. Through the scheduling and migration of memory pages, while ensuring application continuity, it is beneficial to improve the resource utilization and overall performance of the hybrid memory system.

[0120] In one embodiment of the present disclosure, dividing a hybrid memory system into memory tiers based on remote memory performance indicators includes:

[0121] Perform a stress test on the hybrid memory system based on performance indicators, including at least one of read / write latency, bandwidth, and input / output operations per second (IOPS); calculate indicator values ​​for the performance indicators based on the stress test results; and divide the memory tiers based on the indicator values.

[0122] In some embodiments, based on the differentiated performance attributes of heterogeneous memory devices (NVM, CXL / RDMA, HBM), the performance attributes of remote memory are obtained through data acquisition, stress testing, and other methods. The memory hierarchy is determined based on the performance attributes. Devices with higher read and write performance have higher memory hierarchies and store corresponding hotter memory data.

[0123] In this embodiment, a stress test is designed based on performance indicators such as read and write latency, bandwidth, and IOPS to simulate memory access pressure under different load scenarios. The actual performance data of each memory component is obtained through testing, and then the memory is divided into different levels according to these indicator values, such as high-performance layer, medium-performance layer, and large-capacity layer, to achieve hierarchical management of remote memory, which is conducive to optimizing the utilization efficiency of heterogeneous memory resources.

[0124] like Figure 6 As shown, according to a memory scheduling solution of an embodiment of the present disclosure, multiple containers (Container-1 to Container-m) are application running carriers. Each container runs independently and has exclusive memory resource requirements. The container memory scheduler includes a container memory monitoring module, a container memory scheduling module, a container page migration module, a remote memory evaluation module and a memory data evaluation module. It runs on the host operating system, obtains the memory access status of each container in real time, and the scheduling module comprehensively determines the hot and cold thresholds of each container and performs corresponding page migration operations.

[0125] The operating system is configured based on the NUMA architecture, including different NUMA nodes, such as NUMA node 0 and NUMA node 1. Local memory is associated with the CPU to form a high-performance access area. Remote memory is used as an extension to provide additional storage resources. The NUMA characteristics are used to optimize memory access efficiency and reduce cross-node access latency. Compute nodes are configured with CPUs and local memory and are business computing execution units. They rely on local memory to quickly process data and can use remote memory resources on demand with the help of memory scheduling to balance performance and cost. Memory nodes provide remote memory resources and are connected to compute nodes through interconnection to expand system memory capacity, meet the large-scale memory requirements of containers, and realize memory resource pooling management.

[0126] In some embodiments, a container memory scheduler is deployed on an electronic device, i.e., a host operating system, to obtain the hierarchical attributes of the remote memory, the data attributes in the container, and the memory access status of each container. A scheduling module is used to make comprehensive decisions, formulate hot and cold thresholds, and use a page migration module to migrate data to the corresponding node.

[0127] The container memory scheduler includes a memory monitoring module, a memory scheduling module, a page migration module, a remote memory assessment module, and a memory data assessment module. It runs on the host operating system and obtains the memory access status of each container in real time. The scheduling module comprehensively determines the hot and cold thresholds of each container and performs corresponding page migration operations.

[0128] The remote memory assessment module is used to obtain the read and write bandwidth, latency, capacity, and other performance characteristics of remote memory to provide a basis for hot and cold data storage (for example, hot data should be placed in high-performance HBM and cold data in large-capacity NVM / CXL memory).

[0129] The memory data evaluation module is used to obtain the memory data attributes in each container, such as anonymous / file pages, lifecycle attributes (temporary / long-term data), etc.

[0130] The container memory monitoring module is used to define scanning parameters based on the attributes of container memory data, such as the size of the sampling region and the sampling interval, to better exploit spatial and temporal locality. The monitoring module utilizes the Linux kernel's Damon module and uses PTE scanning to obtain access information for each page on the host. It then filters the information to individual containers using their cgroup names, thereby generating a heat map of access activity for each container.

[0131] The container memory scheduling module is used to determine the hot and cold thresholds for each container by integrating the access heat map of each container with the container's importance weight, memory data attributes, and remote memory characteristics.

[0132] The container page migration module is used to migrate cold pages with access heat lower than the threshold to remote memory and hot pages with access heat higher than the threshold to local memory based on the cold and hot thresholds and access heat map of each container.

[0133] In some embodiments, the specific operation of migration is performed by the Damos module of the kernel, and Damos calls the migrate_page function to migrate the page to be migrated to the target memory node.

[0134] In some embodiments, the memory access heat, data attributes, and remote node characteristics of each container are acquired, analyzed, hot and cold thresholds are determined, scanning parameters are decided, and hot and cold data are migrated by utilizing a remote memory evaluation module, a container memory monitoring module, a memory data evaluation module, a container memory scheduling module, and a container memory migration module on a host operating system. The remote memory evaluation module determines the level of the memory node, the memory data evaluation module obtains the memory data attributes of each container, the container memory monitoring module determines the sampling granularity and cycle of the monitoring module according to the container data attributes, obtains the overall page access situation by sampling and scanning the host memory pages, and filters and separates them according to the container identifier to obtain the access heat situation of each container. The container memory scheduling module weights the access heat of the container according to the importance and data attributes of each container, selects the hot and cold thresholds of each container according to the weighted overall heat situation, and the container memory migration module migrates the memory data in each container to the corresponding memory level.

[0135] In this embodiment, a container memory scheduler is deployed on the host operating system to obtain the hierarchical attributes of the remote memory, the data attributes in the container, and the memory access status of each container. The scheduling module is used to make comprehensive decisions, formulate hot and cold thresholds, and use the page migration module to migrate data to the corresponding node. By obtaining the hot and cold status of the pages of the global container, the scheduling is made global. Memory hierarchical processing is implemented based on the performance evaluation of the remote device, and differentiated scheduling of memory pages can be performed. The hot and cold status of the data can be evaluated in multiple dimensions based on the data characteristics. The weights of the hot and cold areas are allocated according to the importance of the container. The hot and cold thresholds can be dynamically adjusted according to the overall access situation.

[0136] It should be noted that the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention and are not intended to be limiting. It is readily understood that the processes illustrated in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0137] Refer to the following Figure 7 hereinafter, a memory scheduling device 700 according to an embodiment of the present invention is described. Figure 7The memory scheduling device 700 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.

[0138] The memory scheduling device 700 is implemented as a hardware module. The components of the memory scheduling device 700 may include, but are not limited to: a partitioning module 702 for partitioning the memory hierarchy of the hybrid memory system based on the performance indicators of the remote memory; a scanning module 704 for dynamically scanning the container based on the memory data attributes within the container to obtain a container access heat map; a configuration module 706 for configuring the container's hot and cold thresholds based on the container access heat map, the importance weight assigned to the container, and the memory hierarchy; and a scheduling module 708 for scheduling memory pages for the container based on the hot and cold thresholds and the container access heat map.

[0139] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods, or program products. Therefore, various aspects of the present invention may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."

[0140] Refer to the following Figure 8 8. The electronic device 800 according to this embodiment of the present invention is described below. The electronic device 800 may be a network device or a terminal. Figure 8 The electronic device 800 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.

[0141] like Figure 8 As shown, electronic device 800 is implemented as a general-purpose computing device. Components of electronic device 800 may include, but are not limited to, the aforementioned at least one processing unit 810, the aforementioned at least one storage unit 820, and a bus 830 connecting various system components (including storage unit 820 and processing unit 810).

[0142] The storage unit stores program codes that can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present invention described in the "Exemplary Method" section above. For example, the processing unit 810 may perform the following steps: Figure 2 The described scheme.

[0143] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .

[0144] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0145] Bus 830 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0146] The electronic device 800 can also communicate with one or more external devices 870 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 800, and / or any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 850. Furthermore, the electronic device 800 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 800, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0147] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0148] In exemplary embodiments of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above-described methods of this specification is stored. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product, which includes program code. When the program product is executed on an electronic device, the program code is used to cause the electronic device to perform the steps according to various exemplary embodiments of the present invention described in the "Exemplary Methods" section of this specification.

[0149] According to an embodiment of the present invention, a program product for implementing the above-mentioned method can be a portable compact disc read-only memory (CD-ROM) and include program code, and can be run on an electronic device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0150] The program product may be implemented in any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0151] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0152] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0153] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, and the like, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0154] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0155] Furthermore, although the steps of the method of the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in this particular order, or that all steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0156] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0157] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the appended claims.

Claims

1. A memory scheduling method, characterized in that: Applied to an electronic device, the electronic device is configured with a hybrid memory system including a remote memory, and the electronic device is further deployed with multiple containers. The memory scheduling method includes: dividing the hybrid memory system into memory tiers based on the performance indicators of the remote memory; Dynamically scan the container based on memory data attributes in the container to obtain a container access heat map; configuring hot and cold thresholds of the container based on the container access heat map, the importance weight assigned to the container, and the memory hierarchy; Memory pages are scheduled for the container based on the hot and cold thresholds and the container access heat map.

2. The memory scheduling method according to claim 1, wherein: Dynamically scanning the container based on the memory data attributes in the container to obtain a container access heat map includes: configuring scan parameters for the container based on the memory data attributes, the scan parameters including a scan interval; The container is dynamically scanned based on the scanning parameters to obtain the container access heat map.

3. The memory scheduling method according to claim 2, wherein: The memory data attributes include page attributes and / or lifecycle attributes, the page attributes include whether the memory data is an anonymous page or a file page, and the lifecycle attributes include whether the memory data is temporary data or long-term data. Configuring scanning parameters for the container based on the memory data attributes includes: determining a first proportion of the anonymous pages based on the anonymous pages and the file pages; determining a second proportion of the temporary data based on the temporary data and the long-term data; determining a third proportion based on a ratio between an access frequency of the memory data and a statistically average frequency of the plurality of containers; Determining an evaluation result of the memory data attribute based on the first proportion and the corresponding first weight, the second proportion and the corresponding third weight, and the third proportion and the corresponding third weight; The corresponding scanning parameters are configured based on the evaluation result.

4. The memory scheduling method according to claim 2, wherein: Dynamically scanning the container based on the scanning parameters to obtain the container access heat map includes: Invoking a dynamic access monitor to scan page table entries of the memory page in the local memory and the remote memory of the electronic device based on the scan parameters, respectively, to obtain local scan results and remote scan results, wherein determining whether the memory page is accessed within a period corresponding to the scan interval based on whether an access bit in the page table entry is set; Generate a local access heat map based on the page range of the local memory and the local scan result; Generate a remote access heat map based on the page range of the remote memory and the remote scanning result; The filter of the control group is called to filter the local access heat map and the remote access heat map based on the container representation to obtain the container access heat map of each container, wherein each container corresponds to a group of the control group.

5. The memory scheduling method according to claim 4, characterized in that: The scanning parameters further include a scanning area, and calling the dynamic access monitor to scan the page table entries of the memory pages in the local memory and the remote memory of the electronic device based on the scanning parameters respectively includes: The dynamic access monitor is called to scan the page table entries in the scanning area in the local memory and the remote memory of the electronic device respectively based on the scanning interval.

6. The memory scheduling method according to claim 4, characterized in that: The filter of the control group is called to filter the local access heat map and the remote access heat map based on the container representation to obtain the container access heat map of each container, including: Calling the filter to traverse each page interval in the local access heat map and the remote access heat map to determine the process identifier that has accessed the page interval; Obtaining a corresponding control group name based on the process identifier, so as to accumulate the number of accesses to the page interval under the same control group into a heat map of the control group; Based on a mapping relationship between the control group and the corresponding container representation, a heat map of the control group is determined as the container access heat map.

7. The memory scheduling method according to claim 1, wherein: Configuring hot and cold thresholds of the container based on the container access heat map, the importance weight assigned to the container, and the memory hierarchy includes: Obtaining a corresponding weighted heat map based on the container access heat map and the corresponding importance weight, wherein the importance weight is determined based on the memory data attribute; Merging the weighted heat maps of the multiple containers and arranging them according to heat values ​​to obtain an aggregated heat map; Hot and cold thresholds for the container are configured based on the memory tier.

8. The memory scheduling method according to claim 7, wherein: Configuring hot and cold thresholds of the container based on the memory tier includes: Traversing the aggregate heat map based on the start and end addresses of the local memory of the electronic device and the start and end addresses of the remote memory; Determine a first hot / cold threshold value based on the heat value at the boundary between the local memory and the remote memory; The remote memory includes at least two levels, and the heat value at the intersection of any two levels of the remote memory is determined as the second hot and cold threshold.

9. The memory scheduling method according to claim 8, characterized in that: Performing memory page scheduling on the container based on the hot and cold thresholds and the container access heat map includes: For any of the containers, the memory page scheduling is performed based on the relationship between the weighted heat map and the first hot and cold thresholds and / or the second hot and cold thresholds.

10. The memory scheduling method according to claim 9, characterized in that: The remote memory includes a first-level remote memory and a second-level remote memory, and the memory page scheduling is performed based on the relationship between the weighted heat map and the first hot and cold threshold and / or the second hot and cold threshold, including: If it is detected based on the weighted heat map that the container has a first group of memory pages with a value less than the second hot / cold threshold, and the first group of memory pages is not in the second-level remote memory, then the memory data of the first group of memory pages is scheduled to the second-level remote memory; If it is detected that a second group of memory pages exists in the container, the heat value of the second group of memory pages is greater than the second hot / cold threshold and less than the first hot / cold threshold, and the second group of memory pages is not in the first-level remote memory, then the memory data of the second group of memory pages is scheduled to the first-level remote memory; If it is detected that the container has a third group of memory pages whose value is greater than the first hot / cold threshold and the third group of memory pages is not in the local memory, the memory data of the third group of memory pages is scheduled to the local memory.

11. The memory scheduling method according to claim 1, wherein: Performing memory page scheduling on the container based on the hot and cold thresholds and the container access heat map further includes: Call the configured physical memory page migration function to allocate a new target physical page for the scheduled target node; Create a temporary mapping and copy the data of the source memory page to the target physical page; Traversing all processes that use the source memory page, and modifying page table entries in the processes based on the target physical page; flushing the translation lookaside buffer to make the temporary mapping effective; Release the source memory page.

12. The memory scheduling method according to claim 1, wherein: Dividing the hybrid memory system into memory tiers based on the performance indicator of the remote memory includes: performing a stress test on the hybrid memory system based on the performance indicator, the performance indicator comprising at least one of read / write latency, bandwidth, and input / output operations per second (IOPS); Based on the result of the pressure test to the index value of the performance index; The memory hierarchy is divided based on the indicator value.

13. A memory scheduling device, characterized in that: Applied to an electronic device, the electronic device is configured with a hybrid memory system including a remote memory, and the electronic device is further deployed with multiple containers, the memory scheduling device includes: a partitioning module, configured to partition memory hierarchies for the hybrid memory system based on performance indicators of the remote memory; A scanning module, configured to dynamically scan the container based on memory data attributes within the container to obtain a container access heat map; a configuration module, configured to configure hot and cold thresholds of the container based on the container access heat map, the importance weight assigned to the container, and the memory hierarchy; A scheduling module is used to schedule memory pages for the container based on the hot and cold thresholds and the container access heat map.

14. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the memory scheduling method according to any one of claims 1 to 12 by executing the executable instructions.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the memory scheduling method according to any one of claims 1 to 12 is implemented.

16. A computer program product having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the memory scheduling method according to any one of claims 1 to 12 is implemented.