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

By determining the hot and cold call types of the target memory operation function in the hybrid memory system, and using the function call model to optimize the memory scheduling strategy, the problem of low memory scheduling efficiency in the existing technology is solved, and efficient and accurate memory scheduling is achieved.

CN118656223AActive Publication Date: 2024-09-17CHINA TELECOM CORP LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing method of scanning each memory access situation in a hybrid memory system results in high consumption, low scheduling efficiency, and failure 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 hot and cold call types, the memory scheduling strategy is determined to avoid scanning and recording the access status of each memory page.

Benefits of technology

Simply and effectively reduce system consumption, improve scheduling efficiency, and ensure the accuracy of memory scheduling strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656223A
    Figure CN118656223A
Patent Text Reader

Abstract

The invention provides a memory cold and hot scheduling method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: in response to occurrence of a target memory operation, determining a target function call chain where a target memory operation function is located; inputting the target function call chain into a pre-calibrated function call model to obtain a cold and hot call type of the target memory operation function; and determining a memory scheduling strategy of a memory corresponding to the target memory operation according to the cold and hot call type. The determination process of triggering the memory scheduling strategy based on the target memory operation is simple and effective, system consumption is reduced, and scheduling efficiency is improved. According to the embodiment of the invention, scanning, recording and the like of the access condition of each memory page can be avoided, so that resources required by calculation are effectively reduced, the system operation efficiency is improved, and the accuracy of a memory scheduling strategy is ensured based on memory operation and scheduling binding.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the development of computer technology, the amount of data continues to grow, and the requirements for memory continue to increase. With the development of various memory technologies, many new memory devices have emerged. These memory devices can be mounted on a system at the same time and can be directly accessed. Since these memories have different access speeds, capacities, prices, etc., memory scheduling is required to place different data in different memory layers.

[0003] In the related art, the access status of each memory page can be scanned and the historical data of the access can be recorded to determine the data scheduling. However, for systems with large capacity and complex scheduling, such as hybrid memory, the method of scanning each memory access brings about large consumption, low scheduling efficiency, and cannot ensure the accuracy of scheduling.

[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 the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The present invention 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 failure to ensure scheduling accuracy caused by the method of scanning each memory access in the related art.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the 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 where 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 types according to each function included in the function call chain; and determining a memory scheduling policy for the memory corresponding to the target memory operation according to the hot and cold call types.

[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 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 memory access information of a 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 a 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 occurrence of a target memory operation 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 according to the 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 according to 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 also includes: a model calibration module, used to determine 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, wherein 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, wherein the memory access characteristics of a first function call chain are used to describe the memory access information of a 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 a 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 also 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 a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being 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 provided in various optional ways in any embodiment of the present disclosure.

[0022] The technical solution provided by the embodiment of the present disclosure can trigger the determination process of the memory scheduling strategy based on the target memory operation occurring during the system operation, which is concise and effective, can reduce the consumption of the system and improve the scheduling efficiency. In addition, the embodiment of the present disclosure predicts the hot and cold call types of the target memory operation function through the target function call chain where the target memory operation function is located, and determines the memory scheduling strategy of the memory, avoiding scanning and recording the access conditions of each memory page, etc., thereby effectively reducing the resources required for calculation and improving the efficiency of system operation, and ensuring the accuracy of the memory scheduling strategy based on the binding of memory operation and scheduling.

[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 present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings herein are incorporated into the specification 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 accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0025] Figure 1 A schematic diagram showing a system architecture in an embodiment of the present disclosure; Figure 2 A flow chart of a memory hot and cold scheduling method in an embodiment of the present disclosure is shown; Figure 3 A schematic diagram showing a function call chain in an embodiment of the present disclosure; Figure 4 A schematic diagram showing a calibration of a function call model in an embodiment of the present disclosure is shown; Figure 5 A schematic diagram showing a method of determining hot and cold call types in an embodiment of the present disclosure is shown; Figure 6A schematic diagram of memory hot and cold scheduling in an embodiment of the present disclosure is shown; Figure 7 A schematic diagram showing another memory hot and cold scheduling in an embodiment of the present disclosure is shown; Figure 8 A schematic diagram of a memory hot and cold scheduling device in an embodiment of the present disclosure is shown; Fig. 9 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown; Fig.10 A schematic diagram of a computer-readable storage medium in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0026] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to 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.

[0027] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

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

[0029] Figure 1 FIG. 2 shows an exemplary application system architecture diagram to which the memory hot and cold scheduling method in 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 .

[0030] In response to a target memory operation occurring during system operation, the terminal device 101 may determine a target function call chain where the target memory operation function is located. Then, the terminal device 101 may 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 a 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.

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

[0032] Optionally, the wireless network or wired network described above uses standard communication technology and / or protocols. The network is typically the Internet, but may also 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 Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. 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), Internet Protocol Security (IPSec), etc. may be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies may also be used to replace or supplement the above data communication technologies.

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

[0034] The server 103 may be a server that provides various services, such as a background management server that provides support for the device 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.

[0035] 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), as well as big data and artificial intelligence platforms.

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

[0037] Under the above system architecture, a method for hot and cold memory scheduling is provided in an embodiment of the present disclosure. The method can be executed by any electronic device with computing and processing capabilities.

[0038] In some embodiments, the memory hot and cold scheduling method provided in the embodiments of the present disclosure can be executed by a 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 a 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 the server in the above-mentioned system architecture through interaction.

[0039] Figure 2 A flow chart of a memory hot and cold scheduling method in 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.

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

[0041] The embodiments of the present disclosure do not limit the system. For example, the system may be a scientific computing system, an e-commerce platform ordering system, etc. The system needs to store data based on memory, so when a target memory operation occurs during system operation, the memory operated by the target memory operation may be scheduled.

[0042] 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 a new type of memory such as NVM (Non Volatile Memory), HBM (High Bandwidth Memory) and other memories provided by CXL (Compute Express Link) and / or RDMA (Remote Direct Memory Access) and other interconnection technologies, and traditional DRAM.

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

[0044] Exemplarily, 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 malloc (memory allocation, dynamic memory allocation), etc. The memory call function may be brk (a memory read function).

[0045] In some embodiments, the target memory operation can be performed based on the function call. Therefore, the function call chain can be recorded during the system operation to determine whether there is a memory operation class function triggered in the function call chain. When the memory operation class function is triggered, it is necessary to predict the hot and cold call types.

[0046] For example, during the operation of the system, a function call chain of f0-f1-f2-f3-fa is generated, wherein f0, f1, f2, f3, and fa are functions in the function call chain. For example, fa may be a memory allocation operation. Since a memory allocation operation occurs, it is determined that a target memory operation is currently occurring. At this time, the target function call chain f0-f1-f2-f3-fa corresponding to the target memory operation may be obtained.

[0047] For another example, during the operation of the system, a function call chain of f0-f1-f4-f5-fc is generated, wherein f0, f1, f4, f5, and fc are functions in the function call chain. Exemplarily, fc may be a memory call operation. Since a memory call operation occurs, it is determined that a target memory operation is currently occurring. At this time, the target function call chain f0-f1-f4-f5-fc corresponding to the target memory operation may be obtained.

[0048] S204, 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, and the pre-calibrated function call model is used to predict the cold and hot call types according to each function included in the function call chain.

[0049] Exemplarily, the pre-calibrated function call model can be constructed using a neural model, a statistical model, etc. The pre-calibrated function call model can be used to predict the hot and cold call types of the input function call chain. The purpose of pre-calibrating the function call model can include adjusting the model parameters to improve the degree to which the model prediction results match the actual observed data.

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

[0051] In an exemplary embodiment, the target load can be matched with the above-mentioned system to ensure that the calibration data obtained by the target load is used to calibrate the function call model, so that the function call model can be suitable for scheduling the memory of the system. Exemplarily, the target load can be derived from some benchmarks or actual business data, and run the test in the system.

[0052] In one possible implementation, the predicted probability of the model can be evaluated by calibration data to check whether the predicted probability of the model is consistent 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 predicted probability of the function call model.

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

[0054] 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 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 a first function call chain are used to describe memory access information of a 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.

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

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

[0057] 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, the above three function call chains can be obtained according to the target load to achieve the measurement of the target load.

[0058] Exemplarily, the memory access data includes memory access frequency, access time, and memory space size. After acquiring the memory access data, the functions included in the function call stack data can be associated with the memory blocks called by the function call chain to obtain memory access characteristics.

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

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

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

[0062] In this Figure 4 In the example, the three function call chains f0-f1-f2-f3-fa, f0-f1-f4-f5-fc, and f0-f1-f5-fc and the corresponding memory access features can be input into the function call model for calibration. Among them, for the function call chain where the memory allocation function is located, the memory access features can be represented by the time access features of the memory allocation and the access features of the memory scheduling space. The time access features of the memory allocation can be represented as the relationship between the access frequency and the time, and the access features of the memory scheduling space can be represented as the relationship between the access frequency and the memory space.

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

[0064] Exemplarily, 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.

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

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

[0067] In this Figure 5In the example, the function call model can be pre-calibrated based on 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.

[0068] In this case, the target function call chain of f0-f1-f2-f3-fa can be input into the function call model. At this time, the function call model can calculate the probability that the f0, f1, f2, and f3 functions in the target function call chain involve memory calls, and infer the probability that the target function call chain involves memory calls based on the probability that each function involves memory calls. Finally, based on the probability that the target function call chain involves memory calls, the hot and cold call types of the target memory operation function are determined.

[0069] It should be noted that the embodiment of the present disclosure can calibrate the judgment model for the cold and hot call types through the function call chain and memory access characteristics obtained when the target load is running on the system. The embodiment of the present disclosure uses the target load for calibration, which is close to the program behavior itself, improves the pertinence of the calibration, and thus improves the accuracy of determining the cold and hot call types. In addition, the embodiment of the present disclosure further improves the accuracy of determining the cold and hot call types by binding the cold and hot call types to the function behavior.

[0070] S206: Determine a memory scheduling policy of the memory corresponding to the target memory operation according to the cold or hot call type.

[0071] 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, the hot call function is a frequently accessed memory call function or a memory allocation function that allocates memory and is frequently called, and the cold call function is an infrequent memory call function or a memory allocation function whose allocated memory is not frequently accessed.

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

[0073] In a possible implementation, when the target memory operation function is a memory allocation function, the memory scheduling strategy 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 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.

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

[0075] Exemplarily, after the memory scheduling policy is confirmed, the memory placement can be performed accordingly.

[0076] The method provided by the embodiment of the present disclosure can trigger the determination process of the memory scheduling policy based on the target memory operation occurring during the system operation. It is concise and effective, and can reduce the consumption of the system and improve the scheduling efficiency. In addition, the embodiment of the present disclosure predicts the hot and cold call types of the target memory operation function through the target function call chain where the target memory operation function is located, and determines the memory scheduling policy of the memory, avoiding scanning and recording the access conditions of each memory page, etc., 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.

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

[0078] Among them, the function call path, function access type, page access mode, page allocation strategy, and page placement strategy need to be determined in sequence in the memory hot and cold scheduling. Exemplarily, 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 types is triggered. When determining the function access type, the operation characteristics of the target memory operation function on the memory can be judged according to the corresponding memory access characteristics. The operation characteristics include hot call functions and cold call functions. In addition, the page access mode may include a low page access frequency under a cold call function and its sub-functions; a certain block of memory will be frequently accessed under a hot access function and its sub-functions. The page allocation strategy may include allocating new memory to the capacity layer under a cold call function; and allocating new memory to the fast layer under a hot call function. The page placement strategy may include migrating the memory under a cold call function to the capacity layer; and moving all called memory to the fast layer under a hot call function.

[0079] Exemplarily, the present disclosure provides a schematic diagram of memory hot and cold scheduling. Figure 7 shown.

[0080] In this Figure 7In the process of calibrating the function call model, the target load can be determined first. Then, the memory and function tracking can be performed during the operation of the target load. Then, the function and memory access characteristics can be determined. Finally, the function call model is calibrated.

[0081] In the process of determining the memory scheduling strategy, the above-calibrated function call model can be applied to the system running the actual business. Based on the operation of the actual load in the system, the target memory operation function is recorded. When the target memory operation function occurs, the target function call chain is triggered. Then, the target function call chain can be input into the function call model to output the hot and cold call types of the target memory operation function. Finally, the memory scheduling strategy can be determined according to the hot and cold call types and controlled for implementation.

[0082] 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, the present application can infer 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 determine the cold and hot 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 loads, the system will determine the cold and hot call types based on the function call stack information and perform corresponding memory scheduling operations. The disclosed embodiment uses memory operation functions in the functions of the program to trigger scheduling pattern recognition, which is concise and effective, and does not require recording, scanning, and updating of memory access data, thereby improving system operation efficiency.

[0083] It should be noted that the acquisition, storage, use, and processing of data in the technical solution disclosed in this disclosure are in compliance with the relevant provisions of national laws and regulations, and 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 this disclosure have all been authorized.

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

[0085] Figure 8 A schematic diagram of a memory hot and cold scheduling device in an embodiment of the present disclosure is shown. Figure 8 As shown, the device comprises: A target function call chain determination module 801 is 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 802 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. The pre-calibrated function call model is used to predict the cold and hot call types according to each function included in the function call chain; The memory scheduling strategy determination module 803 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.

[0086] In some embodiments, the memory hot and cold scheduling device provided by the embodiments of the present disclosure further includes: 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 according to the calibration data.

[0087] 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, wherein 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, wherein the memory access characteristics of a first function call chain are used to describe the memory access information of a 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.

[0088] In some embodiments, a pre-calibrated function call model is used to calculate the probability that each function in a 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.

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

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

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

[0092] The device provided by the embodiment of the present disclosure can trigger the determination process of the memory scheduling strategy based on the target memory operation occurring during the system operation, which is concise and effective, can reduce the consumption of the system and improve the scheduling efficiency. In addition, the embodiment of the present disclosure predicts the hot and cold call types of the target memory operation function through the target function call chain where the target memory operation function is located, and determines the memory scheduling strategy of the memory, avoiding scanning and recording the access conditions of each memory page, etc., thereby effectively reducing the resources required for calculation and improving the efficiency of system operation, and ensuring the accuracy of the memory scheduling strategy based on the binding of memory operation and scheduling.

[0093] 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 specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0094] The embodiment of the present disclosure provides an electronic device, which exemplarily includes: a processor and a memory. The memory can be used to store executable instructions of the processor. The processor is configured to perform the memory hot and cold scheduling method provided by the embodiment of the present disclosure by executing the above executable instructions.

[0095] Refer to the following Fig. 9 The electronic device 900 according to this embodiment of the present disclosure is described. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0096] like Fig. 9As shown, the electronic device 900 is in the form of a general computing device. The components of the 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 different system components (including the storage unit 920 and the processing unit 910).

[0097] Among them, the storage unit stores a program code, and the program code can be executed by the processing unit 910, so that the processing unit 910 executes the steps described in the above "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 910 can execute the following steps of the above method embodiment: in response to the occurrence of a target memory operation during system operation, determine the 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, and the pre-calibrated function call model is used to predict the hot and cold call types according to the various functions included in the function call chain; according to the hot and cold call types, determine the memory scheduling strategy of the memory corresponding to the target memory operation.

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

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

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

[0101] The electronic device 900 may also communicate with one or more external devices 940 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 900, and / or communicate with any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication may be performed through an input / output (I / O) interface 950. In addition, the electronic device 900 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 960. As shown, the network adapter 960 communicates with other modules of the electronic device 900 through 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, etc.

[0102] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation 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 a number of 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 implementation of the present disclosure.

[0103] In particular, according to an embodiment of the present disclosure, the process described with reference to the flowchart above 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.

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

[0105] Fig.10 A schematic diagram of a computer-readable storage medium in an embodiment of the present disclosure is shown. Fig.10As shown, a program product capable of implementing the above method of the present disclosure is stored on the computer-readable storage medium 1000. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.

[0106] 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 fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0107] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0108] 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 of the foregoing.

[0109] In specific implementation, the program code for performing the operation 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++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent 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 the case of a remote computing device, the remote computing device may be connected to the user computing device through 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., using an Internet service provider to connect through the Internet).

[0110] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, 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 embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0111] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the 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, etc.

[0112] Through the description of the above implementation modes, it is easy for those skilled in the art to understand that the example implementation modes described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation mode 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 implementation mode of the present disclosure.

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

Claims

1. A memory hot and cold scheduling method, 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; Inputting 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 each function included in the function call chain; 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, 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, 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 any one of claims 1 to 3, characterized in that: 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 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.

5. The memory hot and cold scheduling method according to claim 1, 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.

6. The memory hot and cold scheduling method according to claim 1 or 5, 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.

7. A memory hot and cold scheduling device, 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, used for inputting 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 for predicting the cold and hot call types according to each function included in the function call chain; 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.

8. An electronic device, 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 6 by executing the executable instructions.

9. 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 hot-cold scheduling method according to any one of claims 1 to 6 is implemented.

10. A computer program product, 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 6.

Citation Information

Patent Citations

  • Memory leak positioning method and device, medium and electronic equipment

    CN111813666A

  • Multi-thread cold and hot distribution processing method, device and equipment and storage medium

    CN117149384A

  • Memory access detection method and device, electronic equipment and computer storage medium

    CN118152298A

  • Resource scheduling method and apparatus, and computing device cluster, medium and program product

    WO2024027148A1

  • Method for adjusting program storage position, and related apparatus

    WO2024139864A1