Memory hot and cold scheduling method, device, electronic device and storage medium

By determining the hot and cold call type of the target memory operation function in a hybrid memory system, and optimizing the memory scheduling strategy using the function call model, the problem of inefficient memory scheduling in the existing technology is solved, and efficient and accurate memory scheduling is achieved.

CN118656223BActive Publication Date: 2024-12-13CHINA TELECOM CORP LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411147491.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-12-13
Estimated Expiration
2044-08-20

AI Technical Summary

Technical Problem

The prior art methods of scanning various memory access situations in hybrid memory systems result in high consumption, low scheduling efficiency and inability to ensure scheduling accuracy.

Method used

By determining the target function call chain where the target memory operation function is located, and using the pre-calibrated function call model to predict the hot and cold call types, the corresponding memory scheduling strategy is determined, and the access situation of each memory page is avoided.

Benefits of technology

Simplified and effective in reducing system consumption, improving scheduling efficiency, and ensuring the accuracy of memory scheduling strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656223B_ABST
    Figure CN118656223B_ABST
Patent Text Reader

Abstract

The present disclosure provides a memory hot and cold scheduling method, device, electronic device and storage medium, and relates to the field of computer technology. The method includes determining a target function call chain where a target memory operation function is located in response to a target memory operation; inputting the target function call chain into a pre-calibrated function call model to obtain the hot and cold call type of the target memory operation function; and determining the memory scheduling policy of the memory corresponding to the target memory operation according to the hot and cold call type. The present disclosure triggers a memory scheduling policy determination process based on the target memory operation, which is concise and effective, reduces system consumption and improves scheduling efficiency. In addition, the embodiments of the present disclosure can avoid scanning and recording the access conditions of each memory page, thereby effectively reducing the resources required for calculation and improving the efficiency of system operation, and ensuring the accuracy of the memory scheduling policy based on the binding of memory operation and scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the advancement of computer technology, data volumes continue to grow, placing increasing demands on memory. The development of various memory technologies has led to the emergence of numerous new memory devices. These devices can be simultaneously mounted on a single system and directly accessed. However, due to differences in access speed, capacity, and cost, memory scheduling is required to place different data on different memory tiers.

[0003] Related technologies can scan accesses to individual memory pages and record access history to determine data scheduling. However, for systems with large capacity and complex scheduling, such as hybrid memory, scanning individual memory accesses results in high overhead, low scheduling efficiency, and uncertainty about scheduling accuracy.

[0004] 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

[0005] The present disclosure provides a memory hot and cold scheduling method, device, electronic device and storage medium, which at least to a certain extent overcome the problems of high consumption, low scheduling efficiency and inability to ensure scheduling accuracy caused by the related art method of scanning each memory access.

[0006] 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.

[0007] According to one aspect of the present disclosure, a memory hot and cold scheduling method is provided, comprising: in response to a target memory operation occurring during system operation, determining a target function call chain in which a target memory operation function is located; inputting the target function call chain into a pre-calibrated function call model to obtain a hot and cold call type of the target memory operation function, wherein the pre-calibrated function call model is used to predict the hot and cold call type based on each function included in the function call chain; and determining a memory scheduling policy for the memory corresponding to the target memory operation based on the hot and cold call type.

[0008] In some embodiments, the memory hot and cold scheduling method provided by the embodiments of the present disclosure also includes: determining a target load that matches the system; running the target load, wherein the target load performs memory access based on multiple function call chains during the running process; obtaining calibration data during the running process of the target load, the calibration data being used to describe memory access information corresponding to the multiple function call chains; and calibrating the function call model according to the calibration data.

[0009] In some embodiments, calibration data is obtained during the operation of the target load, including: obtaining memory access data and function call stack data during the operation of the target load, the function call stack data including at least one function call chain; determining the memory access characteristics of each function call chain based on the memory access data and the function call stack data, wherein the memory access characteristics of the first function call chain are used to describe the memory access information of the memory operation function included in the first function call chain when it is called in the first function call chain, and the first function call chain is any function call chain included in the function call stack data; and using the memory access characteristics of each function call chain as calibration data.

[0010] In some embodiments, a pre-calibrated function call model is used to calculate the probability that each function in the target function call chain involves a memory call; the probability that the target function call chain involves a memory call is inferred based on the probability that each function involves a memory call; and the hot and cold call types of the target memory operation function are determined based on the probability that the target function call chain involves a memory call.

[0011] In some embodiments, when the target memory operation function is a memory allocation function, the memory scheduling policy of the memory corresponding to the target memory operation is determined according to the hot and cold call types, including: if the target memory operation function is a hot call function, the memory scheduling policy is to schedule the allocated memory to the fast layer; if the target memory operation function is a cold call function, the memory scheduling policy is to schedule the allocated memory to the capacity layer.

[0012] In some embodiments, when the target memory operation function is a memory call function, the memory scheduling policy of the memory corresponding to the target memory operation is determined according to the hot and cold call types, including: if the target memory operation function is a hot call function, the memory scheduling policy is to schedule the accessed memory to the fast layer; if the target memory operation function is a cold call function, the memory scheduling policy is to schedule the accessed memory to the capacity layer.

[0013] According to another aspect of the present disclosure, a memory hot and cold scheduling device is also provided, including: a target function call chain determination module, which is used to determine the target function call chain where the target memory operation function is located in response to the target memory operation occurring during system operation; a hot and cold call type determination module, which is used to input the target function call chain into a pre-calibrated function call model to obtain the hot and cold call types of the target memory operation function, and the pre-calibrated function call model is used to predict the hot and cold call types based on the various functions included in the function call chain; a memory scheduling policy determination module, which is used to determine the memory scheduling policy of the memory corresponding to the target memory operation based on the hot and cold call types.

[0014] In some embodiments, the memory hot and cold scheduling device provided by the embodiments of the present disclosure further includes: a model calibration module for determining a target load that matches the system; running the target load, wherein the target load performs memory access based on multiple function call chains during the running process; obtaining calibration data during the running process of the target load, the calibration data being used to describe memory access information corresponding to the multiple function call chains; and calibrating the function call model according to the calibration data.

[0015] In some embodiments, a model calibration module is used to obtain memory access data and function call stack data during the operation of a target load, where the function call stack data includes at least one function call chain; based on the memory access data and the function call stack data, the memory access characteristics of each function call chain are determined, where the memory access characteristics of the first function call chain are used to describe the memory access information of the memory operation function included in the first function call chain when it is called in the first function call chain, and the first function call chain is any function call chain included in the function call stack data; the memory access characteristics of each function call chain are used as calibration data.

[0016] In some embodiments, a pre-calibrated function call model is used to calculate the probability that each function in the target function call chain involves a memory call; the probability that the target function call chain involves a memory call is inferred based on the probability that each function involves a memory call; and the hot and cold call types of the target memory operation function are determined based on the probability that the target function call chain involves a memory call.

[0017] In some embodiments, a memory scheduling policy determination module is used to, when the target memory operation function is a memory allocation function, if the target memory operation function is a hot call function, then the memory scheduling policy is to schedule the allocated memory to the fast layer; if the target memory operation function is a cold call function, then the memory scheduling policy is to schedule the allocated memory to the capacity layer.

[0018] In some embodiments, a memory scheduling policy determination module is used to, when the target memory operation function is a memory call function, if the target memory operation function is a hot call function, then the memory scheduling policy is to schedule the accessed memory to the fast layer; if the target memory operation function is a cold call function, then the memory scheduling policy is to schedule the accessed memory to the capacity layer.

[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; wherein the processor is configured to execute any one of the memory hot and cold scheduling methods 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, any one of the memory hot and cold scheduling methods is implemented.

[0021] According to another aspect of the present disclosure, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the memory hot and cold scheduling method provided in any of the optional embodiments of the present disclosure.

[0022] The technical solution provided by the embodiments of the present disclosure can trigger the determination process of the memory scheduling policy based on the target memory operations occurring during system operation. This is concise and effective, can reduce system consumption and improve scheduling efficiency. In addition, the embodiments of the present disclosure predict the hot and cold call types of the target memory operation function through the target function call chain in which the target memory operation function is located, and determine the memory scheduling policy of the memory, avoiding scanning and recording the access status of each memory page, etc., thereby effectively reducing the resources required for computing and improving the efficiency of system operation. Based on the binding of memory operations and scheduling, the accuracy of the memory scheduling policy is ensured.

[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 showing a system architecture in an embodiment of the present disclosure;

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

[0027] Figure 3 A schematic diagram showing a function call chain in an embodiment of the present disclosure is shown;

[0028] Figure 4 A schematic diagram illustrating calibration of a function call model according to an embodiment of the present disclosure is shown;

[0029] Figure 5A schematic diagram illustrating a method for determining hot and cold call types according to an embodiment of the present disclosure is shown;

[0030] Figure 6 A schematic diagram showing a memory hot and cold scheduling in an embodiment of the present disclosure is shown;

[0031] Figure 7 A schematic diagram showing another memory hot and cold scheduling in an embodiment of the present disclosure is shown;

[0032] Figure 8 A schematic diagram of a memory hot and cold scheduling device according to an embodiment of the present disclosure is shown;

[0033] Figure 9 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;

[0034] Figure 10 A schematic diagram of a computer-readable storage medium in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0035] 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.

[0036] 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.

[0037] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.

[0038] Figure 1 FIG. 1 shows an exemplary application system architecture diagram to which the memory hot and cold scheduling method according to the embodiment of the present disclosure can be applied. Figure 1 As shown, the system architecture may include a terminal device 101 , a network 102 and a server 103 .

[0039] In response to a target memory operation occurring during system operation, the terminal device 101 may determine the target function call chain where the target memory operation function is located. The terminal device 101 may then input the target function call chain into a pre-calibrated function call model to obtain the hot and cold call types of the target memory operation function. The pre-calibrated function call model is used to predict the hot and cold call types based on the functions included in the function call chain. Finally, the terminal device 101 may determine the memory scheduling policy for the memory corresponding to the target memory operation based on the hot and cold call types. The server 103 may perform memory scheduling based on the memory scheduling policy sent by the terminal device 101.

[0040] The network 102 is a medium for providing a communication link between the terminal device 101 and the server 103 , and can be a wired network or a wireless network.

[0041] Optionally, the wireless network or wired network described above uses standard communication technologies and / or protocols. The network is typically the Internet, but may be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network, or any combination of a virtual private network. In some embodiments, technologies and / or formats including Hypertext Markup Language (HTML) and Extensible Markup Language (XML) are used to represent data exchanged over the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), and Internet Protocol Security (IPSec) may be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies may be used to replace or supplement the above-mentioned data communication technologies.

[0042] The terminal device 101 can be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, smart speakers, smart watches, wearable devices, augmented reality devices, virtual reality devices, etc.

[0043] The server 103 may be a server that provides various services, such as a background management server that provides support for the devices operated by the user using the terminal device 101. The background management server may analyze and process the received request and other data, and feed back the processing results to the terminal device.

[0044] Optionally, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0045] Those skilled in the art will know that Figure 1 The number of terminal devices 101, networks 102 and servers 103 in the embodiment is only illustrative, and any number of terminal devices 101, networks 102 and servers 103 may be provided according to actual needs. This embodiment of the present disclosure does not limit this.

[0046] Under the above system architecture, an embodiment of the present disclosure provides a memory hot and cold scheduling method, which can be executed by any electronic device with computing and processing capabilities.

[0047] In some embodiments, the memory hot and cold scheduling method provided in the embodiments of the present disclosure can be executed by the terminal device of the above-mentioned system architecture; in other embodiments, the memory hot and cold scheduling method provided in the embodiments of the present disclosure can be executed by the server in the above-mentioned system architecture; in other embodiments, the memory hot and cold scheduling method provided in the embodiments of the present disclosure can be implemented by the terminal device and server in the above-mentioned system architecture through interaction.

[0048] Figure 2 A flow chart of a memory hot and cold scheduling method according to an embodiment of the present disclosure is shown. Figure 2 As shown, the memory hot and cold scheduling method provided in the embodiment of the present disclosure includes the following steps S202 to S206.

[0049] S202 , in response to a target memory operation occurring during system operation, determining a target function call chain where the target memory operation function is located.

[0050] The embodiments of the present disclosure are not limited to this system. For example, the system can be a scientific computing system, an e-commerce platform ordering system, etc. The system needs to store data based on memory. Therefore, when a target memory operation occurs during system operation, the memory operated by the target memory operation can be scheduled.

[0051] The disclosed embodiments do not limit the type of memory corresponding to the system. Exemplarily, the memory may be a hybrid memory. Exemplarily, the hybrid memory may be a hybrid memory system composed of new memory such as NVM (Non Volatile Memory), HBM (High Bandwidth Memory), and other remote memory provided by interconnect technologies such as CXL (Compute Express Link) and / or RDMA (Remote Direct Memory Access), along with traditional DRAM.

[0052] Furthermore, based on the different characteristics of various memories, the memory can be divided into a fast tier with high speed and small capacity, and a capacity tier with low speed and large capacity. Both the fast tier and the capacity tier can be directly accessed by the CPU (Central Processing Unit).

[0053] For example, the target memory operation may be a memory allocation operation, a memory call operation, etc. Therefore, the target memory operation function may correspond to a memory allocation function, a memory call function, etc. The memory allocation function may be, for example, malloc (memory allocation, dynamic memory allocation), etc. The memory call function may be, for example, brk (a memory read function).

[0054] In some embodiments, target memory operations can be performed based on function calls. Therefore, the function call chain can be recorded during system operation to determine whether any memory operation functions are triggered in the function call chain. When a memory operation function is triggered, a hot or cold call type prediction is required.

[0055] For example, during system operation, a function call chain f0-f1-f2-f3-fa is generated, where f0, f1, f2, f3, and fa are the functions in the function call chain. For example, fa can be a memory allocation operation. Because the memory allocation operation has occurred, it is determined that a target memory operation is currently occurring. At this point, the target function call chain f0-f1-f2-f3-fa corresponding to the target memory operation can be obtained.

[0056] For another example, during system operation, a function call chain f0-f1-f4-f5-fc is generated, where f0, f1, f4, f5, and fc are functions in the function call chain. For example, fc can be a memory call operation. Because a memory call operation has occurred, it is determined that a target memory operation is currently occurring. At this point, the target function call chain f0-f1-f4-f5-fc corresponding to the target memory operation can be obtained.

[0057] S204: Input the target function call chain into a pre-calibrated function call model to obtain the hot and cold call types of the target memory operation function. The pre-calibrated function call model is used to predict the hot and cold call types based on the functions included in the function call chain.

[0058] For example, the pre-calibrated function call model can be constructed using a neural model, a statistical model, or the like. The pre-calibrated function call model can be used to predict the hot and cold call types of an input function call chain. The purpose of pre-calibrating the function call model can include adjusting model parameters to improve the degree of match between the model's prediction results and actual observed data.

[0059] In some exemplary embodiments, the memory hot and cold scheduling method provided by the embodiments of the present disclosure may also include: determining a target load that matches the system; running the target load, wherein the target load performs memory access based on multiple function call chains during the running process; obtaining calibration data during the running process of the target load, wherein the calibration data is used to describe memory access information corresponding to the multiple function call chains; and calibrating the function call model according to the calibration data.

[0060] In an exemplary embodiment, the target load can be matched to the aforementioned system to ensure that calibration data obtained from the target load is used to calibrate the function call model, making the function call model suitable for scheduling the system's memory. For example, the target load can be derived from some benchmark or actual business data and then tested in the system.

[0061] In one possible implementation, the model's predicted probabilities can be evaluated using calibration data to check whether the model's predicted probabilities align with the actual hot and cold call types. For example, techniques such as temperature scaling, probability binning, and isotonic regression can be used to adjust the function call model's predicted probabilities.

[0062] Exemplarily, the calibration data may include multiple function call chains and memory access characteristics corresponding to each function call chain.

[0063] In some exemplary embodiments, calibration data is obtained during the operation of the target load, including: obtaining memory access data and function call stack data during the operation of the target load, the function call stack data including at least one function call chain; determining the memory access characteristics of each function call chain based on the memory access data and the function call stack data, wherein the memory access characteristics of the first function call chain are used to describe the memory access information of the memory operation function included in the first function call chain when it is called in the first function call chain, and the first function call chain is any function call chain included in the function call stack data; and using the memory access characteristics of each function call chain as the calibration data.

[0064] In an exemplary embodiment, memory access data of the target load during operation can be obtained through tools such as damon (a command line interface tool), and function call stack data can be obtained through tools such as perf (a performance analysis tool) and Dtrace (a dynamic tracing tool), thereby achieving memory and function tracing.

[0065] For example, a schematic diagram of a function call chain provided in an embodiment of the present disclosure can be as follows: Figure 3 shown.

[0066] In this Figure 3 The figure shows three function call chains: f0-f1-f2-f3-fa, f0-f1-f4-f5-fc, and f0-f1-f5-fc. The solid arrows represent function calls, and the dotted arrows represent function returns. f0, f1, f2, f3, f4, and f5 represent individual functions, fa represents a memory allocation function, and fc represents a memory call function. Figure 3 For example, according to the target load, the above three function call chains can be obtained to achieve the measurement of the target load.

[0067] For example, memory access data may include memory access frequency, access time, and memory space size. After acquiring the memory access data, the functions included in the function call stack data may be associated with the memory blocks called by the function call chain in which they are located, thereby obtaining memory access characteristics.

[0068] For example, if the memory operation function included in the first function call chain is a memory allocation function, the memory access characteristics corresponding to the first function call chain can represent the changes in the memory allocation space and subsequent accesses under the memory allocation function over time. For another example, if the memory operation function included in the first function call chain is a memory call function, the memory access characteristics corresponding to the first function call chain can represent the space called by the memory call function and its access frequency.

[0069] Then, the memory access characteristics of each function call chain can be used as calibration data, and the function call model can be calibrated based on the calibration data. The embodiment of the present disclosure does not limit the calibration process.

[0070] For example, a schematic diagram of calibrating a function call model provided by an embodiment of the present disclosure can be as follows: Figure 4 shown.

[0071] In this Figure 4 In

[15] , the three function call chains f0-f1-f2-f3-fa, f0-f1-f4-f5-fc, and f0-f1-f5-fc and their corresponding memory access features can be input into the function call model for calibration. For the function call chain where the memory allocation function resides, the memory access features can include the temporal access features of the memory allocation and the access features of the memory scheduling space. The temporal access features of the memory allocation can be expressed as the relationship between access frequency and time, and the access features of the memory scheduling space can be expressed as the relationship between access frequency and memory space.

[0072] In some exemplary embodiments, a pre-calibrated function call model is used to calculate the probability that each function in the target function call chain involves a memory call; the probability that the target function call chain involves a memory call is inferred based on the probability that each function involves a memory call; and the hot and cold call types of the target memory operation function are determined based on the probability that the target function call chain involves a memory call.

[0073] For example, a probability threshold may be preset. If the probability that the target function call chain involves a memory call is higher than the preset probability threshold, the target memory operation function is a hot call function. If the probability that the target function call chain involves a memory call is not higher than the preset probability threshold, the target memory operation function is a cold call function.

[0074] Alternatively, a pre-calibrated function call model can be used to calculate the probability that each function in the target function call chain involves a hot call; the probability that the target function call chain involves a hot call is inferred based on the probability that each function involves a memory call; and the hot or cold call type of the target memory operation function is determined based on whether the probability that the target function call chain involves a hot call meets a preset hot call threshold.

[0075] For example, a schematic diagram for determining the hot and cold call types provided by an embodiment of the present disclosure can be as follows: Figure 5 shown.

[0076] In this Figure 5In the example, the function call model can be pre-calibrated based on the three function call chains f0-f1-f2-f3-fc, f0-f1-f4-f5-fa, and f0-f1-f5-fa. Among them, fc included in f0-f1-f2-f3-fc is a hot call function, fa included in f0-f1-f4-f5-fa is a hot call function, and fa included in f0-f1-f5-fa is a cold call function.

[0077] In this case, the target function call chain f0-f1-f2-f3-fa can be input into the function call model. The function call model can then calculate the probability that functions f0, f1, f2, and f3 in the target function call chain involve memory calls. Based on the probability of each function involving a memory call, the probability that the target function call chain involves a memory call is inferred. Finally, based on the probability that the target function call chain involves a memory call, the hot and cold call type of the target memory operation function is determined.

[0078] It should be noted that the disclosed embodiments can calibrate the hot and cold call type determination model using the function call chain and memory access characteristics obtained when the target load is running on the system. By using the target load for calibration, the disclosed embodiments are closer to the program behavior itself, improving the targetedness of the calibration and thus improving the accuracy of determining the hot and cold call types. Furthermore, by binding the hot and cold call types to function behavior, the disclosed embodiments further improve the accuracy of determining the hot and cold call types.

[0079] S206: Determine a memory scheduling policy for the memory corresponding to the target memory operation according to the hot / cold call type.

[0080] It should be noted that the hot and cold call types of the target memory operation function include hot call functions and cold call functions. Among them, hot call functions are frequently accessed memory call functions or memory allocation functions that are frequently called, and cold call functions are infrequently called memory call functions or memory allocation functions whose allocated memory is not frequently accessed.

[0081] In one embodiment, when determining the memory scheduling policy based on the hot and cold call types, the type of the target memory operation function also needs to be considered.

[0082] In one possible implementation, when the target memory operation function is a memory allocation function, the memory scheduling strategy for the memory corresponding to the target memory operation is determined based on the hot and cold call types, including: if the target memory operation function is a hot call function, the memory scheduling strategy is to schedule the allocated memory to the fast layer; if the target memory operation function is a cold call function, the memory scheduling strategy is to schedule the allocated memory to the capacity layer.

[0083] In some exemplary embodiments, when the target memory operation function is a memory call function, the memory scheduling policy of the memory corresponding to the target memory operation is determined according to the hot and cold call types, including: if the target memory operation function is a hot call function, the memory scheduling policy is to schedule the accessed memory to the fast layer; if the target memory operation function is a cold call function, the memory scheduling policy is to schedule the accessed memory to the capacity layer.

[0084] For example, after the memory scheduling policy is confirmed, the memory placement can be performed accordingly.

[0085] The method provided by the disclosed embodiment can trigger the memory scheduling policy determination process based on target memory operations occurring during system operation. This method is concise and effective, reducing system consumption and improving scheduling efficiency. Furthermore, the disclosed embodiment predicts the hot and cold call types of the target memory operation function through the target function call chain in which the target memory operation function resides, and determines the memory scheduling policy for the memory, thereby avoiding scanning and recording the access status of each memory page, thereby effectively reducing the resources required for computing and improving the efficiency of system operation. The accuracy of the memory scheduling policy is ensured by binding memory operations to scheduling.

[0086] For example, the embodiment of the present disclosure provides a schematic diagram of memory hot and cold scheduling. Figure 6 shown.

[0087] Among them, in memory hot and cold scheduling, it is necessary to determine the function call path, function access type, page access mode, page allocation strategy, and page placement strategy in sequence. For example, when determining the function call path, the function call stack information can be recorded, and when a memory operation occurs, the judgment of the hot and cold call type is triggered. When determining the function access type, the operation characteristics of the target memory operation function on the memory can be judged based on the corresponding memory access characteristics. The operation characteristics include hot call functions and cold call functions. In addition, the page access mode can include a low frequency of page accesses under cold call functions and their sub-functions; and frequent access to a certain block of memory under hot access functions and their sub-functions. The page allocation strategy can include allocating new memory to the capacity tier under cold call functions; and allocating new memory to the fast tier under hot call functions. The page placement strategy can include migrating memory under cold call functions to the capacity tier; and moving all called memory to the fast tier under hot call functions.

[0088] For example, the embodiment of the present disclosure provides a schematic diagram of memory hot and cold scheduling. Figure 7 shown.

[0089] In this Figure 7Memory hot and cold scheduling involves two steps: function call model calibration and memory scheduling strategy determination. During function call model calibration, the target load can be determined. Memory and function tracing can then be performed during the target load's execution. Function and memory access characteristics can then be determined. Finally, the function call model is calibrated.

[0090] To determine the memory scheduling policy, the calibrated function call model can be applied to a system running actual business operations. Based on the actual workload within this system, target memory operation functions are recorded. When a target memory operation function occurs, a target function call chain is triggered and determined. The target function call chain is then input into the function call model to output the hot and cold call types of the target memory operation function. Finally, a memory scheduling policy can be determined based on these hot and cold call types and implemented accordingly.

[0091] It should be noted that, since the frequency of memory access depends on the execution of the program, and the execution of the program depends on the execution of the function, this application can speculate on the memory access behavior under a certain function based on the function call stack information. If the memory under this function is frequently accessed, then all the memory pages called by the function are placed in the fast layer. If the memory access under this function is scattered and infrequent, then all the memory pages called by the function are placed in the capacity layer. In addition, in order to be able to judge the hot and cold call types of the function, the relationship between the memory behavior and the function call stack information under a specific target load can be calibrated. In actual load, the system will judge the hot and cold call types based on the function call stack information and perform corresponding memory scheduling operations. The disclosed embodiment uses memory operation functions in the program's functions to trigger scheduling pattern recognition, which is concise and effective, and does not require recording, scanning, and updating memory access data, thereby improving system operation efficiency.

[0092] It should be noted that the acquisition, storage, use, and processing of data in the technical solution disclosed herein are in compliance with the relevant provisions of national laws and regulations. Various types of data such as personal identity data, operation data, behavioral data, etc. related to individuals, customers, and groups obtained in the embodiments of the present disclosure have been authorized.

[0093] Based on the same inventive concept, the present disclosure also provides a memory hot and cold scheduling device, as described in the following embodiment. Since the principle of solving the problem in this device embodiment is similar to that in the above method embodiment, the implementation of this device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0094] Figure 8 A schematic diagram of a memory hot and cold scheduling device according to an embodiment of the present disclosure is shown. Figure 8 As shown, the device includes:

[0095] A target function call chain determining module 801 is configured to determine a target function call chain where a target memory operation function is located in response to a target memory operation occurring during system operation;

[0096] A cold / hot call type determination module 802 is configured to input a target function call chain into a pre-calibrated function call model to obtain the cold / hot call type of the target memory operation function. The pre-calibrated function call model is used to predict the cold / hot call type based on each function included in the function call chain.

[0097] The memory scheduling policy determination module 803 is used to determine the memory scheduling policy of the memory corresponding to the target memory operation according to the hot and cold call types.

[0098] In some embodiments, the memory hot and cold scheduling device provided by the embodiments of the present disclosure further includes:

[0099] A model calibration module is used to determine a target load that matches the system; run the target load, wherein the target load performs memory access based on multiple function call chains during the running process; obtain calibration data during the running process of the target load, the calibration data being used to describe memory access information corresponding to the multiple function call chains; and calibrate the function call model based on the calibration data.

[0100] In some embodiments, a model calibration module is used to obtain memory access data and function call stack data during the operation of a target load, where the function call stack data includes at least one function call chain; based on the memory access data and the function call stack data, the memory access characteristics of each function call chain are determined, where the memory access characteristics of the first function call chain are used to describe the memory access information of the memory operation function included in the first function call chain when it is called in the first function call chain, and the first function call chain is any function call chain included in the function call stack data; the memory access characteristics of each function call chain are used as calibration data.

[0101] In some embodiments, a pre-calibrated function call model is used to calculate the probability that each function in the target function call chain involves a memory call; the probability that the target function call chain involves a memory call is inferred based on the probability that each function involves a memory call; and the hot and cold call types of the target memory operation function are determined based on the probability that the target function call chain involves a memory call.

[0102] In some embodiments, the memory scheduling policy determination module 803 is used to, when the target memory operation function is a memory allocation function, if the target memory operation function is a hot call function, then the memory scheduling policy is to schedule the allocated memory to the fast layer; if the target memory operation function is a cold call function, then the memory scheduling policy is to schedule the allocated memory to the capacity layer.

[0103] In some embodiments, the memory scheduling policy determination module 803 is used to, when the target memory operation function is a memory call function, if the target memory operation function is a hot call function, then the memory scheduling policy is to schedule the accessed memory to the fast layer; if the target memory operation function is a cold call function, then the memory scheduling policy is to schedule the accessed memory to the capacity layer.

[0104] It should be noted that the target function call chain determination module 801, hot / cold call type determination module 802, and memory scheduling strategy determination module 803 described above correspond to steps S202 to S206 in the method embodiment. The examples and application scenarios implemented by these modules and corresponding steps are the same, but are not limited to the contents disclosed in the method embodiment described above. It should be noted that these modules, as part of the apparatus, can be executed in a computer system, such as a set of computer-executable instructions.

[0105] The device provided by the embodiments of the present disclosure can trigger the memory scheduling policy determination process based on target memory operations occurring during system operation. This is concise and effective, reducing system consumption and improving scheduling efficiency. Furthermore, the embodiments of the present disclosure predict the hot and cold call types of the target memory operation function through the target function call chain in which the target memory operation function resides, and determine the memory scheduling policy for the memory, thereby avoiding scanning and recording the access status of each memory page, thereby effectively reducing the resources required for computing and improving the efficiency of system operation. The accuracy of the memory scheduling policy is ensured by binding memory operations to scheduling.

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

[0107] An embodiment of the present disclosure provides an electronic device. The electronic device illustratively includes a processor and a memory. The memory can be used to store executable instructions of the processor. The processor is configured to execute the executable instructions to implement the memory hot and cold scheduling method provided in the embodiment of the present disclosure.

[0108] Refer to the following Figure 9 1 and 2 to describe the electronic device 900 according to this embodiment of the present disclosure. Figure 9 The electronic device 900 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0109] like Figure 9As shown, electronic device 900 is implemented as a general-purpose computing device. Components of electronic device 900 may include, but are not limited to, at least one processing unit 910, at least one storage unit 920, and a bus 930 connecting various system components (including storage unit 920 and processing unit 910).

[0110] The storage unit stores a program code that can be executed by the processing unit 910, so that the processing unit 910 performs the steps described in the "Exemplary Method" section of the present specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 910 can perform the following steps of the above-mentioned method embodiment: in response to a target memory operation occurring during system operation, determining a target function call chain where the target memory operation function is located; inputting the target function call chain into a pre-calibrated function call model to obtain a hot and cold call type of the target memory operation function, the pre-calibrated function call model being used to predict the hot and cold call type based on each function included in the function call chain; and determining a memory scheduling policy for the memory corresponding to the target memory operation based on the hot and cold call type.

[0111] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 9201 and / or a cache memory unit 9202 , and may further include a read-only memory unit (ROM) 9203 .

[0112] The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 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.

[0113] Bus 930 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.

[0114] The electronic device 900 may also communicate with one or more external devices 940 (e.g., a keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 900, and / or any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., a router, modem, etc.). This communication may occur via an input / output (I / O) interface 950. Furthermore, the electronic device 900 may also 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 960. As shown, the network adapter 960 communicates with other modules of the electronic device 900 via a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0115] Through the description of the above embodiments, it will be readily understood by those skilled in the art that the example embodiments described herein can be implemented via software or via a combination of software and necessary hardware. Therefore, the technical solutions 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 (such as a CD-ROM, USB flash drive, or mobile hard drive) or on a network and includes several instructions for enabling a computing device (such as a personal computer, server, terminal device, or network device) to execute the methods according to the embodiments of the present disclosure.

[0116] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer program product, which includes: a computer program, which implements the above-mentioned memory hot and cold scheduling method when executed by a processor.

[0117] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a computer program is stored. When executed by a processor, the computer program can implement the memory hot and cold scheduling method provided in the embodiment of the present disclosure. The computer-readable storage medium can be a readable signal medium or a readable storage medium.

[0118] Figure 10 A schematic diagram of a computer-readable storage medium according to an embodiment of the present disclosure is shown. Figure 10As shown, the computer-readable storage medium 1000 stores a program product capable of implementing the above-mentioned method of the present disclosure. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Methods" section above.

[0119] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0120] In the present disclosure, a computer-readable storage 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 various 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.

[0121] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.

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

[0123] 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.

[0124] 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.

[0125] Through the description of the above embodiments, it will be readily understood by those skilled in the art that the example embodiments described herein can be implemented via software or via a combination of software and necessary hardware. Therefore, the technical solutions 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 (such as a CD-ROM, USB flash drive, or mobile hard drive) or on a network and includes several instructions for enabling a computing device (such as a personal computer, server, mobile terminal, or network device) to execute the methods according to the embodiments of the present disclosure.

[0126] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure 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 of the present disclosure being indicated by the appended claims.

Claims

1. A memory hot and cold scheduling method, It is characterized in that include: In response to a target memory operation occurring during system operation, determining a target function call chain where the target memory operation function is located; Input the target function call chain into a pre-calibrated function call model to obtain the hot and cold call types of the target memory operation function, wherein the pre-calibrated function call model is used to predict the hot and cold call types according to the functions included in the function call chain, wherein the function call model is obtained by pre-calibrating the memory access characteristics of each function call chain as calibration data, and the pre-calibrated function call model is used to calculate the probability that each function in the target function call chain involves a memory call; infer the probability that the target function call chain involves a memory call according to the probability that each function involves a memory call; determine the hot and cold call types of the target memory operation function according to the probability that the target function call chain involves a memory call; A memory scheduling policy of the memory corresponding to the target memory operation is determined according to the cold and hot call types.

2. The memory hot and cold scheduling method according to claim 1, It is characterized in that The method further comprises: determining a target load that matches the system; Running the target load, wherein the target load performs memory access based on multiple function call chains during the running process; Acquiring calibration data during the operation of the target load, wherein the calibration data is used to describe memory access information corresponding to multiple function call chains; The function call model is calibrated according to the calibration data.

3. The memory hot and cold scheduling method according to claim 2, It is characterized in that The obtaining of calibration data during the operation of the target load includes: Acquire memory access data and function call stack data during the running process of the target load, wherein the function call stack data includes at least one function call chain; Determine the memory access characteristics of each function call chain according to the memory access data and the function call stack data, wherein the memory access characteristics of the first function call chain are used to describe the memory access information of the memory operation function included in the first function call chain when it is called in the first function call chain, and the first function call chain is any function call chain included in the function call stack data; The memory access characteristics of each function call chain are used as the calibration data.

4. The memory hot and cold scheduling method according to claim 1, It is characterized in that When the target memory operation function is a memory allocation function, determining the memory scheduling strategy of the memory corresponding to the target memory operation according to the hot and cold call types includes: If the target memory operation function is a hot call function, the memory scheduling strategy is to schedule the allocated memory to the fast layer; If the target memory operation function is a cold call function, the memory scheduling strategy is to schedule the allocated memory to the capacity layer.

5. The memory hot and cold scheduling method according to claim 1 or 4, It is characterized in that When the target memory operation function is a memory call function, determining the memory scheduling strategy of the memory corresponding to the target memory operation according to the hot and cold call types includes: If the target memory operation function is a hot call function, the memory scheduling strategy is to schedule the accessed memory to the fast layer; If the target memory operation function is a cold call function, the memory scheduling strategy is to schedule the accessed memory to the capacity layer.

6. A memory hot and cold scheduling device, It is characterized in that include: A target function call chain determination module, used to determine a target function call chain where a target memory operation function is located in response to a target memory operation occurring during system operation; A cold and hot call type determination module is used to input the target function call chain into a pre-calibrated function call model to obtain the cold and hot call types of the target memory operation function, wherein the pre-calibrated function call model is used to predict the cold and hot call types according to the functions included in the function call chain, wherein the function call model is obtained by pre-calibrating the memory access characteristics of each function call chain as calibration data, and the pre-calibrated function call model is used to calculate the probability that each function in the target function call chain involves a memory call; the probability that the target function call chain involves a memory call is inferred according to the probability that each function involves a memory call; and the cold and hot call types of the target memory operation function are determined according to the probability that the target function call chain involves a memory call; A memory scheduling strategy determination module is used to determine the memory scheduling strategy of the memory corresponding to the target memory operation according to the cold and hot call types.

7. An electronic device, It is characterized in that include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the memory hot and cold scheduling method according to any one of claims 1 to 5 by executing the executable instructions.

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

9. A computer program product, It is characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the memory hot and cold scheduling method as described in any one of claims 1 to 5.