Hot page identification method and related equipment
By identifying the address range with the highest data change frequency in the mapping table and updating the mapping relationship, the problem of missing hot pages in the hot page identification method is solved, improving the accuracy and efficiency of hot page identification and increasing memory utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, hot page identification methods are prone to missing hot pages under intensive access conditions, which reduces the accuracy and efficiency of 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 range with the highest data change frequency in multiple historical memory access requests is identified, and the mapping relationship is updated during intensive access to avoid mapping conflicts and ensure the accuracy of hot page identification.
It improves the accuracy and efficiency of hot page identification, avoids missing hot pages, and enhances memory utilization and resource management flexibility.
Smart Images

Figure CN121636366A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of computer, and particularly relate to a hot page identification method and related equipment. BACKGROUND
[0002] With the derivation of various cloud scenarios and data center services, the capacity and bandwidth requirements of memory are increasingly high. However, not all application programs will frequently read the memory during application program running, and most of the memory only occupies space and will not be frequently accessed. At the beginning of server configuration, the memory is usually configured according to the maximum capacity of the service scenario, but the server will only run in the peak scenario for a small part of the time, which results in low memory utilization.
[0003] Therefore, the concept of memory hierarchical storage is proposed. In the memory hierarchical storage, the data frequently accessed by the central processing unit (CPU) is stored on the storage medium closer to the CPU side, and this part of the storage medium has high speed and low delay, but is expensive. The data not frequently accessed by the CPU is stored on the storage medium far away from the CPU side, and this part of the storage medium has low cost, but poor performance parameters such as bandwidth and time delay. As known from the above, the key technical point is to store the data in different storage media according to the frequency of data access. In the related technology, the virtual memory page can be used as a unit to identify and migrate cold and hot pages, and to realize memory hierarchical storage.
[0004] However, the above method may occur intensive access, and due to the significant increase in the number of hot page data, it will cause hot page missing, reduce the accuracy of hot page identification, and thus reduce the efficiency of hot page identification. SUMMARY
[0005] Embodiments of the present application provide a hot page identification method and related equipment, which can improve the accuracy of hot page identification, and thus improve the efficiency of hot page identification.
[0006] In a first aspect, a hot page identification method is provided, which is applied to a computing device and includes: obtaining a frequency of access corresponding to each memory block in a mapping table; the mapping table includes a plurality of groups, each group includes a plurality of memory blocks, and each memory block is used to indicate a physical memory region; the frequency of access corresponding to a first memory block represents a number of times that the first memory block is used to map a 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 a memory block corresponding to the first memory access address and determined according to a preset mapping relationship; the first memory access address is a memory address indicated by the first memory access request; the preset mapping relationship includes a mapping relationship between a first address segment in the memory access address and a group in the mapping table; the first address segment includes an address segment with the highest data change frequency in memory access addresses indicated by a plurality of historical memory access requests; a hot page in a virtual memory page is determined according to a memory block in the mapping table whose frequency of access meets a preset condition; different memory blocks in the mapping table correspond to different virtual memory pages; and the first memory access request is used to apply for a virtual memory page corresponding to the first memory access address.
[0007] As can be seen from the above, the mapping relationship between the memory access address and each group in the mapping table is established by using the address segment with the highest data change frequency in the memory access addresses indicated by a plurality of historical memory access requests, which can balance the mapping relationship between the memory access address and each group in the mapping table, avoid dense access of any group in the mapping table, and prevent the memory access address with the same frequency from being recorded, thereby avoiding hot page omission, improving the accuracy of hot page identification, and further improving the efficiency of hot page identification.
[0008] In a possible implementation, before the hot page in the virtual memory page is determined according to the memory block in the mapping table whose frequency of access meets the preset condition, the method further includes: determining whether there is a mapping conflict in each group in the mapping table within the preset time period, wherein the first group has a mapping conflict includes that the number of memory access addresses mapped to the first group by using the preset mapping relationship within the preset time period is greater than the number of memory blocks in the first group, and the first group is any group in the mapping table; updating the preset mapping relationship in the case that at least one group in the mapping table has a mapping conflict within the preset time period; and the address segment in the updated preset mapping relationship is different from the address segment in the preset relationship before the update.
[0009] As can be seen from the above, before the hot page in the virtual memory page is determined according to the memory block in the mapping table whose frequency of access meets the preset condition, whether the preset mapping relationship at the current time can avoid hot page omission can be determined by judging whether there is a mapping conflict in each group in the mapping table within the preset time period. If there is a mapping conflict in each group in the mapping table within the preset time period, the preset mapping relationship is updated, which can further improve the accuracy of hot page identification.
[0010] In a possible implementation, the number of times of mapping conflicts of each group in the mapping table in a preset time period is obtained; the number of times of mapping conflicts of the first group is the number of times that a memory access address mapped to the first group by using the preset mapping relationship does not match a physical memory region indicated by a memory block in the first group; and in a case where the number of times of mapping conflicts of the first group is greater than a first threshold, it is determined that the first group has mapping conflicts.
[0011] As can be seen, by judging whether the number of times of mapping conflicts of each group in the mapping table in a preset time period is greater than a first threshold, it can be determined whether each group in the mapping table has intensive access, which provides a more accurate basis for updating the preset mapping relationship, thereby improving the efficiency of hot page identification.
[0012] In a possible implementation, in a case where the sum of the number of times of mapping conflicts of each group in the mapping table is greater than a second threshold, the preset mapping relationship is updated.
[0013] As can be seen, by judging whether the sum of the number of times of mapping conflicts of each group in the mapping table is greater than a second threshold, it is determined whether to update the preset mapping relationship. In a case where the sum of the number of times of mapping conflicts of each group in the mapping table is greater than the second threshold, the preset mapping relationship is updated. The implementability and flexibility of the hot page identification method are improved.
[0014] In a possible implementation, a second address segment with the highest frequency of changes in a plurality of memory access addresses in a preset time period is determined; and the preset mapping relationship is updated according to the second address segment, and the updated preset mapping relationship includes a mapping relationship between the second address segment in the memory access address and a group in the mapping table.
[0015] As can be seen, by determining a second address segment with the highest frequency of changes in a plurality of memory access addresses in a preset time period and updating the preset relationship according to the second address segment, the mapping relationship between the memory access address and each group in the mapping table in the preset time period can be balanced, intensive access to an arbitrary group can be avoided, and hot page selection can be improved, thereby improving the accuracy of hot page identification.
[0016] In a possible implementation, a first mapping set is obtained; the first mapping set includes a plurality of candidate mapping relationships; the preset mapping relationship is updated according to the first mapping set; and the updated preset mapping relationship is one of the plurality of candidate mapping relationships.
[0017] As can be seen, before the frequency of access of each memory block in the mapping table is obtained, the first mapping set is obtained, the preset mapping relationship is updated by using the first mapping set, and the second address segment does not need to be determined, thereby improving the efficiency of updating the preset relationship.
[0018] In a possible implementation, in a case where no mapping conflict exists in each group in the mapping table within the preset time period, the hot page in the virtual memory page is determined according to the memory block in the mapping table whose access frequency satisfies a preset condition.
[0019] As can be seen, in a case where no mapping conflict exists in each group in the mapping table within the preset time period, the hot page in the virtual memory page is determined through the memory block in the mapping table whose access frequency satisfies a preset condition, which can avoid hot page omission and improve the efficiency of hot page identification.
[0020] In a possible implementation, in a case where the sum of the number of mapping conflicts in each group in the mapping table is less than or equal to a second threshold, the hot page in the virtual memory page is determined according to the memory block in the mapping table whose access frequency satisfies a preset condition; wherein the number of mapping conflicts in the first group is the number of times that the memory address mapped to the first group by 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, in a case where the sum of the number of mapping conflicts in each group in the mapping table is less than or equal to a second threshold, the hot page in the virtual memory page is determined through the memory block in the mapping table whose access frequency satisfies a preset condition, which can improve the realizability and flexibility of the hot page identification method.
[0022] In a second aspect, a hot page identification apparatus is provided. The embodiments of the present application can divide the function modules of the hot page identification apparatus according to the method provided in the first aspect. The apparatus includes: an acquisition module configured to acquire the access frequency corresponding to each memory block in a mapping table; wherein the mapping table includes a plurality of groups, each group includes a plurality of memory blocks, and one memory block is used to indicate one physical memory region; the access frequency corresponding to a first memory block indicates the number of times that the first memory block is used to map a first memory address 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 the first memory address and determined according to a preset mapping relationship; the first memory address is a 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 address and a group in the mapping table; the first address segment includes an address segment with the highest data change frequency in the memory address indicated by a plurality of historical memory access requests;
[0023] a recognition module configured to determine the hot page in a virtual memory page according to the memory block in the mapping table whose access frequency satisfies a preset condition; different memory blocks in the mapping table correspond to different virtual memory pages; and the first memory access request is used to apply for the virtual memory page corresponding to the first memory address.
[0024] In a possible implementation, the obtaining module is further configured to obtain a number of times of mapping conflicts of each group in the mapping table within a preset time period; and the number of times of mapping conflicts of the first group is a number of times that a memory access address mapped to the first group by using the preset mapping relationship does not match a physical memory region indicated by a memory block in the first group.
[0025] In a possible implementation, the obtaining module is further configured to obtain a first mapping set; and the first mapping set includes a plurality of candidate mapping relationships.
[0026] In a possible implementation, the identifying module is further configured to, in a case where there is no mapping conflict of each group in the mapping table within a preset time period, determine a hot page in the virtual memory page according to a memory block in the mapping table that has a frequency of access satisfying a preset condition.
[0027] In a possible implementation, the identifying module is further configured to, in a case where a sum of the number of times of mapping conflicts of each group in the mapping table is less than or equal to a second threshold value, determine a hot page in the virtual memory page according to a memory block in the mapping table that has a frequency of access satisfying a preset condition; and the number of times of mapping conflicts of the first group is a number of times that a memory access address mapped to the first group by using the preset mapping relationship does not match a physical memory region indicated by a memory block in the first group.
[0028] In a possible implementation, the hot page identifying apparatus further includes a processing module configured to determine whether there is a mapping conflict of each group in the mapping table within a preset time period, wherein the first group has a mapping conflict includes that a number of memory access addresses mapped to the first group by using the preset mapping relationship within the preset time period is greater than a number of memory blocks in the first group, and the first group is any group in the mapping table; in a case where at least one group in the mapping table has a mapping conflict within the preset time period, updating the preset mapping relationship; and an address segment in the updated preset mapping relationship is different from an address segment in the preset relationship before the updating.
[0029] In a possible implementation, the processing module is further configured to, in a case where the number of times of mapping conflicts of the first group is greater than a first threshold value, determine that the first group has a mapping conflict.
[0030] In a possible implementation, the processing module is further configured to, in a case where a sum of the number of times of mapping conflicts of each group in the mapping table is greater than a second threshold value, update the preset mapping relationship.
[0031] In a possible implementation, the processing module is further configured to determine a second address segment with a highest frequency of change in a plurality of memory access addresses within a preset time period; and update the preset mapping relationship according to the second address segment, and the updated preset mapping relationship includes a mapping relationship between the second address segment in the memory access address and a group in the mapping table.
[0032] In a possible implementation, the processing module is further configured to update the preset mapping relationship according to the first mapping set; and the updated preset mapping relationship is one of the plurality of candidate mapping relationships.
[0033] The possible technical solutions and beneficial effects of each function module described above can be referred to the technical solutions provided in the first aspect or the corresponding possible implementation manners thereof, which will not be described herein.
[0034] In a third aspect, an embodiment of the present application provides a computing device cluster, the computing device cluster comprising at least one computing device, each computing device comprising a processor and a memory for storing processor-executable instructions; the processor is configured to execute the instructions, so that the computing device executes the hot page identification method described above.
[0035] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing at least one computer program, the computer program being loaded and executed by a processor to implement the hot page identification method of the above aspect.
[0036] In a fifth aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computing node reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computing node executes the hot page identification method provided in various optional implementation manners of the above aspect.
[0037] The specific description of the second aspect to the fifth aspect and various implementation manners thereof in the embodiments of the present application can refer to the detailed description in the first aspect and various implementation manners thereof; and the beneficial effects of the second aspect to the fifth aspect and various implementation manners thereof can refer to the beneficial effect analysis in the first aspect and various implementation manners thereof, which will not be described herein.
[0038] These aspects or other aspects of the embodiments of the present application will be more apparent in the following description. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 A schematic diagram of a hot page identification provided by the related art is shown;
[0040] Figure 2 A memory access address mapping relationship schematic diagram provided by the related art is shown;
[0041] Figure 3 A schematic diagram of a hardware interaction framework 100 provided by an embodiment of the present application is shown;
[0042] Figure 4A schematic diagram of a collection function backhaul framework 200 provided by an embodiment of the present application is shown.
[0043] Figure 5 A schematic diagram of implementation of a collection function backhaul framework 200 provided by an embodiment of the present application on a medium module is shown.
[0044] Figure 6 A schematic diagram of implementation of a collection function backhaul framework 200 provided by an embodiment of the present application in a CPU is shown.
[0045] Figure 7 A schematic diagram of implementation of a collection function backhaul framework 200 provided by an embodiment of the present application in a separate hardware module is shown.
[0046] Figure 8 A schematic diagram of a hardware structure of a hot page identification system 300 provided by an embodiment of the present application is shown.
[0047] Figure 9 A schematic diagram of a hot page identification method provided by an embodiment of the present application is shown.
[0048] Figure 10 A schematic diagram of a mapping conflict provided by an embodiment of the present application is shown.
[0049] Figure 11 A schematic diagram of updating a preset mapping relationship provided by an embodiment of the present application is shown.
[0050] Figure 12 A logical schematic diagram of a hot page identification method provided by an embodiment of the present application is shown.
[0051] Figure 13 A mapping process schematic diagram of a mapping table provided by an embodiment of the present application is shown.
[0052] Figure 14 A migration flow schematic diagram provided by an embodiment of the present application is shown.
[0053] Figure 15 A hot page migration schematic diagram provided by an embodiment of the present application is shown.
[0054] Figure 16 A schematic diagram of a hot page identification device structure provided by an embodiment of the present application is shown.
[0055] Figure 17 A hardware schematic diagram of a computing device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0056] The terms "first", "second", "third", and "fourth" and the like in the description and in the claims of the present application and above drawings are used for distinguishing between similar objects talking about the apparatus and not necessarily for describing a specific sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances and embodiments.
[0057] In the embodiments of the present application, the words "exemplary" and "for example" are used to mean serving as an example, instance, or illustration, at 99 least with respect to the matters described at that point in the disclosure. The absence of the words "exemplary" or "for example" does not mean that the disclosure relates to only that example or illustration. In other words, the disclosure can relate to one or more embodiments that are not expressly described or illustrated but are implied from the disclosure as a whole, at least in some respects.
[0058] First, the application scenarios of the embodiments of the present application are exemplarily introduced.
[0059] In the software service, the server usually configures the memory according to the maximum service capacity scenario, but the server only runs in the peak scenario in a small part of time, and the hot data may only account for 10%-20% of the memory, or even as low as 5%-10%, while most of the memory is only occupied in space and not accessed, which leads to low memory utilization and waste of resources. In order to save memory cost, the concept of memory grading is proposed, that is, according to the frequency of data access, the data is stored in different memory media, which not only guarantees the requirement of memory capacity and bandwidth of the service scenario, but also improves the memory utilization and saves the memory cost.
[0060] Generally, the core of the CPU accesses the memory using a virtual address, and converts it into a physical address through a memory management unit (MMU). When the virtual address is converted into the physical address, a page is queried, and the common page size is 4K, 6K or 2M. For the operating system, each application program needs to apply for a page from the operating system if it needs to use the memory. That is, the access of the page is associated with the access of the memory by the actual application program. Therefore, in the related art, the page can be used as a unit to identify the cold page or the hot page, and then the graded storage of the memory is realized. Exemplarily, Figure 1 A schematic diagram of hot page identification provided by the related art is shown. As Figure 1 As shown, in the case of using a set-associative structure for the cache, there are three sets, set0, set1 and set2; each set includes four memory blocks, way. At the same time, each way corresponds to a counter for recording the frequency of access of the corresponding 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] Therefore, the embodiment of the present application provides a hot page identification method, which is applied to a computing device, and the method comprises the following steps: the computing device acquires a frequency of access corresponding to each memory block in a mapping table. The mapping table comprises a plurality of groups, each group comprises a plurality of memory blocks, one memory block is used to indicate one physical memory area, the frequency of access corresponding to a first memory block represents a number of times that the first memory block is used to map a first memory access address to the physical memory area in response to a first memory access request in a preset time period, the first memory block is a memory block corresponding to the first memory access address and determined according to a preset mapping relationship, the first memory access address is a memory address indicated by the first memory access request, and the preset mapping relationship comprises a mapping relationship between data of a target position in the memory access address and a group in the mapping table, the target position is at least one data position with the highest frequency of change in memory access addresses indicated by a plurality of historical memory access requests. The computing device determines a hot page in a virtual memory page according to a memory block in the mapping table whose frequency of access meets a preset condition. Different memory blocks in the mapping table correspond to different virtual memory pages, and the first memory access request is used to apply for a virtual memory page corresponding to the first memory access address. Through the mapping between the at least one data position with the highest frequency of change in the memory access address and the group in the mapping table, the dense access of each group can be effectively reduced, and the mapping relationship between the memory access address and the group can be balanced. In the case of dense access, it is ensured that the pages with the same frequency of access in the process of identifying the hot page are not missed, the accuracy of hot page identification is improved, and therefore the efficiency of hot page identification is improved.
[0064] Secondly, the system architecture of the embodiment of the present application is exemplarily introduced.
[0065] Figure 3 A schematic diagram of a hardware interaction framework 100 provided by the embodiment of the present application is shown. As shown in the figure, Figure 3 The hardware interaction framework 100 comprises a central processing unit (CPU) 310 and a memory medium module 320.
[0066] The CPU 310 is a core component in the computing device, responsible for the operation and processing of instructions and data of the application program. The CPU 310 includes at least one core, and an operating system runs on the CPU 310. The CPU 310 is configured to obtain the access frequency corresponding to each memory block in the mapping table in the memory medium module 320, and determine a hot page in the virtual memory page according to the memory block in the mapping table whose access frequency meets a preset condition. The mapping table includes a plurality of groups, each group includes a plurality of memory blocks, and one memory block is used to indicate one physical memory area; the access frequency corresponding to the first memory block indicates the number of times that the first memory block is used to map the first memory address to the physical memory area in response to the first memory access request in a preset time period; the first memory block is a memory block corresponding to the first memory address determined according to a preset mapping relationship; the first memory address is a memory address indicated by the first memory access request; the preset mapping relationship includes a mapping relationship between data at a target position in the memory access address and a group in the mapping table; the target position is at least one data position with the highest frequency of change in the memory access addresses indicated by a plurality of 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 apply for a virtual memory page corresponding to the first memory address. The operating system is configured to send an access request to the memory medium module 320.
[0067] The memory medium module 320 is a form of memory in the computing device, and is connected to the CPU 310 through a specific interface. The memory medium module 320 includes a plurality of memory media, and mainly functions to store application programs and data for access by the CPU 310.
[0068] Figure 4 A schematic diagram of a collection function backhaul framework 200 provided by an embodiment of the application is shown. As shown in Figure 4 The collection function backhaul framework 200 is used to implement the core of the CPU 310 to issue a memory access request to the operating system, and the CPU 310 to collect the access frequency of each memory block. The memory access request includes a memory access address. The collection function backhaul framework 200 includes the CPU 310, a collection module 410, and a storage 420.
[0069] The CPU 310 includes a CPU core, and the core of the CPU 310 is configured to issue a memory access request, and the CPU 310 is configured to acquire the access frequency corresponding to each memory block in the mapping table, and determine a hot page in the virtual memory page according to the memory block in the mapping table whose access frequency meets a preset condition. The collection module 410 is configured to acquire the memory access address issued by the CPU core and the access frequency corresponding to each memory block in the mapping table. The storage 420 is configured to store the memory access address issued by the CPU core and the access frequency corresponding to each memory block in the mapping table, and return the memory access address and the access frequency to the CPU 310. The storage 420 can be a random access memory (RAM).
[0070] Optionally, the collection function return framework 200 further includes a compression module configured to compress the memory access address and the access frequency stored in the storage 420, and return the memory access address and the access frequency to the CPU 310.
[0071] For example, the collection function return framework 200 can have different hardware forms, for example, on the memory medium module 320, in the CPU 310, or on a separate hardware module.
[0072] The CPU 310 includes a CPU core, and the core of the CPU 310 is configured to issue a memory access request, and the CPU 310 is configured to acquire the access frequency corresponding to each memory block in the mapping table, and determine a hot page in the virtual memory page according to the memory block in the mapping table whose access frequency meets a preset condition. The collection module 410 is configured to acquire the memory access address issued by the CPU core and the access frequency corresponding to each memory block in the mapping table. The storage 420 is configured to store the memory access address issued by the CPU core and the access frequency corresponding to each memory block in the mapping table, and return the memory access address and the access frequency to the CPU 310. The storage 420 can be a random access memory (RAM). Figure 5 An implementation schematic diagram of a collection function return framework 200 provided by an embodiment of the application on a medium module is shown in FIG. 3. Figure 5 As shown in FIG. 3, the collection module 410 and the storage 420 in the collection function return framework 200 are in the memory medium module 320, and the memory access address and the access frequency of the mapping table can be transmitted to the CPU 310 in an out-of-band manner; the upper software in the CPU 310 acquires the memory access address and the access frequency of the mapping table, can analyze the data, and determine the hot page in the virtual memory page.
[0073] Figure 6 An implementation schematic diagram of a collection function return framework 200 provided by an embodiment of the application in a CPU is shown in FIG. 4. Figure 6 As shown in FIG. 4, the collection module 410 and the storage 420 in the collection function return framework 200 are in the CPU 310, and the CPU core directly reads the storage 420 to acquire the memory access address and the access frequency of the mapping table. The upper software in the CPU 310 can analyze the data, and determine the hot page in the virtual memory page.
[0074] Figure 7 An implementation schematic diagram of a collection function return framework 200 provided by an embodiment of the application on a separate hardware module is shown in FIG. 5. Figure 7As shown, the collection function backhaul framework 200 is on a separate hardware module 710, including the collection module 410 and the memory 420. The hardware module 710 returns the access address and the access frequency of the collected mapping table to the CPU 310 in an out-of-band manner; the upper-layer software in the CPU 310 can analyze the data to determine the hot page in the virtual memory page.
[0075] For example, Figure 8 A hardware structure schematic diagram of a hot page identification system 300 provided by an embodiment of the present application is shown. As shown in the figure, Figure 8 As shown, the hot page identification system 300 includes a CPU 310, a counter 810, a change counter 820, a memory medium 830, and a register 840.
[0076] The CPU 310 includes a CPU core, which is configured to send a memory access request to the memory medium 830. The CPU 310 is configured to obtain the access frequency of each memory block in the mapping table, and determine the hot page in the virtual memory page according to the memory block in the mapping table whose access frequency meets a preset condition.
[0077] The counter 810 is configured to obtain the number of mapping conflicts of each group in the mapping table in a preset time period. The number of mapping conflicts of the first group is the number of times that the memory access address mapped by 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, and is configured to determine the address segment with the highest data change frequency from the memory access addresses indicated by a plurality of historical memory access requests.
[0079] The register 840 is configured to implement a parameter-configurable interleaving matrix, which is used to update the preset mapping relationship. Alternatively, a complex programmable logic device (CPLD) or a field programmable gate array (FPGA) can be used to implement the parameter-configurable interleaving matrix, which is used to update the preset mapping relationship. This is only an example and is not limited in this regard.
[0080] Specifically, the CPU 310 can obtain, from the counter 810, the number of mapping conflicts of each group in the mapping table within a preset time period, so as to determine whether there is a mapping conflict in each group in the mapping table within the preset time period. In the case that there is a mapping conflict in at least one group in the mapping table within the preset time period, the CPU 310 can obtain, from the change counter 820, the address segment with the highest data change frequency in the memory access address indicated by the memory access request within the preset time period, so as to determine the second address segment with the highest change frequency in the plurality of memory access addresses within the preset time period; and the CPU 310 updates the preset mapping relationship by configuring the register 840 according to the second address segment. 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.
[0081] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems as the system architecture evolves and new business scenarios appear.
[0082] For the convenience of understanding, the hot page identification method provided by the present application is exemplarily introduced below in combination with the accompanying drawings, and the hot page identification method is applicable to Figure 3 the hardware interaction framework 100 shown in the drawings.
[0083] Figure 9 The flowchart of the hot page identification method provided by the embodiments of the present application is shown. As Figure 9 shown, the hot page identification method can include the following steps:
[0084] S101, the computing device obtains the accessed frequency corresponding to each memory block in the mapping table.
[0085] The mapping table includes a plurality of groups, and each group includes a plurality of memory blocks. One memory block is used to indicate one physical memory region. The accessed frequency corresponding to the first memory block represents the number of times that the first memory block is used to map the first memory access address to the physical memory region in response to the 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 the 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; and the first address segment includes the address segment with the highest data change frequency in the memory access address indicated by a plurality of historical memory access requests.
[0086] The hot page identification method provided by the embodiments of the present application can not only be used for cache with group association structure, but also be used for other storage structures or storage scenarios that do not require data consistency.
[0087] In a possible implementation, before determining the hot page in the virtual memory page according to the memory block in the mapping table whose access frequency satisfies the preset condition, the method further includes: determining, by the computing device, whether each group in the mapping table has a mapping conflict in a preset time period, where the first group has a mapping conflict includes that the number of access addresses mapped to the first group by using the preset mapping relationship in the preset time period is greater than the number of memory blocks in the first group, and the first group is any group in the mapping table. In a case where at least one group in the mapping table has a mapping conflict in the preset time period, updating the preset mapping relationship; and a target position in the updated preset mapping relationship is different from a target position in the preset relationship before the updating.
[0088] For example, in a case where each group in the mapping table has a mapping conflict in the preset time period, intensive access of the access addresses occurs. That is, a large number of access addresses hit the same group in the mapping table by using the mapping relationship. Since the number of memory blocks included in one group is fixed, if hot page identification is performed at this time, access addresses exceeding the number of memory blocks included in one group will be missed, and thus memory blocks with the same access frequency are missed, and the accuracy of hot page identification is low. Therefore, in a case where at least one group in the mapping table has a mapping conflict in the preset time period, the preset mapping relationship is updated; and a target position in the updated preset mapping relationship is different from a target position in the preset relationship before the updating.
[0089] For example, Figure 10 A mapping conflict diagram is shown, which is provided by an embodiment of the present application. As shown in Figure 10 The mapping table includes the 0th group and the 1st group, and the 0th group and the 1st group each include four memory blocks. If the preset mapping relationship includes the mapping relationship between the low 1-bit address segment in the access address and the group in the mapping table. Wherein, the low 1-bit represents the last bit in the access address. The access address is a 4-bit address, including 0001, 0011, 0101, 0111, 1001 and 1011. The access addresses 0001, 0011, 0101, 0111, 1001 and 1011 are all mapped to the 1st group, and no access address is mapped to the 0th group, and at this time, a mapping conflict occurs. Therefore, the preset mapping relationship is updated, which can solve the case where a large number of access addresses are mapped to the same group. Wherein, the address segment in the updated preset mapping relationship is different from the address segment in the preset relationship before the updating.
[0090] In a possible implementation, the computing device obtains the number of times of mapping conflicts of each group in the mapping table in a preset time period. In a case where the number of times of mapping conflicts of the first group is greater than a first threshold, the computing device determines that the first group has a mapping conflict.
[0091] The number of times of the mapping conflict of the first group is determined according to the number of times of the mapping conflict of each group in the mapping table in the preset time period.
[0092] For example, the computing device determines whether each group in the mapping table in the preset time period has the mapping conflict according to the number of times of the mapping conflict of each group in the mapping table in the preset time period. In a case where the number of times of the mapping conflict of the first group is greater than the first threshold, the computing device determines that the first group has the mapping conflict, and thus determines that each group in the mapping table in the preset time period has the mapping conflict.
[0093] For example, the mapping table includes the 0th group and the 1st group, and each of the 0th group and the 1st group includes four memory blocks. If the preset mapping relationship includes the mapping relationship between the low 1-bit address segment in the memory access address and the groups in the mapping table. In a case where the memory access addresses 0001, 0011, 0101 and 0111 all hit the four memory blocks in the 1st group, it is indicated that the four memory blocks are all accessed. At this time, the memory access address in the memory access request includes 1001, which is also mapped to the 1st group, and at this time, 1001 is not included in the record of the access of the four memory blocks in the 1st group. It can be determined that the number of times of the mapping conflict of the first group is 1. In a case where the number of times of the mapping conflict of the first group is greater than 1, the computing device determines that the first group has the mapping conflict.
[0094] In a possible implementation, in a case where the sum of the number of times of the mapping conflict of each group in the mapping table is greater than a second threshold, the computing device updates the preset mapping relationship.
[0095] For example, the computing device obtains the number of times of the mapping conflict of each group in the mapping table in the preset time, and determines the sum of the number of times of the mapping conflict of each group. In a case where the sum of the number of times of the mapping conflict of 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, in a case where the second threshold includes 10, the mapping table includes four groups, and each group has four memory blocks, according to the above method of obtaining the mapping conflict, it is obtained that the number of times of the mapping conflict of the first group in the mapping table is 6, the number of times of the mapping conflict of the second group is 4, the number of times of the mapping conflict of the third group is 2, and the number of times of the mapping conflict of the fourth group is 0. It can be determined that the sum of the number of times of the mapping conflict of each group in the mapping table is 12. At this time, the sum of the number of times of the mapping conflict of each group in the mapping table is greater than the second threshold, and the computing device updates the preset mapping relationship.
[0097] Optionally, in a case where the proportion of the groups with the mapping conflict in the mapping table in the preset time period is greater than a third threshold, the computing device updates the preset mapping relationship.
[0098] The proportion of the group with the mapping conflict is, that is, the ratio of the number of the group with the mapping conflict to the number of all groups in the mapping table.
[0099] In a possible implementation, the computing device determines a second address segment with the highest frequency of change in the plurality of access addresses in the preset time period; and the computing device updates the preset mapping relationship according to the second address segment.
[0100] The updated preset mapping relationship includes the mapping relationship between the second address segment in the access address and the groups in the mapping table.
[0101] For example, the computing device obtains the plurality of access addresses in the preset time period, and determines a second address segment with the highest frequency of change in the plurality of access addresses. The preset mapping relationship is updated to one-to-one mapping between the second address segment and each group in the mapping table according to the second address segment.
[0102] For example, Figure 11 An example of updating the preset mapping relationship is shown. As shown in Figure 11 The mapping table includes the 0th group and the 1st group, and the access address is 4 bits. In the case where the preset relationship includes the mapping relationship between the first address segment with the highest frequency of data change in the plurality of historical access request indicating access addresses and the groups in the mapping table, that is, in the case where the mapping relationship is between the low 1 bit of the access address and the groups in the mapping table, as shown in the figure, the access addresses in the preset time period include 1011, 0011, 0111, 0101, 1101 and 0001. Before updating the preset mapping relationship, according to the mapping relationship, all hits are to the 1st group.
[0103] Since a mapping conflict occurs at this time, the computing device obtains the access addresses 1011, 0011, 0111, 0101, 1101 and 0001 in the preset time period, and determines a second address segment with the highest frequency of change in the access addresses. The frequency of change in the access address represents the number of changes of the same bit of the address segment. According to the access addresses in the preset time period, the number of times that the address corresponding to the low 1 bit changes from 1 to 0 is 0, the number of times that the address corresponding to the low 2 bit changes from 1 to 0 is 3, the number of times that the address corresponding to the high 1 bit changes from 1 to 0 is 4, and the number of times that the address corresponding to the high 2 bit changes from 1 to 0 is 3. Therefore, the computing device can determine that the second address segment is the high 1 bit, and the updated preset mapping relationship includes the mapping relationship between the high 1 bit in the access address and each group in the mapping table. As can be seen from the figure, the access addresses 1011 and 1101 are mapped to the 1st group according to the updated preset mapping relationship; and the access addresses 0011, 0111, 0101 and 0001 are mapped to the 0th group according to the updated preset mapping relationship.
[0104] From the above, the address segment with the highest frequency of change among the plurality of access addresses in the preset time period can be determined, and the preset mapping relationship can be updated, thereby solving the problem of mapping conflict in the case of intensive access, avoiding the omission of access addresses with the same access frequency, and improving the accuracy of hot page identification.
[0105] In a possible implementation, the computing device obtains a first mapping set; and the computing device updates the preset mapping relationship according to the first mapping set.
[0106] The first mapping set includes a plurality of candidate mapping relationships; and the updated preset mapping relationship is one of the plurality of candidate mapping relationships.
[0107] For example, before obtaining the access frequency of each memory block in the mapping table, the application is pre-tested and investigated, and the first mapping set is determined. The computing device runs the application and identifies the access situation of the application by the user. The access situation includes access address and access frequency. The computing device determines the first mapping set according to the access situation of the application by the user. The first mapping set includes a plurality of candidate mapping relationships. The computing device updates the preset mapping relationship according to the first mapping set.
[0108] For example, according to the access situation of the application by the user, the first mapping set includes a first candidate mapping relationship, a second candidate mapping relationship and a third candidate mapping relationship. In the case that at least one group in the mapping table has mapping conflict in the preset time period, the computing device updates the preset mapping relationship according to the first mapping set. The updated preset mapping relationship can be the second candidate mapping relationship.
[0109] From the above method, the preset mapping relationship is updated according to the first mapping set, which can improve the efficiency of updating the preset mapping relationship, thereby improving the efficiency of hot page identification.
[0110] S102, the computing device determines the hot page in the virtual memory page according to the memory block in the mapping table whose access frequency meets the preset condition.
[0111] Different memory blocks in the mapping table correspond to different virtual memory pages; and the first access request is used to apply for the virtual memory page corresponding to the first access address.
[0112] In a possible implementation, in the case that each group in the mapping table does not have mapping conflict in the preset time period, the computing device determines the hot page in the virtual memory page according to the memory block in the mapping table whose access frequency meets the preset condition.
[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 condition as the hot page.
[0114] For example, the computing device screens the pages in the mapping table with the access frequency greater than a specified threshold value by a sliding window algorithm, and determines the pages as hot pages. For example, the mapping table includes a 0th group and a 1st group, each of which includes 4 memory blocks. The access frequencies of the memory blocks in the 0th group are 8 times, 6 times, 10 times and 0 times respectively, and the access frequencies of the memory blocks in the 1st group are 7 times, 3 times, 12 times and 0 times respectively. By using a sliding window with a sliding window granularity of 7 and a replacement algorithm, the access frequencies of the memory blocks in the 0th group and the 1st group can be sorted as 12 times, 10 times, 8 times, 7 times, 6 times, 3 times, 0 times and 0 times. Thus, the memory blocks with the access frequencies of 12 times, 10 times, 8 times and 7 times can be determined as hot pages of the virtual memory page.
[0115] In a possible implementation, in a case where the sum of the numbers of mapping conflicts of the groups in the mapping table is less than or equal to the second threshold value, the computing device determines the hot pages in the virtual memory page according to the memory blocks in the mapping table with the access frequencies satisfying the preset condition.
[0116] The number of mapping conflicts of the first group is the number of times that the memory access address mapped to the first group by using the preset mapping relationship does not match the physical memory region indicated by the memory block in the first group.
[0117] That is, after the preset mapping relationship is updated, the sum of the numbers of mapping conflicts of the groups in the mapping table is obtained again. If the sum of the numbers of mapping conflicts of the groups in the mapping table is greater than the second threshold value, it indicates that the updated preset mapping relationship will cause more hot pages to be missed, and the preset mapping relationship needs to be updated again until the sum of the numbers of mapping conflicts of the groups in the mapping table is less than or equal to the second threshold value. At this time, the computing device can obtain the access frequencies of the memory blocks in the mapping table, and determine the hot pages in the virtual memory page according to the memory blocks in the mapping table with the access frequencies satisfying the preset condition.
[0118] As can be seen from the above, by judging the relationship between the sum of the numbers of mapping conflicts of the groups in the mapping table and the second threshold value, in a case where the sum of the numbers of mapping conflicts of the groups in the mapping table is less than or equal to the second threshold value, the hot pages in the virtual memory page are determined according to the memory blocks in the mapping table with the access frequencies satisfying the preset condition, which can improve the accuracy of hot page identification, thereby improving the efficiency of hot page identification.
[0119] The hot page identification method is described from the perspective of the flow of the method above. In the following, the method will be introduced from the perspective of a complete and specific implementation.
[0120] For example, the hot page identification is performed by using a sliding window judgment method, Figure 12 Fig. 1 shows a logic diagram of a hot page identification method according to an embodiment of the present application. As shown in Fig. 1, the hot page identification method includes the following steps. Figure 12As shown, before the hot page identification process starts, the application is pre-tested and investigated to determine the first mapping set. Specifically, the computing device runs the application and identifies the user's access to the application. The access includes the memory access address and the access frequency. The computing device determines the first mapping set according to the user's access to the application, and the first mapping set includes the first candidate mapping relationship, the second candidate mapping relationship, and the third candidate mapping relationship. Then the configuration process is entered. The configuration process includes configuring the granularity of the sliding window statistics page and configuring the second threshold. The computing device acquires a plurality of memory access addresses in a preset time period (S201), and collects the memory access addresses and the access frequencies. The computing device acquires the number of mapping conflicts of each group in the mapping table (S202). Specifically, a conflict counter is set in each group in the mapping table to acquire the number of mapping conflicts. Optionally, the computing device collects the number of mapping conflicts of each group and the memory access addresses in the preset time period through the CPU, which can be enabled in an interrupt mode or a polling mode to enable the CPU to collect the number of mapping conflicts of each group and the memory access addresses in the preset time period, and the specific enabling mode is not limited.
[0121] For example, Figure 13 A mapping collection process diagram of a mapping table is shown. As shown in Figure 13 The mapping table includes set0, set1, and set2, and each set includes four memory blocks. The count file includes a counter and a conflict counter, which is usually maintained by RAM. Each memory block corresponds to a counter, which is used to record the access frequency of the corresponding memory block. At the same time, each set also corresponds to a conflict counter, which is used to record the number of mapping conflicts of the corresponding set. If the first memory access address can hit the memory block 2 in set1 in the mapping table according to the mapping relationship, at this time, the counter 6 corresponding to the memory block 2 is incremented by 1 to record the access frequency of the memory block 2. If the first memory access address can hit set1 in the mapping table according to the mapping relationship, but the first memory access address cannot match the memory access addresses recorded in each memory block in set1, at this time, the first memory access address maps to set1 and a mapping conflict occurs, and the conflict counter 1 corresponding to set1 is incremented by 1 to record the number of mapping conflicts of set1.
[0122] The computing device determines whether the sum of the number of mapping conflicts of each group in the mapping table is greater than a second threshold according to the number of mapping conflicts of each group in the mapping table (S203). If the sum of the number of mapping conflicts of each group in the mapping table is greater than the second threshold, the computing device determines whether all candidate mapping relationships in the first mapping set are invoked (S204). If all candidate mapping relationships in the first mapping set are not invoked, the computing device invokes the candidate mapping relationship in the first mapping set that has not been invoked (S205) and updates the preset mapping relationship (S207). Specifically, in the case of invoking the second candidate mapping relationship in the first mapping set, the computing device obtains the number of mapping conflicts of each group in the mapping table under the second candidate mapping relationship, and determines whether the sum of the number of mapping conflicts of each group in the mapping table is greater than the second threshold (S203). If the sum of the number of mapping conflicts of each group in the mapping table under the second candidate mapping relationship is greater than the second threshold, the computing device determines whether all candidate mapping relationships in the first mapping set are invoked (S204). If all candidate mapping relationships in the first mapping set are invoked, the computing device determines a second address segment with the highest frequency of changes among the plurality of memory access addresses in the preset time period according to the plurality of memory access addresses in the preset time period (S206). The preset mapping relationship is updated according to the second address segment (S207). At this time, in the case where the preset mapping relationship includes the second address segment, it is determined whether the sum of the number of mapping conflicts of each group in the mapping table is greater than the second threshold (S203). If the sum of the number of mapping conflicts of each group in 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 according to the memory block in the mapping table with the access frequency satisfying the preset condition. For example, the computing device obtains the count file in the mapping table, determines the hot page in the virtual memory page by using the sliding window method according to the access frequency of each memory page recorded by the counter in the count file and the granularity of the sliding window statistical page. Figure 13
[0123] Optionally, Figure 14 A migration process diagram provided by an embodiment of the present application is shown. As shown in FIG. 1, the migration process includes the following steps. Figure 14 As shown, the computing device obtains the access frequency of each memory block in the mapping table (S301), and determines the hot page in the virtual memory page (S302). Specifically, the virtual memory page corresponding to the memory block satisfying the preset condition in the mapping table is determined as the hot page. For example, the mapping table includes the 0th group and the 1st group, and each group includes 4 memory blocks. According to the above method, the virtual memory page corresponding to the memory block 2 and the memory block 3 in the 0th group and the memory block 1 and the memory block 2 in the 1st group can be determined as the hot page. The computing device migrates the hot page in the virtual memory page (S303). For example, the data in the virtual memory page corresponding to the memory block 2 and the memory block 3 in the 0th group and the memory block 1 and the memory block 2 in the 1st group is copied to a new page, and the relationship of the mapping table is updated. The memory medium indicated by the new page has better performance than the memory medium indicated by the 0th group and the 1st group.
[0124] For example, Figure 15 A schematic diagram of hot page migration is shown. As shown in the figure, Figure 15 The first-level storage medium is the storage medium with the best performance; the second-level storage medium is the storage medium with suboptimal performance; and the third-level storage medium is the storage medium with poor performance. The CPU 310 can determine the hot page of the virtual memory in the second-level storage medium and the third-level storage medium by using the above hot page identification method, and migrate the hot page of the virtual memory to the upper-level storage medium. That is, the hot page of the corresponding virtual memory in the second-level storage medium is migrated to the first-level storage medium; the hot page of the corresponding virtual memory in the third-level storage medium is migrated to the second-level storage medium; and the hierarchical storage of the memory is realized, thereby improving the memory utilization.
[0125] In summary, the embodiment of the present application provides a hot page identification method, which is applied to a computing device and used for improving the hot page identification efficiency. The method comprises the following steps: the computing device acquires the access frequency corresponding to each memory block in a mapping table. The hot page in the virtual memory page is determined according to the memory block in the mapping table whose access frequency meets a preset condition. The mapping table comprises a plurality of groups, each group comprises a plurality of memory blocks, and one memory block is used for indicating one physical memory region; the access frequency corresponding to the first memory block represents the number of times that the first memory block is used for mapping the first memory address to the physical memory region in response to the first memory access request in a preset time period; the first memory block is the memory block corresponding to the first memory address and determined according to a preset mapping relationship; the first memory address is the memory address indicated by the first memory access request; the preset mapping relationship comprises the mapping relationship between the first address segment in the memory address and the group in the mapping table; the first address segment comprises the address segment with the highest data change frequency in the memory address indicated by a plurality of historical memory access requests; different memory blocks in the mapping table correspond to different virtual memory pages; and the first memory access request is used for applying for the virtual memory page corresponding to the first memory address. The above method can effectively reduce the intensive access of each group in the mapping table, dilute the mapping relationship between the memory address and the group, ensure that the virtual memory pages with the same access frequency will not be missed under intensive access, improve the accuracy of hot page identification, and further improve the efficiency of hot page identification.
[0126] The above mainly describes the scheme of the embodiment of the present application from the perspective of the method. It can be understood that, in order to realize the above functions, the hot page identification device comprises at least one of the corresponding hardware structure and software module for executing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed in the present application, the embodiment of the present application can be realized in the form of hardware or the combination of hardware and computer software. Whether a certain function is realized by hardware or computer software driven hardware depends on the specific application and design constraints of the technical scheme. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiment of the present application.
[0127] The embodiment of the present application can divide the functional units of the hot page identification device according to the above method examples. For example, each functional unit can be divided according to each function, or two or more functions can be integrated in one processing unit. The integrated unit can be realized in the form of hardware or software functional unit. It should be noted that the division of units in the embodiment of the present application is illustrative, and is only a logical function division. When actually implemented, there can be another division manner.
[0128] Exemplary, Figure 16 A structure diagram of a hot page identification device is shown. As shown, the hot page identification device can be applied in a computing device. The hot page identification device 400 includes: Figure 16 The obtaining module 401 is configured to obtain the access frequency corresponding to each memory block in a mapping table. The mapping table includes a plurality of groups, and each group includes a plurality of memory blocks. One memory block is used to indicate one physical memory region. The access frequency corresponding to a first memory block indicates the number of times that the first memory block is used to map a first memory address 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 the first memory address determined according to a preset mapping relationship. The first memory address is a memory address indicated by the first memory access request. The preset mapping relationship includes a mapping relationship between a first address segment in the memory access address and a group in the mapping table. The first address segment includes an address segment with the highest data change frequency in the memory access addresses indicated by a plurality of historical memory access requests.
[0129] The identification module 402 is configured to determine a hot page in a virtual memory page according to a memory block in the mapping table whose access frequency satisfies a preset condition. Different memory blocks in the mapping table correspond to different virtual memory pages. The first memory access request is used to apply for a virtual memory page corresponding to the first memory address.
[0130] In a possible implementation, the obtaining module 401 is further configured to obtain the number of times of mapping conflicts of each group in the mapping table within a preset time period. The number of times of mapping conflicts of the first group is the number of times that a memory access address mapped to the first group by using the preset mapping relationship does not match a physical memory region indicated by a memory block in the first group.
[0131] In a possible implementation, the obtaining module 401 is further configured to obtain a first mapping set. The first mapping set includes a plurality of candidate mapping relationships.
[0132] In a possible implementation, the identification module 402 is further configured to, in a case where there is no mapping conflict in each group in the mapping table within a preset time period, determine a hot page in a virtual memory page according to a memory block in the mapping table whose access frequency satisfies a preset condition.
[0133] In a possible implementation, the identification module 402 is further configured to, in a case where the sum of the number of times of mapping conflicts of each group in the mapping table is less than or equal to a second threshold value, determine a hot page in a virtual memory page according to a memory block in the mapping table whose access frequency satisfies a preset condition. The number of times of mapping conflicts of the first group is the number of times that a memory access address mapped to the first group by using the preset mapping relationship does not match a physical memory region indicated by a memory block in the first group.
[0134] In a possible implementation, the identification module 402 is further configured to, in a case where the sum of the number of times of mapping conflicts of each group in the mapping table is less than or equal to a second threshold value, determine a hot page in a virtual memory page according to a memory block in the mapping table whose access frequency satisfies a preset condition. The number of times of mapping conflicts of the first group is the number of times that a memory access address mapped to the first group by using the preset mapping relationship does not match a physical memory region indicated by a memory block in the first group.
[0135] In a possible implementation, the hot page identification apparatus further includes a processing module configured to determine whether each group in the mapping table has a mapping conflict in a preset time period, where the first group has a mapping conflict includes that the number of access addresses mapped to the first group by using the preset mapping relationship in the preset time period is greater than the number of memory blocks in the first group, and the first group is any group in the mapping table; and the preset mapping relationship is updated in a case where at least one group in the mapping table has a mapping conflict in the preset time period; and the address segment in the updated preset mapping relationship is different from the address segment in the preset mapping relationship before the update.
[0136] In a possible implementation, the processing module is further configured to determine that the first group has a mapping conflict in a case where the number of times of mapping conflicts of the first group is greater than a first threshold.
[0137] In a possible implementation, the processing module is further configured to update the preset mapping relationship in a case where the sum of the number of times of mapping conflicts of each group in the mapping table is greater than a second threshold.
[0138] In a possible implementation, the processing module is further configured to determine a second address segment with the highest frequency of changes in the plurality of access addresses in the preset time period; and update the preset mapping relationship according to the second address segment, where the updated preset mapping relationship includes a mapping relationship between the second address segment in the access address and the group in the mapping table.
[0139] In a possible implementation, the processing module is further configured to update the preset mapping relationship according to the first mapping set, where the updated preset mapping relationship is one of the plurality of candidate mapping relationships.
[0140] Figure 17 A hardware schematic diagram of a computing device is shown. As shown in the figure, 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 through the bus 801. The computing device 800 can be a server or a terminal device. It should be understood that the number of processors and memories in the computing device 800 is not limited in the present application. Figure 17
[0141] The bus 801 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 17 Only one bus is shown for simplicity, but there can be more than one bus. Bus 801 can include circuitry that connects the various components in the computing device 800 (e.g., processor 802, memory 803, communication interface 804) and that enables the transfer of information between the components.
[0142] The processor 802 can include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor, a microcontroller, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a programmable logic device (PLD), a controller, a microcontroller, or any other processing units.
[0143] The memory 803 can include a volatile memory, such as random access memory (RAM), and / or a non-volatile memory, such as read-only memory (ROM), a floppy disk drive, a hard disk drive, or a solid-state drive. The memory 803 can store data and / or computer program code that is executed by the processor 802.
[0144] The memory 803 stores executable program code that is executed by the processor 802 to implement the functions of the obtaining module and the identifying module, respectively, and thus implement the hot page identifying method. That is, the memory 803 stores instructions for implementing the hot page identifying method.
[0145] Alternatively, the memory 803 stores executable program code that is executed by the processor 802 to implement the functions of the aforementioned hot page identifying apparatus, respectively, and thus implement the hot page identifying method. That is, the memory 803 stores instructions for implementing the hot page identifying method.
[0146] The communication interface 804 uses a transceiver module, such as but not limited to a network interface card, a transceiver, and the like, to enable communication between the computing device 800 and other devices or communication networks.
[0147] As an example, the functions of the obtaining module 401 and the identifying module 402 of the hot page identifying apparatus 400 can be implemented by the computing device in Figure 17 Figure 17
[0148] The embodiments of the present disclosure also provide a computer-readable storage medium, which stores instructions, when the instructions are run on a computer, cause the computer to execute the hot page identifying method.Figures 9-15 the operation of any one of the embodiments and various possible implementation manners thereof.
[0149] The embodiment of the present application further provides a computer program product comprising instructions which, when executed on a computer, cause the computer to perform the operation of Figures 9-15 the operation of any one of the embodiments and various possible implementation manners thereof.
[0150] Those skilled in the art can clearly understand that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0151] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0152] In the above embodiments, all or part of the embodiments can be realized by software, hardware, firmware or any combination thereof. When realized by software, all or part of the embodiments can be realized in the form of a computer program product. The computer program product comprises one or more computer instructions, which, when loaded and executed on a computer, realize all or part of the processes or functions described in the embodiments of the present 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 by wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, microwave, etc.) manner. The computer-readable storage medium can be any available medium accessible by a computer, and can also be a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape, etc.), optical media (such as DVD, etc.), or semiconductor media (such as solid-state disk), etc.
[0153] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can refer to the related description of other embodiments.
[0154] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A hot page identification method, characterized by, The method is applied to a computing device and comprises: obtaining a frequency of access corresponding to each memory block in a mapping table; wherein the mapping table comprises a plurality of groups, each of the groups comprises a plurality of memory blocks, and each of the memory blocks is used to indicate a physical memory region; the frequency of access corresponding to a first memory block represents a number of times that a first memory address is mapped to a physical memory region by using the first memory block in response to a first memory access request within a preset time period; the first memory block is a memory block corresponding to the first memory address and determined according to a preset mapping relationship; the first memory address is a memory address indicated by the first memory access request; the preset mapping relationship comprises a mapping relationship between a first address segment in a memory access address and a group in the mapping table; the first address segment comprises an address segment with the highest frequency of data change among memory access addresses indicated by a plurality of historical memory access requests; determining a hot page in a virtual memory page according to a memory block in the mapping table that satisfies a preset condition; different memory blocks in the mapping table correspond to different virtual memory pages; and the first memory access request is used to apply for a virtual memory page corresponding to the first memory address.
2. The method of claim 1, wherein, Before the determining of the hot page in the virtual memory page according to the memory block in the mapping table that satisfies the preset condition, the method further comprises: determining whether a mapping conflict exists in each group in the mapping table within the preset time period; wherein a first group exists a mapping conflict includes that a number of memory access addresses mapped to the first group by using the preset mapping relationship within the preset time period is greater than a number of memory blocks in the first group; and the first group is any group in the mapping table; in a case where the mapping conflict exists in at least one group in the mapping table within the preset time period, updating the preset mapping relationship; an address segment in the updated preset mapping relationship is different from an address segment in the preset relationship before the updating.
3. The method of claim 2, wherein, The determining of whether the mapping conflict exists in each group in the mapping table within the preset time period comprises: obtaining a number of times of the mapping conflict occurring in each group in the mapping table within the preset time period; wherein the number of times of the mapping conflict occurring in the first group is a number of times that a memory access address mapped to the first group by using the preset mapping relationship does not match a physical memory region indicated by a memory block in the first group; in a case where the number of times of the mapping conflict occurring in the first group is greater than a first threshold value, determining that the first group exists the mapping conflict.
4. The method of claim 3, wherein, The updating of the preset mapping relationship in a case where the mapping conflict exists in at least one group in the mapping table within the preset time period comprises: in a case where a sum of the number of times of the mapping conflict occurring in each group in the mapping table is greater than a second threshold value, updating the preset mapping relationship.
5. The method according to any one of claims 2-4, characterized in that, The updating of the preset mapping relationship comprises: determining a second address segment with the highest frequency of change among a plurality of memory access addresses within the preset time period; updating the preset mapping relationship according to the second address segment; and the updated preset mapping relationship comprises a mapping relationship between the second address segment in a memory access address and a group in the mapping table.
6. The method according to any one of claims 2-4, characterized in that, The updating of the preset mapping relationship comprises: obtaining a first mapping set; the first mapping set comprises a plurality of candidate mapping relationships; updating the preset mapping relationship according to the first mapping set; wherein the updated preset mapping relationship is one of the plurality of candidate mapping relationships.
7. The method according to any one of claims 2-4, characterized in that, The method further comprises: In the case that there is no mapping conflict in each group of the mapping table within the preset time period, determining a hot page in a virtual memory page according to the memory block in the mapping table whose access frequency satisfies a preset condition.
8. The method of claim 7, wherein, In the case that there is no mapping conflict in each group of the mapping table within the preset time period, determining a hot page in a virtual memory page according to the memory block in the mapping table whose access frequency satisfies a preset condition, comprising: In the case that the sum of the number of times of the mapping conflict in each group of the mapping table is less than or equal to a second threshold, determining a hot page in a virtual memory page according to the memory block in the mapping table whose access frequency satisfies a preset condition; wherein the number of times of the mapping conflict in the first group is the number of times that the memory address mapped to the first group by 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 apparatus, characterized by comprising: The apparatus comprises: The obtaining module is configured to obtain an access frequency corresponding to each memory block in a mapping table; wherein the mapping table comprises a plurality of groups, each of the groups comprises a plurality of memory blocks, and each of the memory blocks is configured to indicate a physical memory region; the access frequency corresponding to a first memory block represents the number of times that the first memory block is used to map a first memory address 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 the first memory address and determined according to a preset mapping relationship; the first memory address is a memory address indicated by the first memory access request; the preset mapping relationship comprises a mapping relationship between a first address segment in a memory address and a group in the mapping table; the first address segment comprises an address segment with the highest data change frequency among address segments indicated by a plurality of historical memory access requests; The identifying module is configured to determine a hot page in a virtual memory page according to a memory block in the mapping table whose access frequency satisfies a preset condition; different memory blocks in the mapping table correspond to different virtual memory pages; and the first memory access request is configured to apply for a virtual memory page corresponding to the first memory address.
10. A computing device, comprising: The computing device comprises a processor and a memory for storing processor-executable instructions; The processor is configured to execute the instructions, so that the computing device performs the hot page identification method according to any one of claims 1-8.
11. A computer program product, characterised in that, The computer program product comprises instructions which, when executed by a computing device, cause the computing device to perform the hot page identification method according to any one of claims 1-8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium comprises computer program instructions which, when executed by a computing device, cause the computing device to perform the hot page identification method according to any one of claims 1-8.
Citation Information
Patent Citations
Memory system based on hybrid memory architecture
CN110532200A
Memory controller and operating method thereof
CN111338979A
Memory access method, device and system and electronic equipment
CN115374022A
Memory access popularity statistical method, related device and equipment
CN117149049A
Method for determining page access times, electronic equipment and computing equipment
CN117290195A