A hot page identification method and related equipment
By identifying the most frequently accessed address range in the mapping table and updating the mapping relationship, the problem of low accuracy in hot page identification methods is solved, and more efficient hot page identification is achieved.
Patent Information
- Application Number
- CN202411148230.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2044-08-20
AI Technical Summary
In existing technologies, hot page identification methods have low accuracy under intensive access conditions, resulting in low efficiency in hot page identification.
By obtaining the access frequency of each memory block in the mapping table, a mapping relationship between the memory access address and the mapping table group is established. The address segment with the highest change frequency among multiple historical memory access requests is identified, and the preset mapping relationship is updated when a mapping conflict occurs, thus avoiding hot page omission.
It improves the accuracy and efficiency of hot page identification, ensuring accurate identification of hot pages under intensive access conditions and avoiding missed hot pages.
Smart Images

Figure CN121636366B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a hot page identification method and related equipment. Background Technology
[0002] With the emergence of various cloud scenarios and data center services, the requirements for memory capacity and bandwidth are becoming increasingly demanding. However, during application runtime, not all applications frequently access memory; most memory simply occupies space without being frequently accessed. Initially, server memory is typically configured based on the maximum capacity of the business scenario, but the server only runs at peak demand for a limited period, resulting in low memory utilization.
[0003] Therefore, the concept of tiered memory storage was proposed. In tiered memory storage, data frequently accessed by the central processing unit (CPU) is stored on storage media closer to the CPU. This storage media is fast and has low latency, but it is expensive. Data less frequently accessed by the CPU is stored on storage media farther from the CPU. This storage media is inexpensive, but its performance parameters such as bandwidth and latency are poorer. As can be seen from the above, storing data on different storage media according to the frequency of access is a key technical point. In related technologies, virtual memory pages can be used as units to identify and migrate hot and cold pages, thereby realizing tiered memory storage.
[0004] However, the above method may involve intensive access. Due to the significant increase in the amount of hot page data, hot pages may be missed, reducing the accuracy of hot page recognition and thus resulting in low efficiency of hot page recognition. Summary of the Invention
[0005] This application provides a hot page recognition method and related equipment, which can improve the accuracy of hot page recognition and thus improve the efficiency of hot page recognition.
[0006] Firstly, a hot page identification method is provided, applied to a computing device. The method includes: obtaining the access frequency of each memory block in a mapping table; wherein the mapping table includes multiple groups, each group includes multiple memory blocks, and each memory block indicates a physical memory region; the access frequency of a first memory block represents the number of times a first memory access address is mapped to a physical memory region in response to a first memory access request within a preset time period; the first memory block is a memory block corresponding to a first memory access address determined according to a preset mapping relationship; the first memory access address is the memory address indicated by the first memory access request; the preset mapping relationship includes the mapping relationship between a first address segment in the memory access address and a group in the mapping table; the first address segment includes the address segment with the highest data change frequency among multiple historical memory access address indications; determining hot pages in virtual memory pages based on memory blocks in the mapping table whose access frequencies meet preset conditions; different memory blocks in the mapping table correspond to different virtual memory pages; and the first memory access request is used to request a virtual memory page corresponding to the first memory access address.
[0007] As shown above, by establishing a mapping relationship between memory access addresses and various groups in the mapping table based on the address range with the highest data change frequency among the memory access addresses indicated by multiple historical memory access requests, the mapping relationship between memory access addresses and various groups in the mapping table can be balanced. This avoids dense access to any group in the mapping table, which would cause memory access addresses with the same frequency of access to not be recorded, thereby avoiding hot page omissions, improving the accuracy of hot page identification, and further improving the efficiency of hot page identification.
[0008] In one possible implementation, before determining the hot pages in the virtual memory page based on memory blocks in the mapping table whose access frequency meets a preset condition, the method further includes: determining whether there are mapping conflicts in each group of the mapping table within a preset time period, wherein the existence of mapping conflicts in the first group includes the number of memory addresses mapped to the first group using the preset mapping relationship within the preset time period being greater than the number of memory blocks in the first group, and the first group being any group in the mapping table; if at least one group in the mapping table has mapping conflicts within the preset time period, updating the preset mapping relationship; the address segments in the updated preset mapping relationship are different from the address segments in the original preset relationship.
[0009] As described above, before determining the hot pages in the virtual memory page based on memory blocks whose access frequency meets preset conditions in the mapping table, it is possible to determine whether the preset mapping relationship at the current moment can avoid missing hot pages by judging whether there are mapping conflicts in each group of the mapping table within a preset time period. If there are mapping conflicts in each group of the mapping table within the preset time period, the preset mapping relationship is updated. This can further improve the accuracy of hot page identification.
[0010] In one possible implementation, the number of mapping conflicts occurring in each group of the mapping table within a preset time period is obtained; wherein, the number of mapping conflicts occurring in the first group is the number of times the memory access address mapped to the first group using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group; if the number of mapping conflicts occurring in the first group is greater than a first threshold, it is determined that there is a mapping conflict in the first group.
[0011] As shown above, by determining whether the number of mapping conflicts in each group of the mapping table within a preset time period is greater than the first threshold, it is possible to determine whether there is intensive access in each group of the mapping table, providing a more accurate basis for updating the preset mapping relationship, thereby improving the efficiency of hot page identification.
[0012] In one possible implementation, if the sum of the number of mapping conflicts in each group of the mapping table is greater than a second threshold, the preset mapping relationship is updated.
[0013] As shown above, the decision to update the preset mapping relationship is made by determining whether the sum of the number of mapping conflicts in each group of the mapping table exceeds the second threshold. If the sum of the number of mapping conflicts in each group of the mapping table exceeds the second threshold, the preset mapping relationship is updated. This improves the feasibility and flexibility of the hot page recognition method.
[0014] In one possible implementation, the second address segment with the highest change frequency among multiple memory access addresses within a preset time period is determined; based on the second address segment, a preset mapping relationship is updated, and the updated preset mapping relationship includes the mapping relationship between the second address segment in the memory access address and the group in the mapping table.
[0015] As shown above, by determining the second address segment with the highest change frequency among multiple memory access addresses within a preset time period, and updating the preset relationship based on the second address segment, the mapping relationship between memory access addresses and each group in the mapping table within the preset time period can be balanced, avoiding hot page omissions caused by dense access in any group, and improving the accuracy of hot page identification.
[0016] In one possible implementation, a first mapping set is obtained; the first mapping set includes multiple candidate mapping relationships; a preset mapping relationship is updated according to the first mapping set; wherein the updated preset mapping relationship is one of the multiple candidate mapping relationships.
[0017] As can be seen from the above, obtaining the first mapping set before obtaining the access frequency of each memory block in the mapping table, and updating the preset mapping relationship through the first mapping set, can improve the efficiency of updating the preset relationship without determining the second address segment.
[0018] In one possible implementation, if there are no mapping conflicts in any group of the mapping table within a preset time period, the hot pages in the virtual memory pages are determined based on the memory blocks in the mapping table whose access frequency meets the preset conditions.
[0019] As can be seen from the above, if there are no mapping conflicts in any group of the mapping table within the preset time period, the hot pages in the virtual memory pages can be determined by the memory blocks in the mapping table whose access frequency meets the preset conditions. This can avoid missing hot pages and improve the efficiency of hot page identification.
[0020] In one possible implementation, if the sum of the number of mapping conflicts in each group of the mapping table is less than or equal to a second threshold, the hot pages in the virtual memory pages are determined based on the memory blocks in the mapping table whose access frequency meets the preset conditions; wherein, the number of mapping conflicts in the first group is the number of times the memory access address mapped to the first group using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group.
[0021] As can be seen from the above, when the sum of the number of mapping conflicts in each group of the mapping table is less than or equal to the second threshold, the hot pages in the virtual memory pages can be determined by using the memory blocks in the mapping table whose access frequency meets the preset conditions. This can improve the feasibility and flexibility of the hot page identification method.
[0022] Secondly, a hot page identification device is provided. Embodiments of this application can divide the hot page identification device into functional modules based on the method provided in the first aspect. The device includes: an acquisition module, used to acquire the access frequency corresponding to each memory block in a mapping table; wherein the mapping table includes multiple groups, each group includes multiple memory blocks, and one memory block indicates a physical memory region; the access frequency corresponding to a first memory block represents the number of times a first memory access address is mapped to a physical memory region in response to a first memory access request within a preset time period; the first memory block is a memory block corresponding to a first memory access address determined according to a preset mapping relationship; the first memory access address is the memory address indicated by the first memory access request; the preset mapping relationship includes the mapping relationship between a first address segment in the memory access address and a group in the mapping table; the first address segment includes the address segment with the highest data change frequency among multiple historical memory access request-indicated memory access addresses;
[0023] The identification module is used to determine the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets the preset conditions; different memory blocks in the mapping table correspond to different virtual memory pages; the first memory access request is used to request the virtual memory page corresponding to the first memory access address.
[0024] In one possible implementation, the acquisition module is further used to acquire the number of mapping conflicts that occur in each group of the mapping table within a preset time period; wherein, the number of mapping conflicts that occur in the first group is the number of times that the memory access address mapped to the first group using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group.
[0025] In one possible implementation, the acquisition module is also used to acquire a first mapping set; the first mapping set includes multiple candidate mapping relationships.
[0026] In one possible implementation, the identification module is also used to determine the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets the preset conditions, provided that there are no mapping conflicts in each group of the mapping table within a preset time period.
[0027] In one possible implementation, the identification module is further configured to determine the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets the preset conditions, when the sum of the number of mapping conflicts in each group of the mapping table is less than or equal to the second threshold; wherein, the number of mapping conflicts in the first group is the number of times the memory access address mapped to the first group using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group.
[0028] In one possible implementation, the hot page identification device further includes a processing module for determining whether there are mapping conflicts in each group of the mapping table within a preset time period. The first group having a mapping conflict includes the following: the number of memory addresses mapped to the first group using the preset mapping relationship within the preset time period is greater than the number of memory blocks in the first group. The first group can be any group in the mapping table. If at least one group in the mapping table has a mapping conflict within the preset time period, the preset mapping relationship is updated. The address segments in the updated preset mapping relationship are different from the address segments in the original preset relationship.
[0029] In one possible implementation, the processing module is also used to determine that there is a mapping conflict in the first group if the number of mapping conflicts in the first group is greater than a first threshold.
[0030] In one possible implementation, the processing module is also used to update the preset mapping relationship if the sum of the number of mapping conflicts in each group of the mapping table is greater than a second threshold.
[0031] In one possible implementation, the processing module is further configured to determine the second address segment with the highest change frequency among multiple memory access addresses within a preset time period; and update the preset mapping relationship based on the second address segment, wherein the updated preset mapping relationship includes the mapping relationship between the second address segment in the memory access address and the group in the mapping table.
[0032] In one possible implementation, the processing module is further configured to update a preset mapping relationship based on a first mapping set; wherein the updated preset mapping relationship is one of a plurality of candidate mapping relationships.
[0033] The descriptions of the possible technical solutions and beneficial effects of each of the above-mentioned functional modules can be found in the technical solutions provided in the first aspect or its corresponding possible implementation methods, and will not be repeated here.
[0034] Thirdly, embodiments of this application provide a computing device cluster, which includes at least one computing device. Each computing device includes a processor and a memory for storing processor-executable instructions. The processor is configured to execute instructions, causing the computing device to perform the hot page identification method described above.
[0035] Fourthly, embodiments of this application provide a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to implement the hot page identification method as described above.
[0036] Fifthly, embodiments of this application provide a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computing node reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computing node to perform the hot page identification method provided in various optional implementations of the above aspects.
[0037] For a detailed description of the second to fifth aspects and their various implementations in the embodiments of this application, please refer to the detailed description in the first aspect and its various implementations; and for a detailed description of the beneficial effects of the second to fifth aspects and their various implementations, please refer to the beneficial effect analysis in the various implementations of the first aspect, which will not be repeated here.
[0038] These or other aspects of the embodiments of this application will become more apparent in the following description. Attached Figure Description
[0039] Figure 1 A schematic diagram of a hot page identification method provided by related technologies is shown;
[0040] Figure 2 This diagram illustrates a memory address mapping relationship provided by related technologies.
[0041] Figure 3 A schematic diagram of a hardware interaction framework 100 provided in an embodiment of this application is shown;
[0042] Figure 4A schematic diagram of a data acquisition function feedback framework 200 provided in an embodiment of this application is shown;
[0043] Figure 5 This illustration shows a schematic diagram of the implementation of a data acquisition function feedback framework 200 provided in an embodiment of this application on a media module;
[0044] Figure 6 This illustration shows a schematic diagram of the implementation of a data acquisition function feedback framework 200 provided in an embodiment of this application within a CPU.
[0045] Figure 7 This illustration shows a schematic diagram of the implementation of a data acquisition function feedback framework 200 provided in an embodiment of this application on a separate hardware module;
[0046] Figure 8 This illustration shows a hardware structure diagram of a hot page recognition system 300 provided in an embodiment of this application;
[0047] Figure 9 A flowchart illustrating the hot page identification method provided in an embodiment of this application is shown;
[0048] Figure 10 This illustration shows a mapping conflict scenario provided by an embodiment of this application.
[0049] Figure 11 This illustration shows a schematic diagram of updating a preset mapping relationship according to an embodiment of this application;
[0050] Figure 12 A logical schematic diagram of a hot page identification method provided in an embodiment of this application is shown;
[0051] Figure 13 This illustration shows a schematic diagram of the mapping process of a mapping table provided in an embodiment of this application;
[0052] Figure 14 This illustration shows a migration process provided in an embodiment of this application;
[0053] Figure 15 This illustration shows a hot page migration diagram provided in an embodiment of this application;
[0054] Figure 16 This illustration shows a schematic diagram of a hotspot recognition device provided in an embodiment of this application;
[0055] Figure 17 A schematic diagram of a computing device provided in an embodiment of this application is shown. Detailed Implementation
[0056] The terms “first,” “second,” “third,” and “fourth,” etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to define a specific order.
[0057] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0058] First, the application scenarios of the embodiments of this application will be introduced by way of example.
[0059] In software applications, servers are typically configured with memory based on the maximum workload. However, servers only operate at peak demand for a limited period, with hot data potentially occupying only 10%-20% of memory, or even as low as 5%-10%. The majority of memory remains unused, resulting in low memory utilization and wasted resources. To address this, the concept of memory tiering has been proposed. Data is stored in different memory media based on its access frequency. This not only ensures that the required memory capacity and bandwidth meet the demands of the business scenario but also improves memory utilization and saves on memory costs.
[0060] Typically, the CPU core accesses memory using virtual addresses and translates them into physical addresses through the Memory Management Unit (MMU). This virtual-to-physical address translation involves querying pages, typically 4KB, 6KB, or 2MB in size. For the operating system, each application needs to request a page from the operating system if it requires memory. In other words, page access is related to the actual memory access by the application. Therefore, in related technologies, pages can be used as units to identify cold or hot pages, thereby achieving hierarchical memory storage. For example, Figure 1 A schematic diagram of a hotspot identification method provided by related technologies is shown. For example... Figure 1 As shown, when the cache uses a set-associative structure, it includes three sets: set0, set1, and set2; each set contains four memory blocks (ways). Each way also has a corresponding counter to record the frequency of access to that way.
[0061] If the operating system sends an access request to the cache, including memory address 10, and based on the mapping relationship between memory address 10 and the sets in the cache, if memory address 10 hits way2 in cache set1, it means that the page corresponding to way2 has a historical access record. The memory address can directly access way2 in set1, and simultaneously, counter 6 in the counter file is incremented by 1, recording the access frequency of the access request corresponding to memory address 10. Based on the above method, hot pages can be identified according to the frequency of page access.
[0062] However, in related technologies, under intensive access conditions, hot pages may be missed, reducing the accuracy of hot page identification. For example, Figure 2 This diagram illustrates a memory address mapping relationship provided by related technologies, such as... Figure 2 As shown, when the cache uses a set-associative structure (x-set * y-way), taking 512-set * 4-way as an example, it includes 512 sets, each containing 4 memory blocks. The lower 9 bits of the memory access address are mapped one-to-one with the 512 sets, with each set storing 4 memory access addresses that share the same lower 9 bits. As the hot zone widens, the amount of hot data at the same lower 9-bit memory access address increases significantly, while each set remains 4-way. If the number of data with the same high frequency or popularity at the same lower 9-bit memory access address exceeds 4, set mapping conflicts will occur, leading to missed hot pages and severely impacting the accuracy of hot page identification.
[0063] In view of this, embodiments of this application provide a hot page identification method, which is applied to a computing device. The method includes the computing device obtaining the access frequency corresponding to each memory block in a mapping table. The mapping table includes multiple groups; each group includes multiple memory blocks; a memory block is used to indicate a physical memory region; the access frequency corresponding to a first memory block represents the number of times a first memory access address is mapped to a physical memory region in response to a first memory access request within a preset time period; the first memory block is a memory block corresponding to a first memory access address determined according to a preset mapping relationship; the first memory access address is the memory address indicated by the first memory access request; the preset mapping relationship includes the mapping relationship between data at a target location in the memory access address and groups in the mapping table; the target location is at least one data location with the highest change frequency among multiple historical memory access addresses indicated by memory access requests. The computing device determines hot pages in virtual memory pages based on memory blocks in the mapping table whose access frequencies meet preset conditions. Different memory blocks in the mapping table correspond to different virtual memory pages; the first memory access request is used to request a virtual memory page corresponding to the first memory access address. By establishing a mapping between at least one data location with the highest frequency of change in the memory access address and a group in the mapping table, the above approach effectively reduces intensive accesses to each group and balances the mapping relationship between memory access addresses and groups. In cases of intensive access, it ensures that pages with the same access frequency are not missed during hot page identification, improving the accuracy of hot page identification and thus increasing its efficiency.
[0064] Secondly, the system architecture of the embodiments of this application will be described by way of example.
[0065] Figure 3 A schematic diagram of a hardware interaction framework 100 provided in an embodiment of this application is shown. Figure 3 As shown, the hardware interaction framework 100 includes a central processing unit (CPU) 310 and a memory medium module 320.
[0066] The CPU 310 is the core component of the computing device, responsible for the operation and processing of application instructions and data. The CPU 310 includes at least one core and runs an operating system. The CPU 310 is used to obtain the access frequency of each memory block in the mapping table of the memory medium module 320; and to determine the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequencies meet preset conditions. The mapping table includes multiple groups, each group including multiple memory blocks, and each memory block indicates a physical memory region. The access frequency of the first memory block represents the number of times the first memory block is used to map the first memory access address to the physical memory region in response to a first memory access request within a preset time period. The first memory block is the memory block corresponding to the first memory access address determined according to a preset mapping relationship. The first memory access address is the memory address indicated by the first memory access request. The preset mapping relationship includes the mapping relationship between the data at the target location in the memory access address and the groups in the mapping table. The target location is at least one data location with the highest change frequency among the memory access addresses indicated by multiple historical memory access requests. Different memory blocks in the mapping table correspond to different virtual memory pages; the first memory access request is used to request the virtual memory page corresponding to the first memory access address. The operating system sends the access request to the memory medium module 320.
[0067] The memory media module 320 is a form of memory in a computing device and connects to the CPU 310 through a specific interface. The memory media module 320 includes multiple memory media, and its main function is to store applications and data for access by the CPU 310.
[0068] Figure 4 A schematic diagram of a data acquisition function feedback framework 200 provided in an embodiment of this application is shown. Figure 4 As shown, the data acquisition function feedback framework 200 is used to implement the memory access requests issued by the CPU 310 core to the operating system, and to collect the access frequency of each memory block by the CPU 310. The memory access request includes the memory address. The data acquisition function feedback framework 200 includes a CPU 310, a data acquisition module 410, and a memory 420.
[0069] The CPU 310 includes a CPU core, which issues memory access requests. The CPU 310 also retrieves the access frequency of each memory block in the mapping table and determines the hot pages in the virtual memory based on the memory blocks whose access frequencies meet preset conditions. The acquisition module 410 acquires the memory access addresses issued by the CPU core and the access frequencies of each memory block in the mapping table. The memory 420 stores the memory access addresses issued by the CPU core and the access frequencies of each memory block in the mapping table, and sends this information back to the CPU 310. Specifically, the memory 420 may be random access memory (RAM).
[0070] Optionally, the acquisition function feedback framework 200 also includes a compression module for compressing the memory access addresses and access frequencies stored in the memory 420 and sending them back to the CPU 310.
[0071] For example, the above-mentioned data acquisition function feedback framework 200 can have different hardware forms, such as on the memory medium module 320, inside the CPU 310, or on a separate hardware module.
[0072] in, Figure 5 This diagram illustrates the implementation of a data acquisition function feedback framework 200 provided in an embodiment of this application on a media module. For example... Figure 5 As shown, the acquisition module 410 and memory 420 in the acquisition function feedback framework 200 are located in the memory medium module 320. They can transmit the memory access address and access frequency of the mapping table to the CPU 310 in an out-of-band manner. The upper-level software in the CPU 310 can obtain the memory access address and access frequency of the mapping table, analyze the data, and determine the hot pages in the virtual memory pages.
[0073] Figure 6 This diagram illustrates the implementation of a data acquisition function feedback framework 200 provided in an embodiment of this application within the CPU. Figure 6 As shown, the acquisition module 410 and memory 420 in the acquisition function feedback framework 200 are located inside the CPU 310. The CPU core directly reads the memory 420 to obtain the memory access address and access frequency of the mapping table. The upper-level software in the CPU 310 can analyze the data to determine the hot pages in the virtual memory pages.
[0074] Figure 7 This diagram illustrates the implementation of a data acquisition function feedback framework 200 provided in an embodiment of this application on a separate hardware module. Figure 7As shown, the data acquisition and feedback framework 200 is located on a separate hardware module 710, which includes an acquisition module 410 and a memory 420. The hardware module 710 transmits the acquired memory access addresses and access frequencies of the mapping table back to the CPU 310 in an out-of-band manner; the upper-level software in the CPU 310 can analyze the data to determine the hot pages in the virtual memory pages.
[0075] for example, Figure 8 This diagram illustrates the hardware structure of a hot page recognition system 300 provided in an embodiment of this application. Figure 8 As shown, the hot page recognition system 300 includes a CPU 310, a counter 810, a variable counter 820, a memory medium 830, and a register 840.
[0076] The CPU 310 includes a CPU core used to send memory access requests to the memory medium 830. The CPU 310 is used to obtain the access frequency of each memory block in the mapping table, and determine the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets preset conditions.
[0077] Counter 810 is used to obtain the number of mapping conflicts in each group of the mapping table within a preset time period. The number of mapping conflicts in the first group is the number of times that the memory access address mapped to the first group using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group.
[0078] The change counter 820 includes a single-bit change counter or a multi-bit change counter, used to determine the address segment with the highest data change frequency among the memory addresses indicated by multiple historical memory access requests.
[0079] Register 840 is used to implement a parameter-configurable interleaving matrix for updating preset mapping relationships. Optionally, complex programmable logic devices (CPLDs) or field programmable gate arrays (FPGAs) can be used to implement parameter-configurable interleaving matrices for updating preset mapping relationships; this is only an example and not a limitation.
[0080] Specifically, CPU 310 can obtain the number of mapping conflicts occurring in each group of the mapping table within a preset time period from counter 810, thereby determining whether mapping conflicts exist in each group of the mapping table within the preset time period. If at least one group in the mapping table has a mapping conflict within the preset time period, CPU 310 can obtain the address segment with the highest data change frequency among the memory access addresses indicated by the memory access request within the preset time period from change counter 820, thereby determining the second address segment with the highest change frequency among multiple memory access addresses within the preset time period; based on the second address segment, CPU 310 updates the preset mapping relationship through configuration register 840. The updated preset mapping relationship includes the mapping relationship between the second address segment in the memory access address and the groups in the mapping table.
[0081] It should be noted that the system architecture and application scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0082] For ease of understanding, the hot page recognition method provided in this application is described below with reference to the accompanying drawings. This hot page recognition method is applicable to... Figure 3 The hardware interaction framework 100 shown is shown.
[0083] Figure 9 A flowchart illustrating the hotspot identification method provided in an embodiment of this application is shown. Figure 9 As shown, the hot page identification method may include the following steps:
[0084] S101, The computing device obtains the access frequency of each memory block in the mapping table.
[0085] The mapping table comprises multiple groups, each group containing multiple memory blocks. Each memory block indicates a physical memory region. The access frequency of the first memory block represents the number of times the first memory access address is mapped to a physical memory region in response to a first memory access request within a preset time period. The first memory block is the memory block corresponding to the first memory access address, determined according to a preset mapping relationship. The first memory access address is the memory address indicated by the first memory access request. The preset mapping relationship includes the mapping relationship between the first address segment in the memory access address and the groups in the mapping table. The first address segment includes the address segment with the highest data change frequency among multiple historical memory access request-indicated memory access addresses.
[0086] The hot page identification method provided in this application embodiment can be used not only for group-associative caches, but also for other storage structures or storage scenarios that do not require data consistency.
[0087] In one possible implementation, before determining the hot pages in the virtual memory pages based on memory blocks in the mapping table whose access frequency meets a preset condition, the method further includes: the computing device determining whether mapping conflicts exist in each group of the mapping table within a preset time period, wherein a mapping conflict in the first group includes the number of memory addresses mapped to the first group using a preset mapping relationship within the preset time period being greater than the number of memory blocks in the first group, and the first group being any group in the mapping table. If at least one group in the mapping table has a mapping conflict within the preset time period, the preset mapping relationship is updated; the target location in the updated preset mapping relationship is different from the target location in the original preset relationship.
[0088] For example, if mapping conflicts exist between groups in the mapping table within a preset time period, intensive access to memory addresses occurs. That is, a large number of memory addresses hit the same group in the mapping table through the mapping relationship. Since the number of memory blocks contained in a group is fixed, if hot page identification is performed at this time, memory addresses exceeding the number of memory blocks contained in a group will be missed, resulting in memory blocks with the same access frequency being missed, leading to low accuracy in hot page identification. Therefore, if at least one group in the mapping table has a mapping conflict within the preset time period, the preset mapping relationship is updated; the target position in the updated preset mapping relationship is different from the target position in the original preset relationship.
[0089] for example, Figure 10 This illustration shows a mapping conflict scenario provided by an embodiment of this application. Figure 10 As shown, the mapping table includes groups 0 and 1, and both groups 0 and 1 contain 4 memory blocks. If the preset mapping relationship includes the mapping between the lower 1 bit of the memory access address and the groups in the mapping table, where the lower 1 bit represents the last bit of the memory access address, and the memory access address is a 4-bit address (0001, 0011, 0101, 0111, 1001, and 1011), then memory access addresses 0001, 0011, 0101, 0111, 1001, and 1011 will all be mapped to group 1, and no memory access address will be mapped to group 0, resulting in a mapping conflict. Therefore, updating the preset mapping relationship can resolve the situation where a large number of memory access addresses are mapped to the same group. The address segments in the updated preset mapping relationship are different from those in the original preset relationship.
[0090] In one possible implementation, the computing device obtains the number of mapping conflicts occurring in each group of the mapping table within a preset time period. If the number of mapping conflicts occurring in the first group exceeds a first threshold, the computing device determines that there is a mapping conflict in the first group.
[0091] The number of mapping conflicts in the first group is the number of times the memory access address mapped to the first group using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group.
[0092] For example, the computing device can determine whether there are mapping conflicts in each group of the mapping table within the preset time period based on the number of mapping conflicts that occur in each group within the preset time period. If the number of mapping conflicts in the first group is greater than a first threshold, the computing device determines that there are mapping conflicts in the first group, thereby determining that there are mapping conflicts in each group of the mapping table within the preset time period.
[0093] For example, the mapping table includes groups 0 and 1, and both groups 0 and 1 contain 4 memory blocks. If the preset mapping relationship includes the mapping between the lower 1 bit of the memory access address and the groups in the mapping table, and memory access addresses 0001, 0011, 0101, and 0111 all hit the 4 memory blocks in group 1, it means that all 4 memory blocks have been accessed. In this case, the memory access address in the memory access request includes 1001, which is also mapped to group 1. However, the records of accessed memory blocks in group 1 do not include 1001, so it can be determined that the number of mapping conflicts in group 1 is 1. If the number of mapping conflicts in group 1 is greater than 1, the computing device determines that there is a mapping conflict in group 1.
[0094] In one possible implementation, if the sum of the number of mapping conflicts in each group of the mapping table exceeds a second threshold, the computing device updates the preset mapping relationship.
[0095] For example, the computing device obtains the number of mapping conflicts that occur in each group of the mapping table within a preset time period, and determines the sum of the number of mapping conflicts for each group. If the sum of the number of mapping conflicts for each group in the mapping table is greater than a second threshold, the computing device updates the preset mapping relationship. The second threshold can be an empirical value.
[0096] For example, if the second threshold is 10, and the mapping table includes 4 groups, each with 4 memory blocks, then according to the method for obtaining mapping conflicts described above, the number of mapping conflicts in the first group is 6, the number of mapping conflicts in the second group is 4, the number of mapping conflicts in the third group is 2, and the number of mapping conflicts in the fourth group is 0. Therefore, the sum of the number of mapping conflicts in each group in the mapping table is 12. At this point, the sum of the number of mapping conflicts in each group in the mapping table is greater than the second threshold, and the computing device updates the preset mapping relationship.
[0097] Optionally, if the proportion of groups with mapping conflicts in the mapping table exceeds a third threshold within a preset time period, the computing device updates the preset mapping relationship.
[0098] The percentage of groups with mapping conflicts is the ratio of the number of groups with mapping conflicts to the total number of groups in the mapping table.
[0099] In one possible implementation, the computing device determines the second address segment with the highest change frequency among multiple memory access addresses within a preset time period; the computing device updates the preset mapping relationship based on the second address segment.
[0100] The updated preset mapping relationship includes the mapping relationship between the second address segment in the memory access address and the group in the mapping table.
[0101] For example, the computing device obtains multiple memory access addresses within a preset time period and determines the second address segment with the highest change frequency among the multiple memory access addresses. Based on the second address segment, the preset mapping relationship is updated so that the second address segment is mapped one-to-one with each group in the mapping table.
[0102] for example, Figure 11 This illustration shows a schematic diagram of an embodiment of the present application for updating a preset mapping relationship. For example... Figure 11 As shown, the mapping table includes group 0 and group 1, and the memory access address is 4 bits. In the case of the mapping relationship between the first address segment with the highest data change frequency among multiple historical memory access request indications and the groups in the mapping table (that is, the mapping relationship between the lower 1 bit of the memory access address and the groups in the mapping table), as shown in the figure, the memory access addresses within the preset time period include 1011, 0011, 0111, 0101, 1101, and 0001. Before updating the preset mapping relationship, all of them are matched to group 1 according to the mapping relationship.
[0103] Because a mapping conflict occurs at this time, the computing device obtains the memory access addresses 1011, 0011, 0111, 0101, 1101, and 0001 within a preset time period and determines the second address segment with the highest change frequency among the memory access addresses. Here, the change frequency in the memory access addresses represents the number of times the same bit in the address segment changes. From the memory access addresses within the preset time period, it can be seen that the address corresponding to the lower 1 bit changes from 1 to 0 0 times, the address corresponding to the lower 2 bits changes from 1 to 0 3 times, the address corresponding to the higher 1 bit changes from 1 to 0 4 times, and the address corresponding to the higher 2 bits changes from 1 to 0 3 times. Therefore, the computing device can determine that the second address segment is the higher 1 bit, and the updated preset mapping relationship includes the mapping relationship between the higher 1 bit of the memory access address and each group in the mapping table. As shown in the figure, memory addresses 1011 and 1101 are mapped to group 1 according to the updated preset mapping relationship; memory addresses 0011, 0111, 0101 and 0001 are mapped to group 0 according to the updated preset mapping relationship.
[0104] As shown above, by identifying the address range with the highest change frequency among multiple memory access addresses within a preset time period and updating the preset mapping relationship, the problem of mapping conflicts under intensive access conditions can be solved, thereby avoiding the omission of memory access addresses with the same access frequency and improving the accuracy of hot page identification.
[0105] In one possible implementation, the computing device obtains a first set of mappings; the computing device updates the preset mapping relationship based on the first set of mappings.
[0106] The first mapping set includes multiple candidate mapping relationships; the updated preset mapping relationship is one of the multiple candidate mapping relationships.
[0107] For example, before obtaining the access frequency of each memory block in the mapping table, the application is pre-run to assess its performance and determine a first mapping set. The computing device runs the application and identifies user access patterns. These access patterns include memory access addresses and access frequencies. Based on the user access patterns, the computing device determines the first mapping set, which includes multiple candidate mapping relationships. The computing device then updates the preset mapping relationships based on the first mapping set.
[0108] For example, based on user access patterns to the application, a first mapping set is determined to include a first candidate mapping relationship, a second candidate mapping relationship, and a third candidate mapping relationship. If at least one group in the mapping table has a mapping conflict within a preset time period, the computing device updates the preset mapping relationship based on the first mapping set. The updated preset mapping relationship can be the second candidate mapping relationship.
[0109] As can be seen from the above method, updating the preset mapping relationship based on the first mapping set can improve the efficiency of updating the preset mapping relationship, thereby improving the efficiency of hot page recognition.
[0110] S102, the computing device determines the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets the preset conditions.
[0111] In the mapping table, different memory blocks correspond to different virtual memory pages; the first memory access request is used to request the virtual memory page corresponding to the first memory access address.
[0112] In one possible implementation, if there are no mapping conflicts in any group of the mapping table within a preset time period, the computing device determines the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets the preset conditions.
[0113] For example, the computing device obtains the access frequency of each memory block in the mapping table, and determines the memory block whose access frequency meets the preset conditions as a hot page.
[0114] For example, a computing device uses a sliding window algorithm to filter pages in a mapping table whose access frequency exceeds a specified threshold and designates them as hot pages. For instance, the mapping table includes group 0 and group 1, each containing four memory blocks. The memory blocks in group 0 are accessed 8, 6, 10, and 0 times respectively; the memory blocks in group 1 are accessed 7, 3, 12, and 0 times respectively. Using a sliding window with a granularity of 7, and employing a replacement algorithm, the access frequencies of the memory blocks in groups 0 and 1 can be sorted to obtain 12, 10, 8, 7, 6, 3, 0, and 0 times. Therefore, the memory blocks corresponding to access frequencies of 12, 10, 8, and 7 times can be identified as hot pages in the virtual memory.
[0115] In one possible implementation, if the sum of the number of mapping conflicts in each group of the mapping table is less than or equal to a second threshold, the computing device determines the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets preset conditions.
[0116] The number of mapping conflicts in the first group is the number of times the memory access address mapped to the first group using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group.
[0117] In other words, after updating the preset mapping relationship, the sum of the number of mapping conflicts in each group of the mapping table is obtained again. If the sum of the number of mapping conflicts in each group of the mapping table is greater than the second threshold, it means that the currently updated preset mapping relationship will cause a large number of hot pages to be missed, and the preset mapping relationship needs to be updated again until the sum of the number of mapping conflicts in each group of the mapping table is less than or equal to the second threshold. At this time, the computing device can obtain the access frequency of each memory block in the mapping table, and determine the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets the preset conditions.
[0118] As shown above, by judging the relationship between the sum of the number of mapping conflicts in each group of the mapping table and the second threshold, when the sum of the number of mapping conflicts in each group of the mapping table is less than or equal to the second threshold, the hot pages in the virtual memory pages can be determined based on the memory blocks in the mapping table whose access frequency meets the preset conditions. This can improve the accuracy of hot page identification and thus improve the efficiency of hot page identification.
[0119] The above describes the hot page recognition method from the perspective of the method's process. The following section will introduce it from the perspective of a complete and specific implementation method.
[0120] Taking the sliding window thermal identification method for hot page identification as an example, Figure 12 A logical schematic diagram of a hotspot identification method provided in an embodiment of this application is shown. For example... Figure 12As shown, before the hot page identification process begins, the application is pre-run and tested to determine the first mapping set. Specifically, the computing device runs the application and identifies user access to the application. Access information includes memory access addresses and access frequency. Based on user access to the application, the computing device determines the first mapping set, which includes a first candidate mapping relationship, a second candidate mapping relationship, and a third candidate mapping relationship. Then, the configuration process begins. This configuration process includes configuring the granularity of the sliding window statistics page and configuring a second threshold. The computing device acquires multiple memory access addresses within a preset time period (S201) and collects the memory access addresses and access frequencies. The computing device acquires the number of mapping conflicts in each group of the mapping table (S202). Specifically, a conflict counter is set in each group of the mapping table to acquire the number of mapping conflicts. Optionally, the computing device can collect the number of mapping conflicts in each group and the memory access addresses within the preset time period through the CPU. This can be done using interrupt-enabled or polling methods, enabling the CPU to collect the number of mapping conflicts in each group and the memory access addresses within the preset time period; the specific enabling method is not limited.
[0121] for example, Figure 13 This illustration shows a schematic diagram of a mapping and acquisition process for a mapping table provided in an embodiment of this application. For example... Figure 13 As shown, the mapping table includes set0, set1, and set2, with each set containing four memory blocks. The counting file includes counters and conflict counters, typically maintained by RAM. Each memory block corresponds to a counter, recording the frequency of its access. Each set also has its own conflict counter, recording the number of mapping conflicts that occur within that set. If the first memory access address can hit memory block 2 in set1 according to the mapping relationship, counter 6 for memory block 2 is incremented by 1, recording the frequency of memory block 2's access. If the first memory access address can hit set1 according to the mapping relationship, but the first memory access address cannot match the memory access addresses recorded in any of the memory blocks in set1, a mapping conflict occurs, and the conflict counter 1 for set1 is incremented by 1, recording the number of mapping conflicts that occur in set1.
[0122] The computing device determines whether the sum of the number of mapping conflicts in each group of the mapping table is greater than a second threshold (S203). If the sum of the number of mapping conflicts in each group of the mapping table is greater than the second threshold, it determines whether all candidate mapping relationships in the first mapping set have been called (S204). If not all candidate mapping relationships in the first mapping set have been called, the computing device calls the uncalled candidate mapping relationships in the first mapping set (S205) and updates the preset mapping relationship (S207). Specifically, when a second candidate mapping relationship in the first mapping set is called, the number of mapping conflicts in each group of the mapping table under the second candidate mapping relationship is obtained, and it is determined whether the sum of the number of mapping conflicts in each group of the mapping table is greater than the second threshold (S203). If the sum of the number of mapping conflicts in each group of the mapping table under the second candidate mapping relationship is greater than the second threshold, it determines whether all candidate mapping relationships in the first mapping set have been called (S204). If all candidate mappings in the first mapping set have been invoked, the computing device determines the second address segment with the highest change frequency among multiple memory access addresses within a preset time period (S206). Based on the second address segment, the preset mapping relationship is updated (S207). At this point, if the preset mapping relationship includes the second address segment, it is determined whether the sum of the number of mapping conflicts in each group of the mapping table is greater than a second threshold (S203). If the sum of the number of mapping conflicts in each group of the mapping table is not greater than the second threshold, the computing device determines the hot page of the virtual memory (S208). Specifically, the computing device determines the hot page in the virtual memory page based on the memory blocks in the mapping table whose access frequency meets preset conditions. For example, the computing device obtains... Figure 13 The counting file in the database uses the frequency of access to each memory page recorded by the counters in the counting file, as well as the granularity of the sliding window page statistics, to identify the memory blocks in the mapping table whose access frequency meets the granularity of the sliding window page statistics as hot pages in the virtual memory pages.
[0123] Optional, Figure 14 A schematic diagram of a migration process provided in an embodiment of this application is shown. Figure 14As shown, the computing device obtains the access frequency of each memory block in the mapping table (S301) and determines the hot pages in the virtual memory pages (S302). Specifically, the virtual memory pages corresponding to memory blocks in the mapping table that meet preset conditions are determined as hot pages. For example, the mapping table includes group 0 and group 1, each group including 4 memory blocks. According to the above method, the virtual memory pages corresponding to memory blocks 2 and 3 in group 0, and memory blocks 1 and 2 in group 1, can be determined as hot pages. The computing device migrates the hot pages in the virtual memory pages (S303). For example, the data in the virtual memory pages corresponding to memory blocks 2 and 3 in group 0, and memory blocks 1 and 2 in group 1 are copied to new pages, and the mapping table relationship is updated. Among them, the performance of the memory medium indicated by the new page is better than that of the memory medium indicated by group 0 and group 1.
[0124] for example, Figure 15 A schematic diagram of a hot page migration provided in an embodiment of this application is shown. Figure 15 As shown, the primary storage medium is the highest-performing storage medium; the secondary storage medium is the next highest-performing storage medium; and the tertiary storage medium is the lowest-performing storage medium. The CPU 310 can use the aforementioned hot-page identification method to determine the hot pages of virtual memory in the secondary and tertiary storage media, and migrate these hot pages to the next higher-level storage medium. That is, the corresponding hot pages of virtual memory in the secondary storage medium are migrated to the primary storage medium; and the corresponding hot pages of virtual memory in the tertiary storage medium are migrated to the secondary storage medium. This achieves hierarchical memory storage, thereby improving memory utilization.
[0125] In summary, this application provides a hot page identification method applied to a computing device to improve hot page identification efficiency. The method includes: the computing device obtaining the access frequency of each memory block in a mapping table; and determining hot pages in virtual memory pages based on memory blocks in the mapping table whose access frequencies meet preset conditions. The mapping table includes multiple groups, each group including multiple memory blocks, with each memory block indicating a physical memory region. The access frequency of a first memory block represents the number of times a first memory access address is mapped to a physical memory region in response to a first memory access request within a preset time period. The first memory block is the memory block corresponding to the first memory access address, determined according to a preset mapping relationship. The first memory access address is the memory address indicated by the first memory access request. The preset mapping relationship includes the mapping relationship between a first address segment in the memory access address and a group in the mapping table. The first address segment includes the address segment with the highest data change frequency among multiple historical memory access request-indicated memory addresses, and different memory blocks in the mapping table correspond to different virtual memory pages. The first memory access request is used to request the virtual memory page corresponding to the first memory access address. By establishing a mapping between at least one data location with the highest frequency of change in the memory access address and a group in the mapping table, the above method can effectively reduce intensive access to each group in the mapping table, dilute the mapping relationship between the memory access address and the group, and ensure that virtual memory pages with the same access frequency are not missed under intensive access conditions. This can improve the accuracy of hot page identification and further improve the efficiency of hot page identification.
[0126] The foregoing mainly describes the solutions of the embodiments of this application from a methodological perspective. It is understood that, in order to achieve the above functions, the hotspot recognition device includes at least one of the hardware structures and software modules corresponding to each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.
[0127] This application embodiment can divide the hot page recognition device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0128] For example, Figure 16 A schematic diagram of a hotspot identification device provided in an embodiment of this application is shown. Figure 16 As shown, the hot page recognition device can be applied in a computing device, and the hot page recognition device 400 includes:
[0129] The acquisition module 401 is used to acquire the access frequency corresponding to each memory block in the mapping table. The mapping table includes multiple groups, each group includes multiple memory blocks, and each memory block indicates a physical memory region. The access frequency corresponding to the first memory block represents the number of times the first memory block is used to map the first memory access address to a physical memory region in response to a first memory access request within a preset time period. The first memory block is the memory block corresponding to the first memory access address, determined according to a preset mapping relationship. The first memory access address is the memory address indicated by the first memory access request. The preset mapping relationship includes the mapping relationship between the first address segment in the memory access address and the groups in the mapping table. The first address segment includes the address segment with the highest data change frequency among multiple historical memory access request-indicated memory access addresses.
[0130] The identification module 402 is used to determine the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets the preset conditions; different memory blocks in the mapping table correspond to different virtual memory pages; the first memory access request is used to request the virtual memory page corresponding to the first memory access address.
[0131] In one possible implementation, the acquisition module 401 is further configured to acquire the number of mapping conflicts occurring in each group of the mapping table within a preset time period; wherein, the number of mapping conflicts occurring in the first group is the number of times the memory access address mapped to the first group using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group.
[0132] In one possible implementation, the acquisition module 401 is further configured to acquire a first mapping set; the first mapping set includes multiple candidate mapping relationships.
[0133] In one possible implementation, the identification module 402 is further configured to determine the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets the preset conditions, provided that there are no mapping conflicts in each group of the mapping table within a preset time period.
[0134] In one possible implementation, the identification module 402 is further configured to determine the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets the preset conditions when the sum of the number of mapping conflicts in each group of the mapping table is less than or equal to the second threshold; wherein, the number of mapping conflicts in the first group is the number of times the memory access address mapped to the first group using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group.
[0135] In one possible implementation, the hot page identification device further includes a processing module for determining whether there are mapping conflicts in each group of the mapping table within a preset time period. The first group having a mapping conflict includes the following: the number of memory addresses mapped to the first group using the preset mapping relationship within the preset time period is greater than the number of memory blocks in the first group. The first group can be any group in the mapping table. If at least one group in the mapping table has a mapping conflict within the preset time period, the preset mapping relationship is updated. The address segments in the updated preset mapping relationship are different from the address segments in the original preset relationship.
[0136] In one possible implementation, the processing module is also used to determine that there is a mapping conflict in the first group if the number of mapping conflicts in the first group is greater than a first threshold.
[0137] In one possible implementation, the processing module is also used to update the preset mapping relationship if the sum of the number of mapping conflicts in each group of the mapping table is greater than a second threshold.
[0138] In one possible implementation, the processing module is further configured to determine the second address segment with the highest change frequency among multiple memory access addresses within a preset time period; and update the preset mapping relationship based on the second address segment, wherein the updated preset mapping relationship includes the mapping relationship between the second address segment in the memory access address and the group in the mapping table.
[0139] In one possible implementation, the processing module is further configured to update a preset mapping relationship based on a first mapping set; wherein the updated preset mapping relationship is one of a plurality of candidate mapping relationships.
[0140] Figure 17 A schematic diagram of a computing device according to an embodiment of this application is shown. Figure 17 As shown, the computing device 800 includes a bus 801, a processor 802, a memory 803, and a communication interface 804. The processor 802, the memory 803, and the communication interface 804 communicate with each other via the bus 801. The computing device 800 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 800.
[0141] The 801 bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 17The bus 801 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 801 may include a path for transmitting information between various components of the computing device 800 (e.g., processor 802, memory 803, communication interface 804).
[0142] Processor 802 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0143] The memory 803 may include volatile memory, such as random access memory (RAM). The processor 802 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0144] The memory 803 stores executable program code, and the processor 802 executes this executable program code to implement the functions of the acquisition module and the identification module, thereby realizing the hot page identification method. In other words, the memory 803 stores instructions for executing the hot page identification method.
[0145] Alternatively, the memory 803 stores executable code, which the processor 802 executes to implement the functions of the aforementioned hot page identification device, thereby implementing the hot page identification method. That is, the memory 803 stores instructions for executing the hot page identification method.
[0146] The communication interface 804 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between the computing device 800 and other devices or communication networks.
[0147] As an example, combined Figure 17 The functions of the acquisition module 401 and the identification module 402 of the hot page recognition device 400 can be achieved through... Figure 17 The computing devices in the process are implemented.
[0148] This application also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform... Figures 9-15 The operation of any corresponding implementation scheme and its various feasible implementation methods.
[0149] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform... Figures 9-15 The operation of any corresponding implementation scheme and its various feasible implementation methods.
[0150] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0151] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0152] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions, which, when loaded and executed on a computer, generate all or part of the processes or functions described in the embodiments of this application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one network site, computer, server, or data center to another network site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access, or it can be a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape, etc.), an optical medium (e.g., DVD, etc.), or a semiconductor medium (e.g., solid-state drive), etc.
[0153] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0154] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A hot page identification method, characterized in that, Applied to a computing device, the method includes: The access frequency of each memory block in the mapping table is obtained; wherein, the mapping table includes multiple groups, each group includes multiple memory blocks, and each memory block is used to indicate a physical memory region; the access frequency of the first memory block represents the number of times the first memory access address is mapped to a physical memory region in response to a first memory access request within a preset time period; the first memory block is the memory block corresponding to the first memory access address determined according to a preset mapping relationship; the first memory access address is the memory address indicated by the first memory access request; the preset mapping relationship includes the mapping relationship between the first address segment in the memory access address and the group in the mapping table; the first address segment includes the address segment with the highest data change frequency among the memory access addresses indicated by multiple historical memory access requests, and the data change frequency represents the number of times the same bit in the address segment changes; Based on the memory blocks in the mapping table whose access frequency meets the preset conditions, hot pages in the virtual memory pages are determined; different memory blocks in the mapping table correspond to different virtual memory pages; the first memory access request is used to request the virtual memory page corresponding to the first memory access address.
2. The method according to claim 1, characterized in that, Before determining the hot pages in the virtual memory pages based on the memory blocks whose access frequency meets preset conditions in the mapping table, the method further includes: Determine whether there is a mapping conflict in each group of the mapping table within the preset time period. The first group having a mapping conflict includes the number of memory access addresses mapped to the first group using the preset mapping relationship within the preset time period being greater than the number of memory blocks in the first group. The first group is any group in the mapping table. If at least one group in the mapping table has a mapping conflict within the preset time period, the preset mapping relationship is updated; the address segments in the updated preset mapping relationship are different from the address segments in the original preset relationship.
3. The method according to claim 2, characterized in that, Determining whether there are mapping conflicts in each group of the mapping table within the preset time period includes: Obtain the number of times the mapping conflict occurs in each group of the mapping table within the preset time period; wherein, the number of times the mapping conflict occurs in the first group is the number of times the memory access address mapped to the first group using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group; If the number of times the mapping conflict occurs in the first group is greater than a first threshold, it is determined that there is a mapping conflict in the first group.
4. The method according to claim 3, characterized in that, If at least one group in the mapping table has a mapping conflict within the preset time period, update the preset mapping relationship, including: If the sum of the number of mapping conflicts occurring in each group of the mapping table is greater than a second threshold, the preset mapping relationship is updated.
5. The method according to any one of claims 2-4, characterized in that, Updating the preset mapping relationship includes: Determine the second address segment with the highest data change frequency among multiple memory access addresses within the preset time period, where the data change frequency represents the number of times the same bit in the address segment changes. Based on the second address segment, the preset mapping relationship is updated. The updated preset mapping relationship includes the mapping relationship between the second address segment in the memory access address and the group in the mapping table.
6. The method according to any one of claims 2-4, characterized in that, Updating the preset mapping relationship includes: Obtain a first mapping set; the first mapping set includes multiple candidate mapping relationships; Update the preset mapping relationship according to the first mapping set; The updated preset mapping relationship is one of the multiple candidate mapping relationships.
7. The method according to any one of claims 2-4, characterized in that, The method further includes: If there are no mapping conflicts in any group of the mapping table within the preset time period, the hot pages in the virtual memory pages are determined according to the memory blocks in the mapping table whose access frequency meets the preset conditions.
8. The method according to claim 7, characterized in that, If no mapping conflict exists in any group of the mapping table within the preset time period, the hot pages in the virtual memory page are determined based on the memory blocks in the mapping table whose access frequency meets preset conditions, including: If the sum of the number of mapping conflicts occurring in each group of the mapping table is less than or equal to a second threshold, hot pages in the virtual memory page are determined according to the memory blocks in the mapping table whose access frequency meets the preset conditions; wherein, the number of mapping conflicts occurring in the first group is the number of times the memory access address mapped to the first group using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group.
9. A hot page identification device, characterized in that, The device includes: The acquisition module is used to acquire the access frequency corresponding to each memory block in the mapping table; wherein, the mapping table includes multiple groups, each group includes multiple memory blocks, and each memory block is used to indicate a physical memory region; the access frequency corresponding to the first memory block represents the number of times the first memory access address is mapped to a physical memory region in response to a first memory access request within a preset time period; the first memory block is the memory block corresponding to the first memory access address determined according to a preset mapping relationship; the first memory access address is the memory address indicated by the first memory access request; the preset mapping relationship includes the mapping relationship between the first address segment in the memory access address and the group in the mapping table; the first address segment includes the address segment with the highest data change frequency among the memory access addresses indicated by multiple historical memory access requests, and the data change frequency represents the number of times the same bit in the address segment changes; The identification module is used to determine the hot pages in the virtual memory pages based on the memory blocks in the mapping table whose access frequency meets preset conditions; different memory blocks in the mapping table correspond to different virtual memory pages; the first memory access request is used to request the virtual memory page corresponding to the first memory access address.
10. A computing device, characterized in that, The computing device includes: a processor and a memory for storing instructions executable by the processor; The processor is configured to execute the instructions, causing the computing device to perform the hot page identification method as described in any one of claims 1-8.
11. A computer program product, characterized in that, The computer program product includes instructions that, when executed by a computing device, cause the computing device to perform the hot page identification method as described in any one of claims 1-8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer program instructions that, when executed by a computing device, enable the computing device to perform the hot page identification method as described in any one of claims 1-8.
Citation Information
Patent Citations
Address control circuit for read-only memory
JP1987154398A
System for address mapping and translation protection
US20170249260A1
