Method and device for determining popularity of memory page, equipment, chip and processor
By updating the memory address in the address window, and using the address window to store the memory addresses accessed in the latest time period, the problem of inaccurate memory page popularity recognition in the prior art is solved, and accurate identification of memory page popularity and improvement of memory hierarchical access performance is achieved.
Patent Information
- Application Number
- CN202311371380.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-09-13
- Filing Date
- 2023-10-20
- Publication Date
- 2025-03-14
AI Technical Summary
When identifying the popularity of memory pages, the prior art cannot accurately determine the actual number of visits to memory pages within one scan cycle, resulting in inaccurate identification of hot and cold pages.
When obtaining the memory address of the access request of the storage medium, the memory address in the address window is updated, and the memory address that has been accessed in the most recent time period is used to store the memory address that has been accessed in the last time period, thereby accurately identifying the popularity of the memory page.
It realizes accurate identification of the popularity of the accessed memory pages and improves memory hierarchical access performance.
Smart Images

Figure CN119621605A_ABST
Abstract
Description
[0001] This application claims priority to Chinese patent application No. 202311184807.0 filed on September 13, 2023, with invention name “Page status determination method, access statistics method, device and equipment for memory pages”, the entire contents of which are incorporated by reference in this application. Technical Field
[0002] The present application relates to the field of communication technology, and in particular to a method, device, equipment, chip and processor for determining the heat of a memory page. Background Art
[0003] In memory hierarchical storage technology, how to quickly and accurately identify the cold pages and hot pages in the memory pages recorded in the page table determines the performance of memory hierarchical access. In the related art, the software used for cold and hot page identification can count the number of accesses to the memory page by periodically scanning the access (A) flag in the page table entry (PTE). Among them, the value of the A flag is used to indicate whether the memory page indicated by the PTE has been accessed. If the software identifies that the A flag in a certain PTE is 1 during the periodic scanning, it is considered that the memory page indicated by the PTE has been accessed within the scanning cycle. If the A flag is 0, it is considered that the memory page has not been accessed within the scanning cycle. Afterwards, the software can identify the memory page as a hot page or a cold page based on the access count of the memory page in multiple scanning cycles.
[0004] Since the value of the A flag indicates whether the memory page has been accessed within a scanning cycle, if the memory page is accessed multiple times within a scanning cycle, the A flag cannot accurately determine the actual number of times the memory page is accessed within this scanning cycle, resulting in inaccurate results in the final identification of hot and cold pages, that is, inaccurate identification of the heat of the accessed memory page. Summary of the invention
[0005] The present application provides a method, device, equipment, chip and processor for determining the heat of a memory page, which can accurately identify the heat of an accessed memory page. The technical solution is as follows:
[0006] In a first aspect, a method for determining the heat of a memory page is provided. The method involves an address window, which is used to store memory addresses in a storage medium that have been accessed within a recent period of time. In the method, a first memory address accessed by an access request for the storage medium is first obtained, and then, based on the first memory address, the memory address stored in the address window is updated to obtain an updated address window; based on the memory address in the updated address window, the heat of the memory page in the storage medium is determined.
[0007] The method obtains the memory address accessed for a storage access request and updates the memory address stored in the address window according to the obtained memory address. As the memory address in the address window is continuously updated, the updated address window can store the memory addresses accessed in the storage medium in the recent time period. Then, based on the memory addresses in the updated address window, the heat of the memory pages accessed in the storage medium in the recent time period can be accurately identified.
[0008] In a possible implementation, the address window is a local address window. Based on this, the process of updating the memory address stored in the address window according to the first memory address includes: if M second memory addresses have been stored in the address window, and the first memory address does not exist among the M second memory addresses, determine the third memory address based on the first access count of the M second memory addresses; and then update the third memory address in the address window to the first memory address; wherein the third memory address is the memory address with the lowest access popularity among the M second memory addresses, and M is the address capacity of the address window.
[0009] Based on the above possible implementation methods, after obtaining the memory address accessed for the storage access request, if the address window is full of memory addresses that have been accessed by the storage medium, and there is no newly acquired memory address in the address window, then based on the number of accesses to the memory addresses in the address window, the memory address with the lowest access popularity in the address window is identified, and the number of accesses to the memory address with the lowest access popularity in the address window is updated to the newly acquired memory address to eliminate the memory address with the lowest access popularity in the address window. By continuously eliminating memory addresses with low access popularity in the address window, the memory address with the highest access popularity in the access statistics process can be retained in the address window, and then based on the memory address with the highest access popularity in the access statistics process, the hot pages in the storage medium can be accurately identified.
[0010] In one possible implementation, the process of determining the third memory address includes: firstly performing attenuation processing on the first access times of M second memory addresses; if the first access times of any second memory address decays to the first access threshold, then determining any second memory address as the third memory address.
[0011] Based on the above possible implementation method, it is sufficient to query whether the first access count after decay exists in the first access count after decay, without sorting the first access count after decay. The implementation is simple and the third memory address can be determined quickly.
[0012] In a possible implementation, the step of determining the third memory address includes: first querying the minimum access number among the first access numbers of the M second memory addresses; and then determining the second memory address to which the minimum access number belongs as the third memory address.
[0013] Based on the above possible implementation methods, the minimum number of accesses can be accurately queried, and then the memory address with the lowest access popularity can be accurately determined, so that the number of accesses to the memory address with the lowest access popularity can be subsequently replaced with the number of accesses to the newly acquired memory address, so as to accurately eliminate the memory address with the lowest access popularity.
[0014] In one possible implementation, the address window is a global address window, based on which the method further includes the following steps: if the first memory address does not exist in the memory addresses stored in the address window, and there is no unused address entry in the address window, a first interrupt message is sent to the processor core, the first interrupt message indicating that all address entries in the address window have been used, resulting in an access statistics interruption, and the address entry is used to record a memory address that has been accessed in the storage medium.
[0015] Based on the above possible implementation methods, the processor core can read the memory address in the address window as quickly as possible, so as to initialize the address window as quickly as possible, and then based on the initialized address window, the subsequently acquired memory address can be recorded as quickly as possible.
[0016] In one possible implementation, the address window includes multiple address entries, and the address entry is used to record a memory address that has been accessed in the storage medium. The above process of updating the memory address stored in the address window according to the first memory address includes the following steps: if the first memory address does not exist in the memory addresses stored in the address window, and there are unused address entries in the address window, fill the unused address entries with the first memory address.
[0017] Based on the above possible implementation, by filling the first memory address in the unused address entry, the newly collected memory address is recorded through the address window to avoid missing the accessed memory address, so as to determine the correctness of the statistical result.
[0018] In one possible implementation, the address window corresponds to an access statistics window, the access statistics window contains multiple access times, and the address entry corresponds to an access time in the access statistics window. The method also includes the following steps: according to the first memory address, updating the access times stored in the access statistics window to obtain an updated access statistics window; determining the heat of the memory page in the storage medium according to the memory address in the updated address window and the access times in the updated access statistics window.
[0019] In one possible implementation, the method further includes the following step: if there is an access number greater than or equal to a second number threshold among the multiple access numbers, a second interrupt message is sent to the processor core, and the second interrupt message indicates that an access statistics interruption is caused by a memory address with an access number greater than or equal to the second number threshold.
[0020] Based on the above possible implementation methods, after the number of accesses reaches the second number threshold in the access statistics window, an interrupt message is sent to the processor core to notify the processor core that the access statistics of the storage medium have been interrupted, so that the processor core can read the memory address in the address window and the number of accesses in the access statistics window as soon as possible, so that the processing core can determine the hot data in the storage medium based on the number of accesses reaching the second number threshold, without the processor core waiting for the access statistics cycle to end or waiting for the address table to be filled, thereby improving the efficiency of the processor core in determining hot data.
[0021] In one possible implementation, the method further includes the following steps: receiving an information read request from a processor core; and sending access statistics information to the processor core based on each memory address in an address window and the number of accesses to each memory address, wherein the information read request indicates reading access statistics information of a storage medium.
[0022] Based on the above possible implementation manner, by sending access statistics information to the processor core, the processor core can accurately determine the heat of the memory page in the storage medium based on the number of accesses to each memory address in the access statistics information.
[0023] In a possible implementation, the address window is implemented by a content addressable memory CAM.
[0024] Compared with associative memories of other associative structures, CAM can store more data with a smaller chip area, and based on the above possible implementation method, the chip area occupied by the address window can be reduced.
[0025] In a second aspect, a method for counting accesses to a storage medium is provided. The method involves an address window, which is used to store memory addresses in the storage medium that have been accessed in a recent time period. In the method, a first memory address accessed by an access request for the storage medium is first obtained. Then, based on the first memory address, the memory address stored in the address window is updated to obtain an updated address window, so as to realize counting of memory addresses accessed by the storage medium.
[0026] The method obtains the memory address accessed for the storage access request and updates the memory address stored in the address window according to the acquired memory address. As the memory address in the address window is continuously updated, the updated address window can store the memory addresses accessed in the storage medium in the recent time period, thereby accurately counting the memory addresses accessed in the storage medium in the recent time period.
[0027] In a possible implementation, the address window is a local address window. Based on this, the process of updating the memory address stored in the address window according to the first memory address includes: if M second memory addresses have been stored in the address window, and the first memory address does not exist among the M second memory addresses, determine the third memory address based on the first access count of the M second memory addresses; and then update the third memory address in the address window to the first memory address; wherein the third memory address is the memory address with the lowest access popularity among the M second memory addresses, and M is the address capacity of the address window.
[0028] In one possible implementation, the process of determining the third memory address includes: firstly performing attenuation processing on the first access times of M second memory addresses; if the first access times of any second memory address decays to the first access threshold, then determining any second memory address as the third memory address.
[0029] In a possible implementation, the step of determining the third memory address includes: first querying the minimum access number among the first access numbers of the M second memory addresses; and then determining the second memory address to which the minimum access number belongs as the third memory address.
[0030] In one possible implementation, the address window is a global address window, based on which the method further includes the following steps: if the first memory address does not exist in the memory addresses stored in the address window, and there is no unused address entry in the address window, a first interrupt message is sent to the processor core, the first interrupt message indicating that all address entries in the address window have been used, resulting in an access statistics interruption, and the address entry is used to record a memory address that has been accessed in the storage medium.
[0031] In one possible implementation, the address window includes multiple address entries, and the address entry is used to record a memory address that has been accessed in the storage medium. The above process of updating the memory address stored in the address window according to the first memory address includes the following steps: if the first memory address does not exist in the memory addresses stored in the address window, and there are unused address entries in the address window, fill the unused address entries with the first memory address.
[0032] In one possible implementation, the address window corresponds to an access statistics window, the access statistics window contains multiple access times, and the address entry corresponds to an access time in the access statistics window. The method also includes the following steps: according to the first memory address, updating the access times stored in the access statistics window to obtain an updated access statistics window.
[0033] In one possible implementation, the method further includes the following step: if there is an access number greater than or equal to a second number threshold among the multiple access numbers, a second interrupt message is sent to the processor core, and the second interrupt message indicates that an access statistics interruption is caused by a memory address with an access number greater than or equal to the second number threshold.
[0034] In one possible implementation, the method further includes the following steps: receiving an information read request from a processor core; and sending access statistics information to the processor core based on each memory address in an address window and the number of accesses to each memory address, wherein the information read request indicates reading access statistics information of a storage medium.
[0035] In a possible implementation, the address window is implemented by a content addressable memory CAM.
[0036] According to a third aspect, a method for determining the page status of a memory page is provided, wherein the storage medium is a memory or a cache of the memory, and in the method, a mapping relationship between memory addresses that have been accessed by the storage medium and the number of accesses is known. After obtaining a first memory address accessed by an access request for the storage medium, the first memory address is queried from the mapping relationship between memory addresses that have been accessed by the storage medium and the number of accesses; if it is found that the first memory address exists in the memory addresses that have been accessed by the storage medium, the number of accesses in the mapping relationship where the first memory address is located is updated, and after a first period of time, the page status of the memory page to which the memory address belongs is determined based on the latest number of accesses to the memory addresses that have been accessed by the storage medium, and the page status is used to indicate the popularity of the memory page being accessed.
[0037] The method records the access count of the accessed memory address through a mapping relationship between the memory address of the storage medium and the access count. After obtaining the memory address accessed by the access request for the storage medium, the obtained memory address is queried from the mapping relationship. If the obtained memory address exists in the memory addresses of the storage medium, the access count of the memory address in the mapping relationship is updated to obtain the latest access count of the memory address. As the obtained memory address increases, the actual access count of the memory address of the storage medium can be accurately obtained, and then based on the actual access count of the memory address of the storage medium, the page status of the memory page of the storage medium can be accurately identified.
[0038] In a possible implementation, the memory addresses of the storage medium that have been accessed are recorded in an address table, and the number of accesses to the memory addresses that have been accessed is recorded in an access statistics table, and the address table corresponds to the access statistics table.
[0039] Based on the above possible implementation methods, based on the address table and the access statistics table, the mapping relationship between the memory addresses that have been accessed and the access times of the storage medium is maintained, so as to quickly query in the address table whether the first memory address is an accessed memory address, thereby improving the query efficiency of the first memory address.
[0040] In one possible implementation, the access statistics table includes multiple access times, the address table includes multiple address entries, the address entry is used to record a memory address that has been accessed in the storage medium, and the address entry corresponds to an access time in the access statistics table. The method also includes the following steps: if the first memory address does not exist in the memory addresses that have been accessed in the storage medium, and there are unused address entries in the address table, the first memory address is filled in the unused address entry, and the access time corresponding to the unused address entry in the access statistics table is updated.
[0041] Based on the above possible implementation methods, by filling the first memory address in the unused address entry, the number of accesses corresponding to the unused address entry in the access statistics table becomes the number of accesses of the first memory address, and the number of accesses is updated to count the accesses to the first memory address.
[0042] In a possible implementation, the method further includes the following steps: if the first memory address does not exist in the memory addresses accessed by the storage medium, and there is no unused address entry in the address table, multiple access times are decayed to obtain multiple access times after decay; if any access times after decay are less than or equal to the first number threshold, the memory address in the address entry corresponding to any access number is updated to the first memory address, and any access times after decay are updated.
[0043] Based on the above possible implementation methods, newly acquired memory addresses are used to eliminate memory addresses with low access counts in the address table. After this elimination operation, the memory addresses in the address table are all memory addresses with higher access counts relative to the eliminated memory addresses, so that the hot pages with the highest access frequency in the storage medium can be determined based on the access counts of the memory addresses with higher access counts.
[0044] In a fourth aspect, a method for counting accesses to a storage medium is provided, wherein the storage medium is a memory or a cache of the memory. In the method, a mapping relationship between memory addresses that have been accessed and the number of accesses to the storage medium is known. After obtaining a first memory address accessed by an access request for the storage medium, the first memory address is queried from the mapping relationship between memory addresses that have been accessed and the number of accesses to the storage medium. If it is found that the first memory address exists among the memory addresses that have been accessed to the storage medium, the number of accesses in the mapping relationship where the first memory address is located is updated.
[0045] The method records the access count of the accessed memory address through the mapping relationship between the memory address of the storage medium and the access count. After obtaining the memory address accessed by the access request for the storage medium, the obtained memory address is queried from the mapping relationship. If the obtained memory address exists in the memory addresses of the storage medium, the access count of the memory address in the mapping relationship is updated to obtain the latest access count of the memory address. As the number of obtained memory addresses increases, the actual access count of the memory address of the storage medium can be accurately obtained.
[0046] In one possible implementation, the memory addresses of the storage medium that have been accessed are recorded in an address table, and the number of accesses to the accessed memory addresses is recorded in an access statistics table, the access statistics table contains multiple access times, the address table contains multiple address entries, the address entry is used to record a memory address that has been accessed in the storage medium, and the address entry corresponds to an access number in the access statistics table. The method also includes the following steps: if the first memory address does not exist in the memory addresses of the storage medium that have been accessed, and there is an unused address entry in the address table, the first memory address is filled in the unused address entry, and the number of accesses corresponding to the unused address entry in the access statistics table is updated.
[0047] In a possible implementation, the method also includes the following step: if the first memory address does not exist in the memory addresses accessed by the storage medium, and there is no unused address entry in the address table, a first interrupt message is sent to the processor core, and the first interrupt message indicates that all address entries in the address table have been used, resulting in an access statistics interruption.
[0048] Based on the above possible implementation methods, the processor core can read the memory address in the address table and the access count in the access statistics table as quickly as possible, so that the address table and the access statistics table can be initialized as soon as possible, and then based on the initialized address table and access statistics table, the access count of the subsequently obtained memory addresses can be performed as soon as possible.
[0049] In a possible implementation, the method further includes the following steps: if the first memory address does not exist in the memory addresses accessed by the storage medium, and there is no unused address entry in the address table, multiple access times are decayed to obtain multiple access times after decay; if any access times after decay are less than or equal to the first number threshold, the memory address in the address entry corresponding to any access number is updated to the first memory address, and any access times after decay are updated.
[0050] In a possible implementation, the method further includes the following steps: if there is an access number greater than or equal to a second number threshold among the multiple access numbers, a second interrupt message is sent to the processor core, and the second interrupt message indicates that an access statistics interruption occurs due to a memory address with an access number greater than or equal to the second number threshold.
[0051] Based on the above possible implementation methods, after the number of accesses reaching the second number threshold exists in the address table, an interrupt message is sent to the processor core to notify the processor core that the access statistics of the storage medium have been interrupted, so that the processor core can read the memory address in the address table and the number of accesses in the access statistics table as soon as possible, so that the processing core can determine the hot data in the storage medium based on the number of accesses reaching the second number threshold, without the processor core waiting for the access statistics cycle to end or waiting for the address table to be filled, thereby improving the efficiency of the processor core in determining hot data.
[0052] In one possible implementation, the method further includes the following steps: receiving an information read request from a processor core, the information read request indicating access statistics of reading a storage medium; and sending access statistics to the processor core based on each memory address accessed by the storage medium and the number of times each memory address is accessed.
[0053] Based on the possible implementation manner described above, access statistics information is sent to the processor core so that the processor core can accurately determine the hot data in the storage medium based on the number of accesses to each memory address in the access statistics information.
[0054] In a fifth aspect, a device for determining the heat of a memory page is provided, which is used to execute the method provided in the first aspect or any optional manner of the first aspect.
[0055] In a sixth aspect, a storage medium access statistics device is provided, which is used to execute the method provided in the second aspect or any optional manner of the second aspect.
[0056] In a seventh aspect, a device for determining a page status of a memory page is provided, which is used to execute the method provided in the third aspect or any optional manner of the third aspect.
[0057] In an eighth aspect, a storage medium access statistics device is provided, which is used to execute the method provided in the fourth aspect or any optional manner of the fourth aspect.
[0058] In a ninth aspect, a computer device is provided, the computer device comprising a processor, the processor being used to execute program code so that the computer device performs a method provided in any one of the first to fourth aspects above or any optional manner of any of the aspects.
[0059] In a tenth aspect, a chip is provided, which includes a logic circuit, and the logic circuit is used to execute the method provided in any one of the first to fourth aspects above or any optional manner of any of the aspects.
[0060] In the eleventh aspect, a processor is provided, wherein the processor is used to execute the method provided in any one of the first to fourth aspects above or any optional manner of any of the aspects.
[0061] In the twelfth aspect, a computer-readable storage medium is provided, in which at least one program code is stored, and the program code is read and executed by a processor to implement a method provided in any one of the first to fourth aspects above or in any optional manner of any one of the aspects.
[0062] In the thirteenth aspect, a computer program product or a computer program is provided, which includes a program code, and the program code is stored in a computer-readable storage medium. A processor reads the program code from the computer-readable storage medium, and the processor executes the program code, so that the device where the processor is located executes the method provided in any one of the first to fourth aspects above or in various optional implementations of any one of the aspects.
[0063] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 It is a computer system architecture diagram with hierarchical memory provided by the present application;
[0065] Figure 2 It is a schematic diagram of the interaction between a processing core and a hierarchical memory provided by the present application;
[0066] Figure 3 It is a working principle diagram of a visit statistics device provided by the present application;
[0067] Figure 4 is another computer system architecture diagram with hierarchical memory provided by the present application;
[0068] Figure 5 is another computer system architecture diagram with hierarchical memory provided by the present application;
[0069] Figure 6 It is a flow chart of a method for determining a page status of a memory page provided by the present application;
[0070] Figure 7 This is a migration flow chart of hot data in a local statistical mode provided by this application;
[0071] Figure 8 It is a flow chart of a method for determining the heat of a memory page provided by the present application;
[0072] Fig. 9 This is a migration flow chart of hot data in a global statistical mode provided by this application;
[0073] Fig.10 It is a sliding window semi-decay replacement flow chart of an access statistics table provided by the present application;
[0074] Fig.11 This is a flow chart for recording the number of accesses to a memory address provided by the present application;
[0075] Fig.12 It is a structural diagram of an access statistics device for a storage medium provided by the present application;
[0076] Fig.13 It is a structural schematic diagram of a device for determining a page state of a memory page provided by the present application;
[0077] Fig.14 It is a structural schematic diagram of a computer device provided by the present application;
[0078] Fig.15 It is a structural schematic diagram of a device for determining the heat of a memory page provided by the present application;
[0079] Fig.16 It is a structural diagram of another storage medium access statistics device provided by the present application. DETAILED DESCRIPTION
[0080] In order to facilitate understanding of the specific implementation of the present application, some of the nouns involved in the specific implementation are introduced as follows.
[0081] Memory page: Divide the memory space into partitions of equal size. Each partition is a memory page. Each memory page is referred to by a physical page number. Different memory pages have different physical page numbers. Memory pages are also called physical blocks or page frames.
[0082] Virtual page: Divide the virtual address space of an application into regions of equal size. The size of each region is equal to the size of a memory page. Each region is a virtual page. Each virtual page is referred to by a virtual page number. Different virtual pages have different virtual page numbers. Virtual pages are also called pages or pages.
[0083] Virtual address (VA): an address in a virtual address space. The virtual address space includes multiple virtual addresses. A virtual address includes a virtual page number of a virtual page and an offset within the page. The offset within the page indicates the address offset of the virtual address in the virtual page.
[0084] Memory address: also known as physical address (PA), memory address is the address in the physical address space. The physical address space is the space provided by the memory (i.e., memory space). The physical address space includes multiple physical addresses. Each physical address includes a physical page number of a physical page and an offset within the page. The offset within the page indicates the address offset of the memory address in the memory page.
[0085] Hot page: refers to the memory page that is frequently accessed by the application. The data in the hot page is called hot data.
[0086] Cold page: refers to the memory page that is not frequently accessed by the application. The data in the cold page is called cold data.
[0087] Next, the implementation methods of the present application will be described in further detail with reference to the accompanying drawings.
[0088] The storage medium access statistics method provided in this application is applied to a computer system with hierarchical memory, such as Figure 1 As shown in the computer system architecture diagram with hierarchical memory, the computer system 100 includes a memory 101 of various media types, a central processing unit (CPU) 102 and an access statistics device 103 .
[0089] Among them, the memory 101 of multiple media types is different types of storage media. For example, the memory 101 of multiple media types is at least two of dynamic random access memory (DRAM), non-volatile memory (NVM), double data rate synchronous dynamic random access memory (DDR), static random access memory (SRAM) and high bandwidth memory (HBM), wherein NVM is such as phase change memory (PCM) and magnetic random access memory (MRAM), etc. In another possible implementation, the memory 101 of multiple media types may also include other types of storage media in addition to these, and there is at least one memory 101 of the same media type. Here, the present application does not limit the media type of each memory 101 in the computer system and the number of memories of the same media type.
[0090] Each memory 101 is also called main memory, such as Figure 1 As shown, any memory 101 can be provided by a medium module of at least one channel, and the medium module includes one or more memories. The medium types of the memories provided by the same medium module may be the same or different. In order to facilitate the interaction between the CPU 102 and a memory 101, Figure 1 Only one memory 101 of one media type is shown, and memories 101 of multiple media types are not shown.
[0091] The memories 101 of various media types all have memory levels, and the memory 101 of different media types have different memory levels, so that the memories 101 of various media types constitute a hierarchical memory in the computer system 100, wherein the memory 101 with higher data transmission efficiency with the CPU 102 has a higher memory level, and the memory 101 with lower data transmission efficiency with the CPU 102 has a lower memory level.
[0092] For a memory 101 of any memory level in the hierarchical memory, if there is a memory of the previous memory level of the memory 101 in the hierarchical memory (referred to as the previous level memory), the hot data stored in the hot page in the memory 101 can be migrated to the previous level memory, so that the processor core 21 in the CPU 102 can subsequently access the cache data of the hot page in the previous level memory, wherein the cache data of the hot page is the cache data of the memory page in the previous level memory, and the cache data may be the same as or different from the data stored in the hot page. If there is a memory of the next memory level of the memory 101 in the hierarchical memory (referred to as the next level memory), the cold data stored in the cold page in the memory 101 can be migrated to the next level memory to release the storage space of the cold page, so that the hot data of the next level memory can be cached to the cold page later.
[0093] For example, Figure 2 As shown, it is assumed that the hierarchical memory includes a primary memory, a secondary memory, and a tertiary memory, wherein the primary, secondary, and tertiary are three memory levels respectively, the primary is the highest memory level, and the tertiary is the lowest memory level. The hot data of at least one hot page with the most access times in the tertiary memory is migrated to the secondary memory, the hot data of at least one hot page with the most access times in the secondary memory is migrated to the primary memory, the cold data of at least one cold page with the least access times in the primary memory is migrated back to the secondary memory, and the cold data of at least one cold page with the least access times in the secondary memory is migrated back to the tertiary memory. When the processor core 21 has an access demand for a memory page in the tertiary memory, the processor core 21 first queries the cache data of the memory page in the primary memory. If the cache data of the memory page exists in the primary memory, the cache data of the memory page is accessed to implement the access to the memory page. If the cache data of the memory page does not exist in the first-level memory, the cache data of the memory page is queried in the second-level memory. If the cache data of the memory page exists in the second-level memory, the cache data of the memory page is accessed to implement the memory page. If the cache data of the memory page does not exist in the second-level memory, the memory page in the tertiary memory is accessed.
[0094] Figure 2 A hierarchical memory having three memory levels is used as an example. In another possible implementation, the hierarchical memory has two memory levels or more than three memory levels. Here, this application does not limit the number of memory levels in the hierarchical memory.
[0095] The access statistics device 103 is a module in the computer system 100 for implementing the access statistics method of the storage medium provided in the present application. The access statistics device 103 corresponds to any type of memory in the hierarchical memory, for example, the access statistics device 103 corresponds to the primary memory, or the access statistics device 103 corresponds to the secondary memory. When the processor core 21 accesses the memory page in the memory 101 corresponding to the access statistics device 103, the access request of the processor core 21 is sent to the memory 101, and the access statistics device 103 can obtain the memory address accessed by the access request, and record the number of accesses to the memory address, so as to count the number of accesses to the memory address.
[0096] In a possible implementation, obtaining the memory address and recording the number of accesses may be implemented by different modules in the access statistics device 103, such as Figure 1 As shown, the access statistics device 103 includes a collection module 31, a statistics module 32, a memory 33 and a compression module 34. The memory 33 is used to store the number of accesses to the accessed memory address, and the memory 33 is such as a random access memory (RAM), a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid state drive (SSD), etc., and the type of the memory 33 is not limited here.
[0097] like Figure 1 and Figure 3 As shown, assuming that the access statistics device 103 corresponds to any memory 101, the processor core 21 sends an access request to the memory 101, and the collection module 31 collects the memory address accessed by the access request from the access request, and sends the collected memory address to the statistics module 32. The memory 33 pre-selects and stores multiple access times. After receiving the memory address, the statistics module 32 stores the memory address locally, establishes a mapping relationship between the memory address and an access time recorded in the memory 33, and uses the access time as the access time of the memory address, and modifies the access time in the memory 33 into the actual access time of the memory address in a certain period of time (such as an access statistics cycle). For example, the statistics module 32 also instructs the memory 33 to modify the access time. After the memory 33 modifies the access time into the actual access time, it returns a modification completion response to the statistics module 32 to indicate that the modification of the access time is completed.
[0098] The processor core 21 reads the access statistics information of the memory 101 from the access statistics device 103, and the access statistics information includes each memory address that has been accessed and the number of times each memory address has been accessed recorded by the access statistics device 103. For example, the processor core 21 issues an instruction to the access statistics device 103 to upload the access statistics information, and the compression module 34 generates the access statistics information based on the instruction, based on the records of each memory address that has been accessed and the number of times each memory address has been accessed, performs data compression on the access statistics information, and uploads the compressed access statistics information to the processor core 21 to reduce the transmission overhead of the access statistics information. The processor core 21 provides the access statistics information to the target application, which is software having at least one of the following functions: based on the access statistics information of any memory 101, performing hot and cold identification on the memory pages that have been accessed in the memory; if any memory page is identified as a hot page, and there is an upper-level memory of the memory 101 in the hierarchical memory, the data of the memory page is migrated to the upper-level storage medium; if the memory page is identified as a cold page, and there is a lower-level memory of the memory 101 in the hierarchical memory, the data of the memory page is migrated to the lower-level memory.
[0099] Figure 1 The access statistics device 103 is independent of the CPU 102 and the memory 101 as an example. In another possible implementation, Figure 4 In the computer system 400 shown, the access statistics device 103 is integrated in the medium module where the access statistics device 103 corresponds to the memory 101, so that the access statistics device 103 can obtain the access request sent to the memory 101 nearby. Figure 5 In the computer system 500 shown, the access statistics device 103 is integrated in the CPU 102, so that the access statistics device 103 can obtain the access request issued by the processor core 21 to the corresponding memory 2101 in the CPU 102. In the case where the access statistics device 103 is located in the CPU 102, the access statistics device 103 can be integrated in the memory management unit (memory management unit, MMU), or, independent of the MMU. As another possible implementation, the access statistics device 103 can also be integrated in other types of processors or memory controllers other than the CPU 102, and the functions of the access statistics device 103 are realized by other types of processors or memory controllers.
[0100] Among them, computer system 100, computer system 400 and computer system 500 are similar, and the difference is that the location of access statistics device 103 is different. In addition, computer system 500 does not include compression module 34. For example, the storage location of memory address and the storage location of access count of memory address have been agreed between processor core 21 and access statistics device 103. Processor core 21 can read the accessed memory address and the access count of the accessed memory address from the agreed storage location. At this time, there is no need for compression module 34 to perform data compression. Among them, the agreed storage location can be a register or a storage space provided by a memory. In another possible implementation, the access statistics device 103 in computer system 100 and computer system 400 may also not include compression module 34.
[0101] The access statistics device 103 in the computer system 100 and the computer system 400 are both located outside the CPU 102. The method in which the processor core 21 reads the access statistics information from the access statistics device outside the CPU 102 is called an out-of-band reading method. The access statistics device 103 in the computer system 500 is located in the CPU 102. The method in which the processor core 21 reads the access statistics information from the access statistics device inside the CPU is called an in-band reading method. Compared with the out-of-band reading method, the processor core 21 can read the access statistics information faster through the in-band reading method, thereby improving the efficiency of the processor core 21 in obtaining the access statistics information. Compared with the in-band reading method, there is no need to set the access statistics device 103 in the CPU 102, which saves the cost of setting the access statistics device 103 in the CPU 102.
[0102] Computer system 100, computer system 400 and computer system 500 are all illustrated by taking the various modules in the access statistics device 103 as an example of being integrated in the same device. In another possible implementation, the various modules in the access statistics device 103 may also be dispersed in different devices in the computer system. For example, the acquisition module 31 in the access statistics device 103 is located in the corresponding memory 101, and the statistics module 32, the storage 33 and the compression module 34 are integrated together and independent of the memory 101 and the CPU 102. Here, the present application does not limit the location of the various modules in the access statistics device 103.
[0103] The computer systems described above are all described by taking the access statistics device 103 corresponding to a memory of a certain medium type as an example. In another possible implementation, each memory in the hierarchical memory may correspond to a different access statistics device 103, and each access statistics device 103 is responsible for collecting the memory addresses accessed by the access requests sent to the corresponding memory, and based on the collected memory addresses, counting the access statistics information of the corresponding memory, so that the target application can determine the hot data and / or cold data in the corresponding memory based on the access statistics information of the corresponding memory.
[0104] The computer system introduced above can be deployed in the same computer device or in a computer cluster, which includes multiple computer devices, each of which includes a processor 102. The individual memories 101 in the hierarchical memory can be located in different computer devices in the computer cluster or in the same computer device in the computer cluster. The access statistics device 103 is located in the computer device where the corresponding memory 101 is located.
[0105] Next, based on the computer system introduced above, the access statistics method of the storage medium provided in the present application and the process of determining the page status of the memory page based on the statistical results are introduced in detail.
[0106] Figure 6 This is a flow chart of a method for determining the page status of a memory page provided in the present application. The method is applied to any of the computer systems introduced above. The method is implemented through the interaction between an access statistics device in any of the computer systems and a processor core (called a target processor core) running a target application. The method includes the following steps.
[0107] 601. An access statistics device obtains a first memory address accessed by an access request to a storage medium.
[0108] The storage medium is the memory corresponding to the access statistics device in the hierarchical memory of the computer system, and the access request for the storage medium refers to any access request sent to the storage medium, and the access request carries the memory address to be accessed (i.e., the first memory address) to indicate read and write access to the first memory address of the storage medium, wherein the read and write access to the first memory address refers to reading data or writing data at the first memory address.
[0109] If any processor core in the computer system has a need to access the memory page in the storage medium, the processing core will send an access request to the MMU in the CPU where it is located. At this time, the access request carries the virtual address to be accessed. The MMU updates the virtual address in the access request to a memory address of the storage medium, and sends the access request with the updated address to the storage medium. The storage medium performs read and write access to the memory address based on the access request, and returns a read and write completion response in the original path. In this way, each access request for accessing the storage medium in the computer system will be sent to the storage medium.
[0110] The access statistics device is configured with an access statistics cycle. In each access statistics cycle, the access statistics device obtains each access request sent to the storage medium. Each time an access request is obtained, the memory address in the access request is parsed. The parsed memory address is the first memory address. The number of accesses to the first memory address is counted through the following steps 602 and 603. Since the access statistics device collects the memory addresses in each access request sent to the storage medium in the access statistics cycle, rather than collecting the memory addresses according to the sampling rate, it can avoid missing the sampling of the accessed memory addresses, and also avoid inaccurate access statistics information of the memory page caused by missing the sampling of the memory addresses.
[0111] 602. The access statistics device queries the first memory address from the mapping relationship between the memory addresses accessed by the storage medium and the number of accesses.
[0112] Among them, the memory address that has been accessed by the storage medium refers to the memory address parsed from the access request sent to the storage medium in an access statistical cycle, that is, the memory address that has been accessed by the storage medium. Before obtaining the first memory address, the storage medium may have at least one memory address that has been accessed, or it may have no memory address that has been accessed. A mapping relationship refers to a mapping relationship between an accessed memory address and the number of accesses to the memory address, and the number of accesses is the actual number of accesses to the memory address through the storage medium in an access statistical cycle.
[0113] In a possible implementation, the access statistics device records the mapping relationship between the memory addresses accessed by the storage medium and the number of accesses through an address table and an access statistics table, and the access statistics device queries the first memory address from the address table to implement this step 602.
[0114] The address table is used to record the memory addresses of the storage medium that have been accessed within an access statistics cycle, and the access statistics table is used to record the number of accesses to the memory addresses of the storage medium that have been accessed.
[0115] Table 1
[0116]
[0117]
[0118] Exemplarily, as shown in Table 1 above, the address table includes multiple address entries, for example, M address entries, where M is the address capacity of the address table and M is an integer greater than 0. An address entry is used to record a memory address that has been accessed in the storage medium. As shown in Table 1, an address entry includes a memory address that has been accessed in the storage medium and a valid identifier (VId), and the memory address in the address entry occupies multiple bits, such as the memory address "0x0004" in Table 1.
[0119] The valid flag is used to indicate whether the address entry is a valid address entry, and occupies 1 bit. As shown in Table 1, the valid flag is 1, indicating that the address entry is a valid address entry, and the memory address in the valid address entry is valid. The memory address is the memory address that the storage medium has been accessed in the current access statistical cycle. The number of accesses corresponding to the valid address entry in the access statistics table is valid, which is the number of accesses to the memory address in the valid address entry. The valid flag is 0, indicating that the address entry is an invalid address entry. The invalid address entry may have been filled with a memory address, or may not have been filled with a memory address. If the invalid address entry has been filled with a memory address, the memory address in the invalid address entry is invalid. The memory address is not the memory address that the storage medium has been accessed in the current access statistical cycle, but may be the memory address that the storage medium has been accessed before the current access statistical cycle. The number of accesses corresponding to the invalid address entry in the access statistics table is invalid and cannot be used as the number of accesses to the memory address in the invalid address entry. In another possible implementation, the valid flag is 0, indicating that the address entry is valid, and the valid flag is 1, indicating that the address entry is invalid. If the valid flag in an address entry indicates that the address entry is valid, then the address entry is a valid address entry. If the valid flag in an address entry indicates that the address entry is invalid, then the address entry is an invalid address entry.
[0120] As shown in Table 1, the access statistics table includes multiple access times (CNT), for example, M access times such as CNT(1) to CNT(M). The multiple access times are access times preset for each address entry in the address table, that is, any address entry in the address table corresponds to an access time in the access statistics table to indicate that the access time is the access time of the memory address recorded by the address entry. At the beginning of any access statistics cycle, each access time in the access statistics table is set to 0. In the access statistics cycle, each time a memory address is obtained, the access time corresponding to the memory address in the access statistics table is updated to count the access times of the memory address.
[0121] by Figure 7 Taking the migration process of hot data in the local statistics mode as an example, initially, the target processor core performs the following three configurations on the access statistics device:
[0122] The first configuration is to configure the access statistics mode of the access statistics device to a local statistics mode.
[0123] The access statistics mode refers to the statistics mode used by the access statistics device to count the access statistics information of the storage medium, and the local statistics mode refers to counting the number of accesses to M different memory addresses obtained continuously in one access statistics cycle.
[0124] The second configuration is to configure the address capacity M of the address table.
[0125] Among them, by configuring the address capacity M, the number of memory addresses recorded in the address table is controlled to control the storage space occupied by the address table, so as to avoid the address table occupying a large amount of storage space. When providing access statistics to the target application, at most M memory addresses and the number of accesses to the M memory addresses are transmitted to the target processor core, thereby reducing transmission overhead.
[0126] The third configuration is to configure the enabling method of the address collection function of the access statistics device.
[0127] For example, the access statistics device includes a threshold register, and a second number threshold is configured in the threshold register. If there is no access number greater than or equal to the second number threshold in the access statistics table, the address collection function is enabled, and the access statistics device implements address collection by executing the above step 601. If there is an access number greater than or equal to the second number threshold in the access statistics table, the address collection function is turned off and the address collection is stopped, thereby controlling the address collection time. For another example, the address table is configured as an enable switch for the address collection function. If there is an unused address entry in the address table, the access statistics device is enabled. If there is no unused address entry in the address table, the address collection function is turned off and the address collection is stopped, thereby controlling the address collection time. The valid identifier in the address entry is optional. If the address entry includes a valid identifier, the unused address entry refers to an invalid address entry. If the address entry does not include a valid identifier, the unused address entry refers to an empty address entry that is not filled with a memory address.
[0128] In a possible implementation, the address collection function is implemented by a collection module in the access statistics device, and the third configuration can be performed in the collection module. After the address collection function is enabled, the collection module implements address collection by executing the above step 601. After the address collection function is disabled, the address collection module stops address collection.
[0129] like Figure 7 As shown, after the configuration of the access statistics device is completed, at each access statistics cycle, the access statistics device queries whether the memory address in the address table is cleared, and queries whether the access count in the access statistics table is cleared. If the memory address exists in the address table, the memory address in the address table is cleared, and the valid flag in each address entry of the address table is set to 0, so as to set each address entry to an invalid address entry. If there is a non-zero access count in the access statistics table, the non-zero access count is set to 0, so as to achieve clearing the number of accesses in the access statistics table to 0. After the memory address in the address table is cleared and the access count in the access statistics table is cleared to 0, it is determined whether the address collection function is enabled. If it is not enabled, wait for the address collection function to be enabled. If the address collection function is enabled, the access statistics device performs address collection for each access request sent to the storage medium. Every time a memory address is collected, the memory address is used as the first memory address, and the address table is queried to see whether the first memory address exists. If the first memory address exists in the address table, the following step 603 is executed.
[0130] 603. If the first memory address exists in the memory addresses accessed by the storage medium, the access statistics device updates the number of accesses in the mapping relationship where the first memory address is located.
[0131] Among them, the number of accesses in the mapping relationship where the first memory address is located, that is, the number of accesses to the first memory address, and the updated number of accesses are the latest number of accesses to the first memory address in the current access statistics cycle. If the first memory address exists in the address table, that is, the first memory address exists in the memory addresses of the storage medium that have been accessed in the current access statistics, for the convenience of description, the address entry where the first memory address is located in the address table is called the first address entry, and the number of accesses corresponding to the first address entry in the access statistics table is the number of accesses to the first memory address.
[0132] by Figure 7 For example, the access statistics device queries whether there is a first memory address in the address table. If the first memory address exists in the address table, based on the mapping relationship between the address entry in the address table and the number of accesses in the access statistics, in the access statistics table, the number of accesses corresponding to the first address entry is increased by 1 to update the number of accesses to the first memory address.
[0133] If the first memory address does not exist in the address table, the access statistics device cannot query the first memory address. For example, when querying the first memory address, the memory addresses in the address table have been cleared, that is, the address table has not recorded the memory addresses of the storage medium that have been accessed in the current access statistics cycle, and the access statistics device cannot query the first memory address. For another example, when querying the first memory address, there are N memory addresses in the address table. If none of the N memory addresses is the first memory address, the first memory address cannot be queried, where N is greater than 0 and less than or equal to M. The N memory addresses are the memory addresses of the storage medium that have been accessed in the current access statistics cycle. If none of the N memory addresses is the first memory address, the first memory address does not exist in the memory addresses of the storage medium that have been accessed.
[0134] Next, for the case where the first memory address does not exist in the address table, the processing process of the first memory address is introduced as follows.
[0135] like Figure 7 As shown, if the first memory address does not exist in the address table, the access statistics device queries whether there is an unused address entry in the address table. Taking the address table including a valid identifier as an example, the address table is queried whether there is an invalid address entry including a valid identifier of 0. If there is an invalid address entry in the address table, the invalid address entry queried is an unused address entry. If there is no invalid address entry in the address table, then there is no unused address entry in the address table. Taking the address table not including a valid identifier as an example, the access statistics device queries whether there is an empty address entry in the address table. If there is an empty address entry in the address table, the empty address entry queried is an unused address entry. If there is no empty address entry in the address table, then there is no unused address entry in the address table.
[0136] Continue to refer Figure 7 After querying the unused address entries, if there are unused address entries in the address table, the access statistics device fills the first memory address in any unused address entry to update the unused address entry to the first address entry, and adds 1 to the number of accesses corresponding to the unused entry in the access statistics table to update the number of accesses to the first memory address. If the unused address entry also includes a valid flag, the valid flag is set to 1 to update the unused address entry to a valid address entry.
[0137] In any access statistical cycle (such as the current access statistical cycle), each time the access statistical device obtains a memory address, it executes the above steps 602 and 603 for the memory address. In this access statistical cycle, multiple different memory addresses will be obtained, and at most M different memory addresses will be recorded in the address table. For any memory address recorded in the address table, each time the memory address is obtained, the number of accesses to the memory address in the access statistical table is increased by 1. As the number of times the memory address is obtained increases, the value of the number of accesses to the memory address becomes larger and larger. In this way, the access statistical device can count the actual number of accesses to each memory address recorded in the address table in the access statistical cycle.
[0138] In the local access statistics mode, in any access statistics cycle, if there is no unused address entry in the address table, at this time, each address entry in the address table has been filled with a memory address. If a memory address that does not exist in the address table is obtained, the access statistics device can report it to the target processor core so that the target processor core can read the access count of each collected memory address as soon as possible. Figure 7 In the local access statistics mode, if the first memory address does not exist in the address table (i.e., the first memory address does not exist in the memory addresses that have been accessed by the storage medium), and there is no unused address entry in the address table, the access statistics device stops address collection, sends a first interrupt message to the target processor core, and enters the data return process, wherein the first interrupt message indicates that all address entries in the address table have been used, resulting in an access statistics interruption. In order for the target processor core to read the memory address in the address table and the number of accesses in the access statistics table as soon as possible, so that the access statistics device can initialize the address table and the access statistics table as soon as possible, and then based on the initialized address table and access statistics table, can count the accesses to the memory addresses subsequently obtained as soon as possible.
[0139] In another possible implementation, the target processor core may also send a stop collection instruction to the access statistics device to instruct the access statistics device to stop address collection. Figure 7 As shown, within an access statistics cycle, after the number of accesses to the first memory address is updated in the access statistics table, if a stop collection instruction is received, the access statistics device stops address collection and enters the data return process.
[0140] In another possible implementation, when the threshold register is configured with a second count threshold, if there is an access count greater than or equal to the second count threshold among the multiple access counts in the access statistics table, the access statistics device stops address collection and sends a second interrupt message to the target processor core, where the second interrupt message indicates that the access count of a memory address greater than or equal to the second count threshold causes the access statistics to be interrupted. For example, if the access count of a memory address is greater than or equal to the second count threshold, the address collection is stopped. Figure 7 As shown, after the access count of the first memory address is updated in the access statistics table, if no stop collection instruction is received, it is determined whether the access count of the first memory address after the update reaches (i.e., whether it is greater than or equal to) the second count threshold. If the second count threshold is reached, the access statistics device stops address collection, sends a second interrupt message to the second processor core, and enters the data return process. If the access count of the first memory address after the update does not reach the second count threshold, the access statistics device continues to collect addresses. In another possible implementation, if there are K access counts greater than or equal to the second count threshold in the access statistics table, it may also trigger the access statistics device to stop address collection and send a second interrupt message to the target processor core, where K is greater than 1 and less than or equal to M. The value of K can be configured by the target processor core. Here, this application does not limit the value of K.
[0141] For this implementation, after the number of accesses reaching the second number threshold exists in the address table, an interrupt message is sent to the target processor core to notify the target processor core that the access statistics of the storage medium have been interrupted, so that the target processor core can read the memory address in the address table and the number of accesses in the access statistics table as soon as possible, so that the second processing core can determine the hot data in the storage medium based on the number of accesses reaching the second number threshold, without the target processor core waiting for the access statistics cycle to end or waiting for the address table to be filled, thereby improving the efficiency of the target processor core in determining hot data.
[0142] The process shown in the above steps 601 to 603 is the flow of the access statistics method for the storage medium executed by the access statistics device, that is, the access statistics flow of the storage medium in the local statistics mode. In the local statistics mode, the address table is the address window in the local statistics mode, and the access statistics table is the access statistics window in the local statistics mode. In any access statistics cycle, each time a memory address is collected, if the memory address does not exist in the address table, and there is an unused address entry in the address table, the access statistics device fills the memory address in the unused address entry to update the memory address stored in the address table according to the memory address. If the memory address exists in the address table, and there is no unused address entry in the address table, a first interrupt message is sent to the target processor core to suspend address collection. After the address table is cleared, address collection is continued. In this way, the address table can record the various memory addresses that have been accessed by the storage medium in the access statistics cycle, so that the address table with fixed address entries can achieve the role of a global address window. Therefore, in the local statistics mode, the address table is a global address window, which is used to store the various memory addresses that have been accessed by the storage medium in the access statistics cycle.
[0143] In the local statistics mode, each time the access statistics device obtains a first memory address, it obtains an updated address table according to the memory address stored in the update address table. For example, if the first memory address does not exist in the memory addresses stored in the address table and there is an unused address entry in the address table, the first memory address is filled in the unused address entry. The access statistics device updates the number of accesses stored in the access statistics table according to the first memory address to obtain an updated access statistics table. For example, if the first memory address exists in the memory addresses stored in the address table, the number of accesses of the first memory address in the access statistics table is increased by 1. For another example, if the first memory address is filled in the unused address entry, the number of accesses corresponding to the unused address entry in the access statistics table is set to 1. With the update of the address table and the address access statistics table, the subsequent access statistics device sends the access statistics information of the storage medium to the target processor core according to the memory address in the updated address window and the number of accesses in the updated access statistics window, and the target processor core identifies at least one memory page among the hot page, the cold page and the warm page in the storage medium according to the access statistics (such as the following steps 604 and 605).
[0144] 604. After the first period of time, the access statistics device sends access statistics information of the storage medium to the target processor core based on the latest access count of the memory address accessed by the storage medium.
[0145] Among them, the first duration is the duration from the start time of an access statistical cycle to the end time of address collection of the access statistical cycle. The address collection end time may be the end time of the access statistical cycle or the time before the end time of the access statistical cycle.
[0146] Based on the configuration of the access statistics device, at the end of an access statistics cycle, when a stop collection instruction is received or when there is an access count greater than or equal to the second count threshold in the access statistics table, the access statistics device may be triggered to stop address collection and send an interrupt message (such as the first interrupt message or the second interrupt message) to the target processor core to indicate the access statistics interrupt and enter the data return process. Figure 7 As shown, in the data return process, after receiving an interrupt message or an access statistics cycle ends, the target processor core sends an information read request to the access statistics device, and the information read request indicates to read the access statistics information of the storage medium. After the access statistics device obtains the access information read request, it sends the access statistics information to the target processor core based on each memory address that has been accessed by the storage medium and the latest access count of each memory address to realize data return.
[0147] After the address collection is completed, the access statistics device will no longer add new memory addresses to the address table, nor will it update the number of accesses in the access statistics table. The memory address recorded in the current address table is the memory address that the storage medium has been accessed after the first period of time, and the number of accesses recorded in the access statistics table is the latest number of accesses to the corresponding memory address after the first period of time. Based on this, the access statistics device generates access statistics information based on each memory address recorded in the address table and the number of accesses to each memory address in the access statistics table. The access statistics information includes each memory address that the storage medium has been accessed and the number of accesses to each memory address within the first period of time.
[0148] After generating the access statistics information, the access statistics device sends an information read response carrying the access statistics information to the target processor core. Alternatively, if the access statistics device also has a data compression function, after generating the access statistics information, the access statistics device performs data compression on the access statistics information to obtain compressed access statistics information, and sends an information read response carrying the compressed access statistics information to the target processor core to reduce the transmission overhead of the access statistics information.
[0149] 605. The target processor core receives access statistics information, and determines, based on the access statistics information, a page status of a memory page to which the memory address accessed by the storage medium belongs, where the page status is used to indicate the access heat of the memory page.
[0150] The memory page to which the accessed memory address belongs is the memory page that has been accessed by the storage medium within the first time period. In a possible implementation, the page state is divided into a hot page state, a cold page state, or a warm page state, wherein the warm page state is an optional state, and different page states indicate different degrees of heat, for example, the degrees of heat indicated by the cold page state, the warm page state, and the hot page state increase in sequence, when the memory page is in the hot page state, the memory page is a hot page, when the memory page is in the cold page state, the memory page is a cold page, and when the memory page is in the warm page state, the memory page is a warm page.
[0151] If the upper level memory of the storage medium exists in the hierarchical memory, the target processor core determines whether the page state of the memory page accessed by the storage medium is a hot page state based on the access statistics information, that is, determines whether the accessed memory page is a hot page. If the upper level memory does not exist in the hierarchical memory, the target processor core does not need to determine whether the accessed memory page is a hot page.
[0152] Assuming that the previous level of memory exists in the hierarchical memory, continue to refer to Figure 7 After receiving the access statistics information (compressed or uncompressed) of the storage medium, the target processor core parses the access statistics information to obtain multiple memory addresses that have been accessed by the storage medium and the access times of the multiple memory addresses, and determines the hot pages in the storage medium based on the access times of the multiple memory addresses. For example, for the memory addresses belonging to the same memory page among the multiple memory addresses, if the sum of the access times of the memory addresses of the same memory page is greater than or equal to the third number threshold, the memory page is determined to be a hot page. For each hot page in the storage medium, the target processor core migrates the hot data in each hot page to the upper-level memory, such as migrating to the cold page in the upper-level memory. Here, the determination method and determination process of the cold page in the upper-level memory are not limited. Alternatively, the target processor core uses the sum of the access times of the memory addresses of the same memory page as the total access times of the memory page, uses the P (P≥1) hot pages with the highest total access times as the hot pages to be migrated, and migrates the hot data in each hot page to be migrated to the upper-level memory.
[0153] If the next level memory of the storage medium exists in the hierarchical memory, the target processor core determines whether the page state of the memory page accessed by the storage medium is a cold page state based on the access statistics information, that is, determines whether the accessed memory page is a cold page. If the next level memory does not exist in the hierarchical memory, the target processor core does not need to determine whether the accessed memory page is a cold page.
[0154] Assuming that the next level memory exists in the hierarchical memory, after parsing the multiple memory addresses that have been accessed by the storage medium and the access times of the multiple memory addresses from the access statistics information, the target processor core determines the cold pages in the storage medium based on the access times of the multiple memory addresses. For example, for the memory addresses belonging to the same memory page among the multiple memory addresses, if the sum of the access times of the memory addresses of the same memory page is less than or equal to the fourth time threshold, the memory page is determined to be a cold page, and if there is an unaccessed memory page in the storage medium, the target processor core also determines the unaccessed memory page as a cold page. For each cold page in the storage medium, the target processor core migrates the cold data in each cold page to the next level memory, or the target processor core uses the sum of the access times of the memory addresses of the same memory page as the total access times of the memory page, the total access times of the unaccessed cold pages is 0, and the Q (Q ≥ 1) cold pages with the lowest total access times are used as cold pages to be migrated, and the cold data in each cold page to be migrated is migrated to the next level memory. The fourth number threshold is greater than or equal to 0 and less than the third number threshold.
[0155] The above is explained by taking the example that after the target processor core determines the cold pages and / or hot pages in the storage medium based on the access statistics, the cold data in the cold pages and the hot data in the hot pages are migrated. In another possible implementation, the target processor core is responsible for determining the page status of the memory page in the storage medium, but is not responsible for migrating the cold data and / or hot data.
[0156] In another possible implementation, the target processor core determines whether the page state of the memory page accessed by the storage medium is a warm page state based on the access statistics information, that is, determines whether the memory page accessed is a warm page. Exemplarily, after parsing the multiple memory addresses accessed by the storage medium and the number of accesses to the multiple memory addresses from the access statistics information, the target processor core determines the warm page in the storage medium based on the number of accesses to the multiple memory addresses. For example, for the memory addresses belonging to the same memory page among the multiple memory addresses, if the sum of the number of accesses to the memory addresses of the same memory page is greater than the fourth number threshold and less than the third number threshold, the memory page is determined to be a warm page, and the data in the warm page is called warm data. Compared with hot data, the warm data in the storage medium will not be frequently accessed. Compared with cold data, the warm data in the storage medium is frequently accessed. Generally, the hot data will be migrated to the upper level memory, the cold data will be migrated to the lower level memory, the warm data in the storage medium will be retained, and the warm data will not be migrated to other storage media. In another possible implementation, since no data migration is performed on warm data, the target processor core may not execute the step of determining whether the accessed memory page is a warm page.
[0157] The above steps 604 and 605 are both explained by taking the access statistical information including multiple memory addresses that have been accessed by the storage medium and the access counts of the multiple memory addresses as an example. In another possible implementation, the access statistical information includes the memory addresses (i.e., page addresses) of the memory pages that have been accessed by the storage medium and the total access counts of the respective memory pages, but does not include the accessed memory addresses in the accessed memory pages and the access counts of the memory addresses in the memory pages, thereby reducing the number of memory addresses and the number of access counts in the access statistical information, reducing the amount of data in the access statistical information, and thereby reducing the transmission overhead of the access statistical information.
[0158] Exemplarily, in step 604, for each memory address in the same memory page in the address table, the access statistics device determines the sum of the access times of each memory address in the same memory page as the total access times of the memory page, so as to obtain the total access times of each memory page accessed by the storage medium, and based on the page addresses of each memory page accessed and the total access times of each memory page, generates access statistics information, and sends the access statistics information to the second processing core. In step 605, the second processing core obtains the total access times of each memory page accessed by the storage medium from the access statistics information, and determines the page status of each memory page based on the total access times of each memory page. The target processor core does not need to calculate the total access times of each memory page accessed by the storage medium, which reduces the calculation amount of the target processor core.
[0159] In the related art, the access statistics information (referred to as existing access statistics information) obtained by the target processor core includes the total number of accesses to each memory page of the storage medium and the page address of each memory address. If there is no need to determine the cold pages in the storage medium, the memory pages that have not been accessed must be cold pages. Then, the page addresses and the total number of accesses to the memory pages that have not been accessed in the existing access statistics information are redundant information or invalid information, and the page addresses and the total number of accesses to the memory pages that have been accessed are valid information. In the case where the access statistics information sent in the present application includes the page addresses of the memory pages that have been accessed and the total number of accesses to the memory pages, the target processor core is provided with the valid information required to determine the hot pages and / or cold pages, thereby increasing the proportion of valid information in the access statistics information and increasing the information entropy of the access statistics information, wherein the information entropy is used to reflect the proportion of valid information in the access statistics information.
[0160] The above is explained by taking the target processor core determining the page status of the memory page that has been accessed by the storage medium based on the access statistics information as an example. In another possible implementation, the page status of the memory page that has been accessed is determined by the access statistics device. Exemplarily, the access statistics device determines the heat of the memory page in the storage medium based on the memory address in the updated address table and the number of accesses in the updated access statistics table. For example, after a first period of time, the access statistics device determines the page status of the memory page that has been accessed by the storage medium based on the latest number of accesses to the memory address that has been accessed by the storage medium, and generates access statistics based on the page status of each memory page that has been accessed by the storage medium and the page address of each memory page. At this time, the access statistics include the page status identifier of each memory page that has been accessed and the page address of each memory page. The access statistics device sends the access statistics to the target processor core. In step 605, the second processing core obtains the page status identifier of each memory page that has been accessed by the storage medium from the access statistics information. Based on the indication of the page status identifier of each memory page, the second processing core can learn the page status of each memory page. There is no need to determine the page status of each memory page based on the total number of accesses to each memory page, thereby reducing the computational complexity of the target processor core.
[0161] Figure 6 The provided method records the access count of the accessed memory address through the mapping relationship between the memory address accessed by the storage medium and the access count. After obtaining the memory address accessed by the access request for the storage medium, the obtained memory address is queried from the mapping relationship. If the obtained memory address exists in the memory address accessed by the storage medium, the access count of the memory address in the mapping relationship is updated to obtain the latest access count of the memory address. As the obtained memory address increases, the actual access count of the memory address accessed by the storage medium can be accurately obtained, and then based on the actual access count of the memory address accessed by the storage medium, the page status of the memory page accessed by the storage medium can be accurately identified. In addition, the address capacity of the address table is limited, and the storage space occupied by the address table is small. The address table records the memory addresses that have been accessed, so that the hot pages in the storage medium can be accurately determined by using less storage space.
[0162] Above Figure 6 and Figure 7All of them are explained by taking the access statistics device according to the local statistics mode to count the access statistics information of the corresponding storage medium as an example. In another possible implementation method, the access statistics device also supports a statistical method that expands the local statistics mode into a global statistics mode to count the access statistics information of the corresponding storage medium, wherein the global statistics mode refers to counting the M memory addresses with the highest access popularity within the access statistics period, and these M memory addresses are also the global hottest memory addresses in the access statistics period, and M is greater than 1. Among them, the access popularity can be reflected by two dimensions, one dimension is the number of accesses, and the other dimension is the most recent access. For example, the higher the number of accesses to a memory address, the higher the access popularity of the memory address, and the hotter the memory address is. However, if the number of accesses is ignored, the more recently the memory address is accessed, the higher the access popularity of the memory address, and the hotter the memory address is.
[0163] Assume that M=1000, and the storage medium has been accessed 10,000 memory addresses in a certain access statistical cycle. The global statistical mode is used to count the 1,000 most popular memory addresses from these 10,000 memory addresses. The global statistical mode involves an address window, which is used to store the memory addresses that have been accessed by the storage medium. The address capacity of the address window is M. If the number of memory addresses that have been accessed by the storage medium in an access statistical cycle exceeds M, the address window can store at most M memory addresses that have been accessed, and cannot store each memory address that has been accessed. Therefore, the address window is also called a local address window. In an access statistical cycle, each time a memory address that has been accessed by the storage medium is obtained, the access statistical device records the memory address in the address window until the address window is filled with memory addresses, and adopts a swap-in and swap-out mechanism to swap out the memory address with the lowest access heat in the address window, and swap the newly obtained memory address into the address window until the access statistical cycle ends. In this way, at the end of the access statistical cycle, the memory address retained in the address window is the memory address with the highest number of accesses in the access statistical cycle, and can be considered as the global hottest memory address in the access statistical cycle. If a new memory address is swapped into the address window in a short time before the end of the access statistical cycle, since the access statistical time of the new memory address is relatively short, the number of accesses to the new memory address in the access statistical cycle may be low, but the new memory address is the most recently accessed. At this time, at the end of the access statistical cycle, the memory addresses retained in the address window are partly the memory addresses with the highest number of accesses in the access statistical cycle, and partly the memory addresses with the most recently accessed. These retained memory addresses can also be considered as the global hottest memory addresses in the access statistical cycle. This global statistical mode is equivalent to the memory addresses of the storage medium accessed in the access statistical cycle forming a global address sequence, and performing a sliding window operation on the address window on the address sequence so that the address window slides from the first memory address of the address sequence to the last memory address, thereby making the address window logically become a global address window. During the sliding process, the swap-in and swap-out mechanism is used to retain the global hottest memory address in the address sequence in the address window. Therefore, the global statistical mode also refers to counting the access statistical information of the corresponding storage medium in a sliding window manner in an access statistical cycle.
[0164] Before the access statistics device uses the global access statistics mode to perform access statistics on the storage medium, the target processor core performs the following three configurations on the access statistics device during the process of running the target application:
[0165] The first configuration is to configure the access statistics mode of the access statistics device to the global statistics mode.
[0166] For example, the access statistics device does not have a default access statistics mode, the access statistics mode includes a local statistics mode and a global statistics mode, and the global statistics mode is configured as the access statistics mode of the access statistics device.
[0167] In other embodiments, the access statistics device has a default access statistics mode, and the default access statistics mode does not support modification or configuration. For example, the local statistics mode or the global statistics mode is the default access statistics mode of the access statistics device, and in this case, there is no need to configure the access statistics mode of the access statistics device. When counting the memory addresses accessed by the storage medium, the access statistics device can perform statistics according to the default access statistics mode.
[0168] In other embodiments, the access statistics device has a default access statistics mode, and the default access statistics mode supports modification or configuration. For example, initially, the local statistics mode or the global statistics mode is the default access statistics mode of the access statistics device. Later, according to business needs, the default access statistics mode can be configured to: a non-default access statistics mode in the local statistics mode and the global statistics mode. Later, when counting the memory addresses of the storage medium being accessed, the access statistics device performs statistics according to the newly configured access statistics mode. Of course, later, according to new business needs, the access statistics mode can also be configured from the non-default access statistics mode back to the default access statistics mode. Accordingly, when counting the memory addresses of the storage medium being accessed, the access statistics device performs statistics according to the default access statistics mode.
[0169] The second configuration is to configure the address capacity M of the address window.
[0170] The address window includes M address entries, each of which is used to record a memory address that has been accessed by the storage medium. The address window can be the address table described above. Fig.11 For example, the address table 36 with an address capacity of M is an address window. The process of configuring the address capacity M of the address window is the same as the second configuration process introduced in step 602, and will not be repeated here.
[0171] In hardware implementation, the address window is implemented by content addressable memory (CAM), for example, Fig.11CAM35 stores an address table 36 as an address window. CAM is an associative memory with a fully associative structure. In hardware implementation, the address window may also be implemented by associative memories of other associative structures, such as group associative structures, cluster associative structures, or skewed associative structures. Compared with associative memories of other associative structures, CAM can store more data with a smaller chip footprint. Therefore, when the address capacity M is constant, compared with associative memories of other associative structures, implementing the address window through CAM can reduce the chip footprint of the address window. In another possible implementation, the address window can also be implemented by a hash structure, such as cuckoo hash and other hash structures. Here, the embodiment of the present application does not limit the hardware implementation of the address window.
[0172] For ease of description, the memory used to implement the address window is referred to as the first memory. In a possible implementation, the address capacity M of the address window can determine the type of the first memory. For example, the address capacity M of the address window is determined by the following determination method 1 or determination method 2. Based on the expected chip area and the address capacity M, an associative memory is selected from the CAM and other associative memories of the associative structure as the first memory, and an address table with an address capacity of M is created in the first memory, which is also the address window. Among them, the selected first memory can meet the dual requirements of the expected chip area and the address capacity M. The expected chip area refers to the expected chip area of the first memory, and the address capacity M is the number of memory addresses that the first memory can store, which is also the maximum address capacity of the address table. Based on this possible implementation, when configuring the address capacity M of the address window, the target processor core obtains the address capacity of the first memory in the access statistics device, and configures the address capacity of the first memory as the address capacity M of the address window.
[0173] Determination method 1: determining the address capacity M based on the migration bandwidth used when performing hot data migration on the corresponding storage medium.
[0174] Among them, hot data migration refers to migrating data in hot pages. Different migration bandwidths correspond to different address capacities M. For example, if the migration bandwidth is 1 million bits per second (M / s), the corresponding address capacity M is 1000, and if the migration bandwidth is 2M / s, the corresponding address capacity M is 2000. The migration bandwidths used by different types of storage media may be the same or different. Based on this, the target processor core determines the address capacity M corresponding to the migration bandwidth of the storage medium as the address capacity of the address window of the access statistics device corresponding to the storage medium.
[0175] By determining the address capacity M determined by method 1, the number of memory addresses in the address window can meet the migration bandwidth requirements of the storage medium, so that the bandwidth can be effectively utilized, avoiding the ineffective use of bandwidth due to too many or too few memory addresses in the address window. For example, since the total bandwidth is fixed, if there are too many memory addresses in the address window, the hot data to be migrated will increase, and the required migration bandwidth will increase, which will occupy more bandwidth and affect other applications, making the bandwidth ineffective. If there are too few memory addresses in the address window, the hot data to be migrated will decrease, the occupied migration bandwidth will decrease, and part of the bandwidth will be wasted, making the bandwidth ineffective.
[0176] Determination method 2: determining the address capacity M based on the characteristics of the first application program accessing the memory (ie, the memory access characteristics).
[0177] Among them, the first application is a key application or a hot application in the application scenario where the storage medium is located. The key application refers to the application that provides key business services in the application scenario, and the hot application refers to the application that is frequently used in the application scenario. The application scenario can be a cloud scenario or a non-cloud scenario. The memory access feature is, for example, the expected number of hot pages, wherein the expected number of hot pages refers to the number of hot pages that the first application expects to determine from the storage medium, and different expected numbers of hot pages correspond to different address capacities M. The expected number of hot pages is less than the corresponding address capacity M. For example, the expected number of hot pages is 500, and the corresponding address capacity M can be 1000. The expected number of hot pages is 1000, and the corresponding address capacity M can be 2000.
[0178] Exemplarily, different types of applications have different expected numbers of hot pages, or different applications have different expected numbers of hot pages. The address capacity corresponding to the expected number of hot pages of the application served by the storage medium is determined as the address capacity M of the address window, so that the address window can meet the hot page requirements of different applications.
[0179] In another possible implementation, an address table is stored in the first memory, the target processor core uses the address table as an address window, and configures the maximum address capacity of the address table as the address capacity M of the address window. When the subsequent access statistics device performs access statistics on the storage medium, based on the configured address capacity M, the M address entries of the address table in the first memory are used as the address window, and the memory addresses of the storage medium that have been accessed are recorded in the address window.
[0180] The global statistics mode also involves an access statistics window corresponding to the address window. Similarly, in the global statistics mode, the access statistics window is a local statistics window used to record the number of accesses to each memory address in the address window. For example, the access statistics window includes M access times, and the M access times correspond to different address entries in the address window, and each access time is the access count of the memory address in the corresponding address entry. Accordingly, M is the access times capacity of the access statistics window. The access statistics window can be the access statistics table introduced above, and the access statistics table can be stored in a memory. For ease of description, the memory storing the access statistics table is referred to as a second memory. Subsequently, when the access statistics device performs access statistics on the storage medium, based on the address capacity M of the configured address window, the M access times of the access statistics table in the second memory are used as the access statistics window. Each time a memory address is stored in the address window, the number of accesses corresponding to the address entry where the memory address is located in the access statistics window is used as the number of accesses to the memory address.
[0181] The third configuration is to configure the enabling method of the address collection function of the access statistics device.
[0182] Among them, this configuration can refer to the third configuration introduced in step 602, and will not be repeated here.
[0183] After the access statistics device is configured, the access statistics device performs access statistics on the corresponding storage medium through the global statistics mode. Figure 8 The flowchart of a method for determining the heat of a memory page provided by the present application is shown, and the global statistical model is introduced in detail.
[0184] 801. An access statistics device obtains a first memory address accessed by an access request to a storage medium.
[0185] Here, step 801 is the same as step 601, and step 801 will not be described in detail here.
[0186] like Fig. 9As shown, after the configuration of the access statistics device is completed, taking the address window as the address table and the access statistics window as the access statistics table as an example, at each access statistics cycle, the access statistics device first queries whether the memory address in the address table is cleared, and queries whether the access count in the access statistics table is cleared to 0. If the memory address exists in the address table, the memory address in the address table is cleared, and the valid flag in each address entry in the address table is set to 0, so as to set each address entry to an invalid address entry. If there is a non-zero access count in the access statistics table, the non-zero access count is set to 0. After the memory address in the address table is cleared and the access count in the access statistics table is cleared to 0, it is determined whether the address collection function is enabled. If it is not enabled, wait for the address collection function to be enabled. If the address collection function is enabled, the access statistics device performs address collection for each access request sent to the storage medium. Every time a memory address is collected, the memory address is taken as the first memory address, and the address table is queried whether the first memory address exists. If the first memory address exists in the address table, the number of accesses corresponding to the first address entry is increased by 1 in the access statistics table to update the number of accesses to the first memory address. If the first memory address does not exist in the address table, the access statistics device queries whether there is an unused address entry in the address table. If there is an unused address entry in the address table, Figure 7 If the first memory address does not exist in the address table (i.e., the first memory address does not exist in the memory addresses that have been accessed by the storage medium), and there is no unused address entry in the address table, the access statistics device performs step 802 to replace a memory address in the address table with the first memory address.
[0187] As the number of collected memory addresses increases, the address window is gradually filled with memory addresses. In order to distinguish the newly collected memory addresses from the memory addresses in the address window, the newly collected memory addresses are referred to as first memory addresses, and the memory addresses in the address window are referred to as second memory addresses, wherein the first memory address in step 801 is also the newly collected memory address, i.e., the memory address to be counted.
[0188] 802. The access statistics device updates the memory address stored in the address window according to the first memory address to obtain an updated address window, where the address window is used to store the memory addresses accessed in the storage medium in a recent period of time.
[0189] The most recent time period refers to: a time period from the start time of the access statistical cycle to the current time, or a time period from a certain time after the start time to the current time.
[0190] In the global statistics mode, the address window is a local address window. When the address window is full of second memory addresses, if the first memory address does not exist in the second memory addresses stored in the address storage window, the access statistics device can update a second memory address in the address window to the first memory address to store the latest accessed memory address in the address window, so that the address window stores the memory addresses that have been accessed in the storage medium in the most recent time period. Exemplarily, the processing process in this case is described as follows through the following steps 8021 to 8022.
[0191] Step 8021: If the address window has stored M second memory addresses, and the first memory address does not exist among the M second memory addresses, the access statistics device determines a third memory address based on the first access count of the M second memory addresses, and the third memory address is the memory address with the lowest access popularity among the M second memory addresses, and M is the address capacity of the address window, and M is greater than 1.
[0192] The first access count of any second memory address is the access count of the second memory address recorded in the access statistics window. The third memory address is a memory address to be swapped out (ie, to be eliminated) in the address window.
[0193] Taking a first memory address to be counted as an example, after obtaining the first memory address, the access statistics device queries whether the first memory address exists in the address window. If the first memory address exists, the access count of the first memory address in the access statistics window is increased by 1. If the first memory address does not exist in the address window, the address window is queried whether there is an unused address entry. If there is an unused address entry in the address window, it means that the address window has not yet stored M second memory addresses. The access statistics device stores the first memory address in the unused address entry, and the access count corresponding to the unused address entry is set to 1, so as to use the access count corresponding to the unused address entry in the access statistics table as the access count of the first memory address, so that the first memory address becomes the new second memory address. If there is no unused address entry in the address window, it means that M second memory addresses have been stored in the address window, and the first memory address does not exist in the M second memory addresses, then the access statistics device determines the third memory address based on the first access count of the M second memory addresses.
[0194] In a possible implementation, the access statistics device determines the third memory address by attenuation, such as the following steps A1 and A2.
[0195] A1. The access statistics device performs attenuation processing on the first access times of M second memory addresses.
[0196] The attenuation degree of each first access number is determined by the attenuation constant used in the attenuation processing, and the attenuation constant is represented by A. The attenuation constant A refers to the attenuation coefficient used when performing the sliding window attenuation operation in the global statistical mode. The sliding window attenuation operation refers to the sliding window operation based on the attenuation method. The sliding window attenuation operation includes step A1, step A2 and step 8022. When the target processing core configures the access statistical mode of the access statistical device to the global statistical mode, it also configures the attenuation constant A for the global statistical mode, so that the access statistical device performs attenuation processing on the first access numbers of the M second memory addresses according to the attenuation strategy based on the configured attenuation constant A, and obtains M attenuated first access numbers, wherein the attenuation strategy can be linear attenuation, exponential attenuation or nonlinear attenuation. For example, the attenuation strategy is represented by the following formula (1).
[0197]
[0198] Wherein, C0 is the first access count of any second memory address, and C1 is the decayed C0.
[0199] As another example, the attenuation strategy is represented by the following (2).
[0200] C t1 =AC t0 -B, Δt=t1-t0, t1>t0, 0<A<1 (2)
[0201] Among them, time t0 and time t1 are different logical times. Logical time can be wall clock time or event-driven time. Taking wall clock time as an example, 9:50 is time t0 and 9:51 is time t1. Taking event-driven time as an example, assuming that 100 memory addresses are collected as events driving time, and each time 100 memory addresses are collected is a time, then 100 memory addresses are collected as time t0, and then 100 memory addresses are collected as time t1. t0 is any access count in the access statistics window at time t0 (i.e., the first access count), C t1 It is C t0 The number of accesses after decay from time t0 to time t1, Δt is the logical time between time t0 and time t1, B is the cardinality, and there is no limit on the value of B. The above formulas (1) and (2) may also have other variant formulas, and here, this application does not limit the formula of the decay strategy.
[0202] After obtaining M decayed first access counts, the access statistics device also replaces the first access counts of the M second memory addresses with their respective decayed first access counts, so as to use the decayed first access counts as the access counts of the corresponding second memory addresses.
[0203] Assume that the access statistics window is the access statistics table, the access times in the access statistics table are all the first access times, and the decay strategy is expressed by the above formula (1). Fig. 9 For example, if the first memory address does not exist in the address table, and there is no unused address entry in the address table, that is, the first memory address does not exist in the M second memory addresses, based on this, the access statistics device divides all access times in the access statistics table (that is, the first access times) by the attenuation constant A to achieve attenuation processing on each access number. For any access number, the quotient of the access number divided by the attenuation constant A is used as the attenuated access number, and the access number in the access statistics table is updated to the quotient of the access number divided by the attenuation constant A.
[0204] Take the attenuation constant A = 2 as an example, see Fig.10 In the sliding window semi-decay replacement process of the access statistics table shown, when the first memory address does not exist in the address table and there is no unused address entry in the address table, the access statistics device divides the access counts in the access statistics table by 2, and replaces the original access counts with the quotients of the access counts after the division by 2. For example, after the access count of 1 is divided by 2, the quotient is 0, and 0 replaces the access count of 1.
[0205] A2. If the first access count of any second memory address decays to the first access count threshold, the access statistics device determines the any second memory address as the third memory address.
[0206] The first access count threshold is an integer greater than or equal to 0, and the value of the first access count threshold is not limited. The first access count decays to the first access count threshold, including the decayed first access count being less than or equal to the first access count threshold.
[0207] After replacing each first access count in the access statistics window with the attenuated first access count, the access statistics device queries whether there is an access count less than or equal to the first access count threshold in the access statistics window. If not, the first memory address is discarded and the execution of step 801 is jumped, or the access count in the access statistics window is attenuated again until there is an access count less than or equal to the first access count threshold in the access statistics window. If there is an access count less than or equal to the first access count threshold in the access statistics window, the second memory address to which any access count less than or equal to the first access count threshold belongs is determined as the third memory address. With the first access count threshold being 0, if a first access count in the access statistics window decays to 0, then the first access count is an access count with a smaller value in the access statistics window, and the second memory address to which the first access count belongs is determined as the third memory address.
[0208] Step 8022: The access statistics device updates the third memory address in the address window to the first memory address.
[0209] Each time the access statistics device obtains a first memory address, it updates the number of accesses stored in the access statistics window according to the first memory address to obtain an updated access statistics window. For example, if the first memory address exists in the memory addresses stored in the address window, the number of accesses of the first memory address in the access statistics window is increased by 1. For another example, the access statistics device updates the third memory address in the address window to the first memory address, and updates the number of accesses of the third memory address in the access statistics window to 1 as the number of accesses of the first memory address, so as to achieve swapping out the third memory address in the address window, swapping the first memory address into the address window, swapping out the number of accesses of the third memory address in the access statistics window, and swapping the number of accesses of the first memory address into the address window, thereby eliminating the memory address with the lowest access popularity among the M second memory addresses, and the first memory address becomes a second memory address.
[0210] Taking the decay strategy represented by the above formula (1) as an example, assuming that the first number threshold is 0, see Fig. 9 , after all access times are replaced by the quotient divided by the attenuation constant A, the access statistics device queries whether there is an access time of 0 in the access statistics table. If not, the first memory address is discarded and address collection continues. If there is an access time of 0, the memory address in the address entry corresponding to a certain access time of 0 is replaced with the first memory address, such as clearing the memory address in the address entry and filling the first memory address in the address entry to replace the originally stored memory address. After the replacement is completed, in the access statistics table, the access time of 0 corresponding to the address entry is increased by 1. Then Fig.10 For example, there are 2 access counts of 0 in the access statistics table after attenuation processing using the attenuation constant A. One of the access counts is selected as the access count of the first memory address, and the selected access count is updated to 1. The other access count of 0 is the access count to be replaced by the next new memory address. The new memory address refers to a memory address that does not exist in the address table.
[0211] The above is described by taking as an example the case where the first memory address does not exist in the M second memory addresses, and performing a decay process on the M second memory addresses. In another possible implementation, in any access statistics cycle, after the M second memory addresses are stored in the address window, the access statistics device performs periodic decay process on each access count in the access statistics window according to the decay cycle. For the newly acquired first memory address, if the first memory address does not exist in the address window, the third memory address is determined based on the access count in the access statistics table. The decay cycle may be Δt in formula (2).
[0212] The method of periodic attenuation processing, for example, after each attenuation cycle, the access statistics device performs a decay process on each access count in the access statistics window. For example, at the end of each attenuation cycle, a decay process can be performed on each access count in the access statistics window.
[0213] Taking the decay strategy shown in the above formula (2) as an example, assuming A=0.5, B=3, the memory address in the address window at time 1 and the number of accesses in the access statistics window are shown in Table 2. After Δt, it reaches time 2. Assuming that address A and address B are not obtained from time 1 to time 2, as shown in Table 3, according to the decay strategy shown in the above formula (2), the number of accesses to address A decays from FF to 7C, and the number of accesses to address B decays from 6 to 0. The access statistics device continues to count in the access statistics table. After Δt after time 2, it reaches time 3. Assuming that address A is obtained multiple times from time 2 to time 3, the number of accesses to address A is continuously increased by 1, as shown in Table 4. According to the decay strategy shown in the above formula (2), the number of accesses to address A at time 3 is decayed, so that the address of address A decays to 8C. Assume that address C is acquired but address B is not acquired from time 2 to time 3. Since the number of accesses to address B decays to 0 (i.e., the first count threshold), as shown in Table 4, the access statistics device updates address B in the address window to address C, so that the number of accesses to address B in the access statistics window becomes the number of accesses to address C. If address C is acquired multiple times during this period, the number of accesses to address C is continuously increased by 1, as shown in Table 4. According to the decay strategy shown in the above formula (2), the number of accesses to address C at time 3 is decayed, so that the number of accesses to address C becomes F.
[0214]
[0215] The above is explained by taking the acquisition of a first memory address as an example. In another possible implementation, the access statistics device can also acquire multiple first memory addresses each time. If N first memory addresses among the multiple first memory addresses are not second memory addresses, the access statistics device determines N third memory addresses by executing step 8021, and updates the first access count of the N third memory addresses to the access count of the N first memory addresses by executing step 8022. If any first memory address is the same as the second memory address, the access count of the first memory address in the access statistics window is increased by 1, where N is greater than 0.
[0216] The above step 802 is the sliding window operation performed in the access statistics process. If step 802 is implemented based on the attenuation processing method, the sliding window operation is also called the sliding window attenuation operation. Fig. 9 The first memory address mode is recorded in the access statistics cycle, and the number of accesses to the memory address is recorded. In the access statistics cycle, when M memory addresses are recorded in the address window, if a new memory address that does not exist in the address window is obtained again, a sliding window decay operation is performed on the access statistics window and the address window for the new memory address. Each time the sliding window decay operation is performed, the memory address with the minimum number of accesses originally recorded in the address window is replaced with the new memory address. Before the next sliding window operation, if the new memory address is obtained again, the number of accesses to the new memory address will be continuously updated. In this way, when the next sliding window operation is performed, if the number of accesses to the new memory address is not the minimum number of accesses in the access statistics window, the new memory address may be retained in the address table. If the number of accesses to the new memory address is the minimum number of accesses in the access statistics window, the new memory address may be replaced by the latest acquired new memory address. As the number of sliding window attenuation operations increases, the address table retains: the memory address with the highest access frequency in the access statistics cycle, and the access statistics table retains: the number of accesses to the memory address with the highest access frequency. This number of accesses is not the actual number of accesses to the memory address in the access statistics cycle, but the number of accesses after attenuation. In an access statistics cycle, the relationship between the number of sliding window attenuation operations S, the attenuation constant A, and the frequency F of the minimum number of accesses in the access statistics window can be expressed as: S = log A (F).
[0217] In one possible implementation, in the early stage of the access statistical cycle, certain memory addresses of the storage medium may be frequently accessed, while in the later stage of the access statistical cycle, the access frequency of these memory addresses will decrease, or even these memory addresses will not be accessed. Therefore, in the early stage of the access statistical cycle, the number of accesses to these memory addresses is relatively large. When determining the memory address with the lowest access popularity in the address window through attenuation processing, as the number of attenuation processing times increases, the number of accesses to these memory addresses will gradually decay until they are eliminated, thereby retaining the number of accesses to memory addresses with high recent access popularity in the access statistical table. When the hot page is subsequently determined based on the number of accesses to the memory addresses with high recent access popularity, the hot page determined is the hottest page with the highest recent access popularity.
[0218] When determining the third memory address by attenuation processing, it is sufficient to query whether the first access count after attenuation meets the first access count threshold, without sorting the first access count after attenuation. The implementation is simple and the third memory address can be determined quickly.
[0219] The process shown in the above steps 801 to 802 is a flow of another storage medium access statistics method executed by the access statistics device, that is, the access statistics flow in the global statistics mode. Compared with the local statistics mode, when the global statistics mode is used to count the accesses to the accessed memory addresses, what is left in the address window is not the M different memory addresses obtained continuously, but the M different memory addresses left after the memory addresses are eliminated through the sliding window operation.
[0220] 803. The access statistics device determines the heat of the memory page in the storage medium according to the memory address in the updated address window.
[0221] The updated address window refers to the address window after the memory address is filled and / or the memory address is updated.
[0222] The updated address window corresponds to the updated access statistics window, and the access counts in the updated access statistics window are the access counts of each memory address in the updated address window, respectively. The access statistics device determines the heat of the memory page in the storage medium according to the memory address in the updated address window and the access count in the updated access statistics window. Exemplarily, if the access statistics cycle ends, or if a stop acquisition instruction is received, or if there is an access count greater than or equal to the second count threshold in the access statistics window, the access statistics device uses each memory address stored in the address window and each access count in the access statistics window as the access statistics information of the access statistics cycle, wherein the access statistics window includes the updated first access count and / or the unupdated first access count, wherein the updated first access count refers to the first access count in the access statistics table where the corresponding memory address is updated. The unupdated first access count refers to the first access count in the access statistics table where the corresponding memory address is not updated. For example, if all the second memory addresses in the address window have been updated, the access counts in the access statistics window are all the first access counts after the update; if some of the second memory addresses in the address window have been updated, some of the access counts in the access statistics window are the first access counts after the update; if none of the second memory addresses in the address window have been updated, the access counts in the access statistics window are not updated to the first access counts after the update.
[0223] After obtaining the access statistics information of the access statistics period, the access statistics device determines the heat of the memory page in the storage medium based on the access statistics information. This process is the same as the process of determining the page status of the memory page in step 605, and will not be repeated here. The difference is that, in the global statistics mode, since the memory addresses in the access statistics information are mostly the memory addresses with the highest access heat in the recent time period, most of the memory pages accessed by the storage medium are hot pages. Some of the memory addresses collected later in the access statistics information may be determined as cold pages or warm pages due to insufficient counting time. In other embodiments, this part of the memory addresses may not participate in determining the heat of the memory page, so that the memory pages determined to have been accessed are all hot pages. In another possible implementation, the access statistics device can also notify the hot pages in the storage medium to the target processing core, and the target processor core migrates the hot data in the hot pages. Alternatively, the access statistics device determines the heat of the memory page in the storage medium based on each memory address in the address window and the number of accesses to each memory address, so that the target processor core migrates the hot data in the hot page. Figure 7 Similar, in Fig. 9 In the present invention, based on the configuration of the access statistics device, at the end of an access statistics cycle, or when a stop collection instruction is received, or when there is an access number greater than or equal to the second number threshold in the access statistics table, or when an information read request of the processor core is received, the access statistics device may be triggered to stop address collection, send an interrupt message (such as the first interrupt message or the second interrupt message) to the target processor core to indicate the access statistics interruption, and enter the data return process. In the data return process, the access statistics device sends the access statistics information to the target processor core. After receiving the returned access statistics information (compressed or uncompressed), the target processor core parses the access statistics information, determines at least one memory page among the hot page, cold page and warm page in the storage medium based on the parsing result, and migrates the hot data in the hot page to the upper level memory of the storage medium in the hierarchical memory.
[0224] Figure 8The provided method updates the memory address stored in the address window according to the acquired memory address when acquiring the memory address accessed for the storage access request. With the continuous updating of the memory address in the address window, the updated address window can store the memory addresses accessed in the storage medium in the recent time period, and then accurately identify the heat of the memory pages accessed in the storage medium in the recent time period according to the memory addresses in the updated address window. After acquiring the memory address accessed for the storage access request, if the address window has stored all the memory addresses accessed by the storage medium, and there is no newly acquired memory address in the address window, then based on the number of accesses of the memory address in the address window, identify the memory address with the lowest access heat in the address window, update the memory address with the lowest access heat in the address window to the newly acquired memory address, so as to eliminate the memory address with the lowest access heat in the address window. By continuously eliminating the memory address with low access heat in the address window, the memory address with the highest access heat in the recent time period can be retained in the address window, and then based on the memory address with the highest access heat in the access statistics process, the hot page in the storage medium in the recent time period can be accurately identified. Moreover, based on the attenuation processing, the newly acquired memory addresses are used to eliminate the memory addresses with low access times in the address window. After multiple attenuation processing, the memory addresses in the address window are all memory addresses with higher access times relative to the eliminated memory addresses, so that the hot pages with the highest access frequency in the storage medium can be determined based on the access times of the memory addresses with higher access times. Moreover, in the global statistical mode, the access statistical information includes the access times of the memory addresses with the highest access heat in the access statistical cycle, rather than the access times of the internal page addresses that were first accessed in the access statistical cycle. Compared with the access statistical information sent in the local mode, the access statistical information sent in the global statistical mode can provide the target processor core with more effective information required for determining the hot pages, further improving the proportion of effective information in the access statistical information and improving the information entropy of the access statistical information. In the global statistical mode, the access statistical information includes the access times of the memory addresses with the highest access heat in the access statistical cycle, rather than the access times of all memory addresses that have been accessed in the access statistical cycle, so that it is not necessary to determine the hot pages in the storage medium based on the access times of all memory addresses that have been accessed, thereby improving the recognition efficiency of the hot pages. Moreover, by storing the valid information required for determining the hot page in a small area of the address window and the access statistics window, the information utilization rate of each bit of the address window and the access statistics window is increased, so that the address window and the access statistics window become local windows with high information entropy. In addition, when accessing the storage medium to return statistical information to the target processor core or the operating system, since the number of accesses in the statistical information is the attenuated number of accesses, the data volume of the statistical information is further reduced, and the bandwidth required for information return is reduced.The number of accesses to the memory address with the highest global access popularity is counted according to the global statistical mode, so as to support the hot page judgment of small-granularity pages of large-capacity memory, such as pages with a size of 4k bytes.
[0225] The above-mentioned attenuation constants (such as A and B) all support at least one of dynamic adjustment or static adjustment. The following takes the adjustment of attenuation constant A as an example. The adjustment method of B can refer to the attenuation constant A.
[0226] The method of dynamically adjusting the decay constant A is, for example, that the adjustment device determines the threshold expected number based on the business requirements of the application served by the storage medium (such as the expected number of hot pages), and the threshold expected number refers to the number of addresses that are expected to appear in the address window after the decay process and meet the first number threshold. The adjustment device periodically counts the changes in the number of accesses in the access statistics window, and adjusts the value of the decay constant A based on the threshold expected number and the changes in the number of accesses in the access window. Each time the adjustment is made, the adjusted value of the decay constant A is configured as the latest value of the decay constant A in the global statistics mode, so that the access statistics device performs decay processing on the number of accesses in the access statistics window based on the latest value of the configured decay constant A, and by continuously adjusting the value of the decay constant A, the first number threshold of the threshold expected number can appear in the access statistics window after the decay process. Optionally, the changes in the number of accesses in the access window can be represented by the gradient information of the number of accesses, and the adjustment device can adjust the value of the decay constant A based on the threshold expected number and the changes in the number of accesses in the access window according to the gradient rising method or the gradient descending method.
[0227] The method of statically adjusting the attenuation constant A, for example, the attenuation constant A also supports the adjustment device to set multiple candidate values for the attenuation constant A, and these multiple candidate values increase or decrease in sequence. Initially, the adjustment device configures the first candidate value among the multiple candidate values as the attenuation constant A, and at each interval of a certain length of time, the adjustment device configures the attenuation constant A to the next candidate value of the current value. Of course, the adjustment device can also use other adjustment methods to dynamically adjust the attenuation constant A. Here, this application does not limit the method of statically adjusting the attenuation constant A.
[0228] The adjustment device described above can be implemented by software, hardware, or a combination of software and hardware. Here, this application does not limit the implementation of the adjustment device. By dynamically adjusting the attenuation constant A or statically adjusting the attenuation constant A, the access statistics device can perform attenuation processing on the number of accesses in the access statistics window based on the adjusted attenuation constant to meet the needs of different services.
[0229] The above is only an introduction to step 802 by taking the decay strategy as the data replacement strategy as an example, and the access statistics device can also implement step 802 by other data replacement strategies. Next, other data replacement strategies are introduced as follows.
[0230] In a possible implementation, the access statistics device queries the minimum access number among the first access numbers of the M second memory addresses, and the second memory address to which the minimum access number belongs is determined to be the third memory address. Exemplarily, the least frequently used (LFU) strategy is adopted to query the minimum access number. For example, the following method 1 or method 2 is adopted to implement the use of LFU to query the minimum access number.
[0231] Method 1: Each time the number of accesses in the access statistics window is updated, the access statistics device sorts the first number of accesses in the access statistics window through a linked list. When the address window is full, if the first memory address to be counted does not exist in the address window, the smallest first number of accesses sorted out by the linked list is used as the smallest number of accesses, the second memory address to which the smallest number of accesses belongs is determined as the third memory address, and the first number of accesses of the third memory address is updated to the number of accesses of the first memory address.
[0232] Based on this possible implementation method, during the statistical process, as the number of memory addresses obtained increases, the memory addresses with fewer access times among the memory addresses that have been accessed by the storage medium are gradually eliminated, thereby retaining the memory addresses with the highest access popularity in the access statistical period. Based on the number of accesses to the memory addresses with the highest access popularity, it is easy to determine the hottest hot pages in the storage medium.
[0233] Method 2: The access statistics device sorts the first number of access times of the second memory address in the most recent period of time through a linked list. When the address window is full, if the first memory address to be counted does not exist in the address window, the smallest first access number sorted by the linked list is used as the smallest access number, the second memory address to which the smallest access number belongs is determined as the third memory address, and the first access number of the third memory address is updated to the access number of the first memory address.
[0234] Based on this possible implementation method, as the number of memory addresses obtained increases, the memory addresses with the lowest recent access popularity among the memory addresses that have been accessed by the storage medium are gradually eliminated, thereby retaining the memory addresses with the highest access popularity in the access statistical period. Based on the number of accesses to the memory addresses with the highest access popularity, it is easy to determine the hottest hot pages in the storage medium.
[0235] In another possible implementation, the access statistics device uses a least recently used (LRU) strategy or a first-in first-out (FIFO) strategy to determine the third memory address. The LRU strategy and the FIFO strategy can also be implemented in a manner similar to the above-mentioned method 1 or method 2. The difference is that the LRU strategy and the FIFO strategy are both implemented based on the access order, and the methods of maintaining the order are different, which will not be repeated here.
[0236] With respect to the address table and access statistics table introduced above, the access statistics device may store the address table and the access statistics table by any one of the following two storage methods.
[0237] Storage method 1: The access statistics device stores the address table and the access statistics table in the same location.
[0238] by Figure 1 , Figure 3 , Figure 4 and Figure 5 Taking the access statistics device 103 shown in the figure as an example, the address table and the access statistics table are both stored in the memory 33, and the statistics module 32 stores the mapping relationship between the address entries in the address table and the access times in the access statistics table. In an access statistics cycle, the acquisition module 31 performs address acquisition and sends each collected memory address to the statistics module 32. The statistics module counts the accesses to the memory addresses provided by the acquisition module 31 based on the mapping relationship between the address entries in the address table and the access times, according to the configured local statistics mode or global statistics mode, and based on the address table and the access statistics table stored in the memory 33.
[0239] Storage method 2: The access statistics device stores the address table and the access statistics table in different locations.
[0240] Still Figure 1 , Figure 3 , Figure 4 and Figure 5 Taking the access statistics device 103 shown in FIG. 1 as an example, Fig.11The access count recording flow chart shown in the figure assumes that the access statistics device 103 also includes a content-addressable memory (CAM) 35, an address table 36 with an address capacity of M and stored in CAM 35, and an access statistics table 37 stored in memory 33. In any access statistics cycle, the acquisition module 31 in the access statistics device 103 performs address acquisition, and each collected memory address is sent to CAM 35. After receiving each memory address, CAM 35 uses the memory address as the first memory address, and compares the first memory address with the memory addresses recorded in each address entry in the address table 36 to obtain the comparison results corresponding to the M address entries (i.e., M comparison results). A comparison result is used to indicate whether the first memory address is the same as the memory address in the corresponding address entry, such as Fig.11 As shown, the comparison result can be represented by a matching identifier match, where match is used to indicate whether the first memory address matches the memory address in the corresponding address entry (i.e., whether they are the same), match=1, indicating that the first memory address matches the memory address in the corresponding address entry, and match=0, indicating that the first memory address does not match the memory address in the corresponding address entry.
[0241] For any address entry, if the address entry is a valid address entry and the first memory address is the same as the memory address in the address entry, the comparison result corresponding to the address entry is match=1; if the address entry is an invalid address entry, the comparison result corresponding to the address entry is match=0. Fig.11 For example, assuming that the first memory address is "0x000f", "0x000f" is the same as the memory address in the third address entry of address table 36, and is different from the memory addresses in other address entries. Then the comparison result corresponding to the third address entry is match=1, and the comparison results corresponding to other address entries are all match=0.
[0242] After obtaining the M comparison results, CAM35 sends the M comparison results to the statistical module 32, so that the statistical module 32 updates the number of accesses to the first memory address in the access statistical table 37 based on the M comparison results. The M comparison results are the query results of CAM35 for the first memory address in the address table. The statistical module 32 uses CAM35 to query the first memory address, and there is no need for the statistical module 32 to query, thereby reducing the workload of the statistical module 32.
[0243] Still Fig.11For example, after the statistics module 32 obtains the comparison results corresponding to the M address entries sent by the CAM 35, if the comparison result corresponding to any address entry indicates that the first memory address is the same as the memory address in the address entry, the statistics module 32 determines the number of accesses corresponding to the first address entry (i.e., the number of accesses to the first memory address) based on the mapping relationship between the address entry in the address table and the access count in the access statistics table, and updates the number of accesses in the access statistics table 37 in the memory 33. For example, Fig.11 The comparison result between the first memory address "0x000f" and the third address entry is match=1, the third address entry corresponds to the third access count "0x2" in the access statistics table, and the statistical module 32 adds 1 to the third access count "0x2" in the access statistics table to obtain an updated access count.
[0244] The above is explained by taking the address table 36 including the first memory address as an example. If the address table does not include the first memory address, the statistical module 32 processes the first memory address according to the configured local statistical mode or global statistical mode. In the global statistical mode, the address table 36 is the address window, the access statistical table 37 is the access statistical window, and the CAM 35 and the memory 33 are the first memory and the second memory in the access statistical device, respectively.
[0245] The above is explained by taking CAM35 providing M comparison results of the first memory address to the statistics module 32 as an example. In another possible implementation, if the first memory address does not exist in the address table 36, the M comparison results are all match=0. In this case, CAM35 may not send the M comparison results to the statistics module 32 to reduce the workload of the statistics module 32. If the first memory address exists in the address table 36, only one comparison result among the M comparison results is match=1. In this case, CAM35 sends the comparison result of match=1 to the statistics module 32, and does not send other comparison results to reduce the workload of the statistics module 32. In another possible implementation, CAM35 may also be replaced by other types of memories. The other types of memories may have the function of comparing the input data with the stored memory address, or may not have this function. If it does not have this function, the statistics module 32 may be responsible for comparing the input data with the stored memory address. This application does not limit other types of memories.
[0246] The above describes the method for determining the page status of a memory page and the method for collecting access statistics of a storage medium provided by the present application. The following describes the apparatus and device for applying the above method. It should be understood that the apparatus and device described below have the same inventive concept as the above method and can achieve the beneficial effects that can be achieved by the above method. Figure 12 to Figure 14Describe the apparatus and device of the present application. It should be understood that the technical features described in the method flow are also applicable to the following apparatus and device.
[0247] Fig.12 is a schematic diagram of a storage medium access statistics device provided by the present application, such as Fig.12 As shown, the access statistics device 1200 includes:
[0248] An acquisition module 1201 is used to acquire a first memory address accessed by an access request to the storage medium;
[0249] A query module 1202, configured to query the first memory address from a mapping relationship between memory addresses accessed by the storage medium and the number of accesses;
[0250] The updating module 1203 is configured to update the number of accesses in the mapping relationship where the first memory address is located if the first memory address exists in the memory addresses that have been accessed by the storage medium.
[0251] In a possible implementation, the accessed memory address is recorded in an address table, the number of accesses to the accessed memory address is recorded in an access statistics table, and the address table corresponds to the access statistics table.
[0252] In a possible implementation, the access statistics table includes multiple access times, the address table includes multiple address entries, the address entry is used to record a memory address that has been accessed in the storage medium, and the address entry corresponds to an access time in the access statistics table, and the access statistics device 1200 further includes:
[0253] A filling module is used to fill the first memory address in the unused address entry if the first memory address does not exist in the memory addresses accessed by the storage medium and there is an unused address entry in the address table, and update the number of accesses corresponding to the unused address entry in the access statistics table.
[0254] In a possible implementation, the access statistics device 1200 further includes:
[0255] The first sending module is used to send a first interrupt message to the processor core if the first memory address does not exist in the memory addresses accessed by the storage medium and the unused address entry does not exist in the address table, wherein the first interrupt message indicates that all address entries in the address table have been used, resulting in an access statistics interruption.
[0256] In a possible implementation, the access statistics device 1200 further includes:
[0257] a decay processing module, configured to perform decay processing on the multiple access times to obtain multiple access times after decay if the first memory address does not exist in the memory addresses accessed by the storage medium and the unused address entry does not exist in the address table;
[0258] The updating module 1203 is further configured to update the memory address in the address entry corresponding to any access number to the first memory address if any access number after attenuation is less than or equal to the first number threshold, thereby updating any access number after attenuation.
[0259] In a possible implementation, the access statistics device 1200 further includes:
[0260] The second sending module is used to send a second interrupt message to the processor core if there is an access number greater than or equal to the second number threshold among the multiple access times, and the second interrupt message indicates that the access statistics interruption occurs due to the memory address having an access number greater than or equal to the second number threshold.
[0261] In a possible implementation, the access statistics device 1200 further includes:
[0262] A receiving module, configured to receive an information reading request from a processor core, wherein the information reading request indicates reading access statistics information of the storage medium;
[0263] The third sending module is used to send the access statistics information to the processor core based on each memory address that has been accessed by the storage medium and the number of times each memory address has been accessed.
[0264] The access statistics device 1200 should be the access statistics device in the access statistics method of the above-mentioned storage medium. The various modules in the access statistics device 1200 and the above-mentioned other operations and / or functions are respectively for realizing the various steps and methods implemented by the access statistics device in the access statistics method of the above-mentioned storage medium. The specific details can be found in the above-mentioned method flow. For the sake of brevity, they will not be repeated here.
[0265] When the access statistics device 1200 counts the number of accesses to the memory address, only the division of the above-mentioned functional modules is used as an example for explanation. In actual application, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the access statistics device 1200 is divided into different functional modules to complete all or part of the functions described above. In addition, the access statistics device 1200 and the access statistics method in the above-mentioned storage medium belong to the same concept. The specific implementation process is detailed in the access statistics method flow of the above-mentioned storage medium, which will not be repeated here.
[0266] for Figure 1 , Figure 3 , Figure 4 , Figure 5 , Fig.12 as well as Fig.16 Any access statistics device shown in the above, the access statistics device can be implemented by a chip, can also be implemented by a CPU, can also be implemented by an application-specific integrated circuit (ASIC), can also be implemented by a programmable logic device (PLD), the above PLD can be a complex programmable logical device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a system on chip (SoC) or any combination thereof. The access statistics device can also implement the access statistics method of the storage medium mentioned above by software. When implemented by software, the access statistics device and its various modules can also be software modules.
[0267] Fig.13 is a schematic diagram of the structure of a device for determining the page status of a memory page provided by the present application. Fig.13 The illustrated apparatus 1300 comprises:
[0268] An acquisition module 1301 is used to acquire a first memory address accessed by an access request to a storage medium;
[0269] A query module 1302, configured to query the first memory address from a mapping relationship between memory addresses accessed by the storage medium and the number of accesses;
[0270] An updating module 1303, configured to update the number of accesses in the mapping relationship where the first memory address is located if the first memory address exists in the memory addresses accessed by the storage medium;
[0271] The determination module 1304 is used to determine the page status of the memory page to which the memory address belongs based on the latest access count of the memory address accessed by the storage medium after a first period of time, and the page status is used to indicate the heat of the memory page being accessed.
[0272] In a possible implementation, the accessed memory address is recorded in an address table, the number of accesses to the accessed memory address is recorded in an access statistics table, and the address table corresponds to the access statistics table.
[0273] In a possible implementation, the access statistics table includes multiple access times, the address table includes multiple address entries, the address entry is used to record a memory address that has been accessed in the storage medium, and the address entry corresponds to an access time in the access statistics table, and the update module 1303 is further used to:
[0274] If the first memory address does not exist in the memory addresses accessed by the storage medium, and there is an unused address entry in the address table, the first memory address is filled in the unused address entry, and the number of accesses corresponding to the unused address entry in the access statistics table is updated.
[0275] In a possible implementation, the apparatus 1300 further includes:
[0276] a decay processing module, configured to perform decay processing on the multiple access times to obtain multiple access times after decay if the first memory address does not exist in the memory addresses accessed by the storage medium and the unused address entry does not exist in the address table;
[0277] The updating module 1303 is further configured to update the memory address in the address entry corresponding to any access number to the first memory address if any access number after attenuation is less than or equal to the first number threshold, thereby updating any access number after attenuation.
[0278] When the device 1300 determines the page status of a memory page, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device 1300 is divided into different functional modules to complete all or part of the functions described above. In addition, the device 1200 and the above-mentioned method for determining the page status of a memory page belong to the same concept. The specific implementation process is detailed in the above-mentioned method for determining the page status of a memory page, which will not be repeated here.
[0279] The implementation of the device 1300 is similar to that of the access statistics device 1200, and the implementation of the device 1300 will not be described in detail here.
[0280] Fig.14 It is a structural diagram of a computer device provided by this application, such as Fig.14As shown, the computer device 1400 includes: a bus 1402, a processor 1404, a memory 1406, a communication interface 1408, and an access statistics device 1410. The processor 1404, the memory 1406, and the communication interface 1408 communicate through the bus 1402. The bus 1402 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.14 Only one line is used to represent it, but it does not mean that there is only one bus or one type of bus. Bus 1402 may include a path for transmitting information between various components of computer device 1400 (for example, memory 1406, processor 1404, communication interface 1408). Processor 1404 may include any one or more of processors such as CPU, graphics processing unit (GPU), microprocessor (MP) or digital signal processor (DSP). Memory 1406 can be used as the internal memory or external memory of computer device 1400. Memory 1406 may include volatile memory, such as random access memory (RAM). Memory 1406 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD) or solid state drive (SSD).
[0281] The access statistics device 1410 is used to execute the access statistics method of the storage medium, the page status determination method of the memory page, or the heat determination method of the memory page provided in the present application. The implementation method of the access statistics device 1410 is the same as that of the access statistics device 1200, which will not be repeated here. In the case where the access statistics device 1410 is implemented by a processor, the implementation method of the access statistics device 1410 can refer to the above-mentioned processor 1404, and the memory 1406 stores an executable program code. The processor 1404 reads and executes the executable program code, so that the computer device 1400 implements the above-mentioned memory page page status determination method, storage medium access statistics method, or memory page heat determination method.
[0282] The access statistics device 1410 is equivalent to the access statistics device 103 in the computer system 100. Similar to the deployment method of the access statistics device 103, in another possible implementation method, the access statistics device 1410 may also be integrated in the processor 1404, such as the MMU integrated in the processor 1404 or other locations other than the MMU, or may also be integrated in other types of processors or memory controllers other than the CPU, and the functions of the access statistics device 140 are implemented by other types of processors or memory controllers. In another possible implementation method, the access statistics device 1410 may also be integrated in the memory 1406. Here, the present application does not limit the location of the access statistics device 1410 in the computer device 1400.
[0283] Fig.15 is a schematic diagram of the structure of a device for determining the heat of a memory page provided by the present application, such as Fig.15 As shown, the apparatus 1500 comprises:
[0284] An acquisition module 1501 is used to acquire a first memory address accessed by an access request to a storage medium;
[0285] An updating module 1502, configured to update the memory address stored in the address window according to the first memory address, to obtain an updated address window, wherein the address window is used to store the memory addresses accessed in the storage medium within a recent period of time;
[0286] The determination module 1503 is used to determine the heat of the memory page in the storage medium according to the memory address in the updated address window.
[0287] In a possible implementation, the address window is a local address window, and the updating module 1502 includes:
[0288] a determining unit, configured to determine, if the address window has stored M second memory addresses and the first memory address does not exist in the M second memory addresses, a third memory address based on the first access count of the M second memory addresses, the third memory address being the memory address with the lowest access heat among the M second memory addresses, where M is the address capacity of the address window;
[0289] An updating unit, used for updating the third memory address in the address window to the first memory address.
[0290] In a possible implementation manner, the determining unit is used to:
[0291] Performing attenuation processing on the first access times of the M second memory addresses;
[0292] If the first access count of any second memory address decays to a first count threshold, the any second memory address is determined as the third memory address.
[0293] In a possible implementation manner, the determining unit is used to:
[0294] Querying the minimum access number among the first access numbers of the M second memory addresses;
[0295] The second memory address to which the minimum access number belongs is determined as the third memory address.
[0296] In a possible implementation, the address window is a global address window, and the apparatus 1500 further includes:
[0297] A first sending module is used to send a first interrupt message to the processor core if the first memory address does not exist in the memory addresses stored in the address window and there is no unused address entry in the address window, wherein the first interrupt message indicates that all address entries in the address window have been used, resulting in an access statistics interruption, and the address entry is used to record a memory address that has been accessed in the storage medium.
[0298] In a possible implementation, the address window includes a plurality of address entries, where the address entry is used to record a memory address that has been accessed in the storage medium, and the updating module 1502 is used to:
[0299] If the first memory address does not exist in the memory addresses stored in the address window, and there is an unused address entry in the address window, the first memory address is filled in the unused address entry.
[0300] In a possible implementation, the address window corresponds to an access statistics window, the access statistics window includes a plurality of access times, and the address entry corresponds to one access time in the access statistics window;
[0301] The updating module 1502 is further used to update the number of accesses stored in the access statistics window according to the first memory address to obtain an updated access statistics window;
[0302] The determination module 1503 is further configured to determine the heat of the memory page in the storage medium according to the memory address in the updated address window and the number of accesses in the updated access statistics window.
[0303] In a possible implementation, the apparatus 1500 further includes:
[0304] The second sending module is used to send a second interrupt message to the processor core if there is an access number greater than or equal to the second number threshold among the multiple access times, and the second interrupt message indicates that the access statistics interruption occurs due to the memory address having an access number greater than or equal to the second number threshold.
[0305] In a possible implementation, the apparatus 1500 further includes:
[0306] A receiving module, configured to receive an information reading request from a processor core, wherein the information reading request indicates reading access statistics information of the storage medium;
[0307] The third sending module is used to send the access statistics information to the processor core based on each memory address in the address window and the number of accesses to each memory address.
[0308] The first sending module, the second sending module and the third sending module mentioned above may be the same sending module or different sending modules.
[0309] In a possible implementation, the address window is implemented by a content addressable memory CAM.
[0310] When the device 1500 determines the heat of the memory page in the storage medium, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device 1500 is divided into different functional modules to complete all or part of the functions described above. In addition, the device 1500 and the above-mentioned method for determining the heat of the memory page are of the same concept, and the specific implementation process is detailed in the above-mentioned Figure 8 The process of determining the heat of the memory page in the memory will not be repeated here.
[0311] The implementation of the device 1500 is similar to that of the access statistics device 1200, and the implementation of the device 1500 will not be described in detail here.
[0312] Fig.16 is a schematic diagram of the structure of another storage medium access statistics device provided by the present application, Fig.16 The illustrated apparatus 1600 comprises:
[0313] An acquisition module 1601 is used to acquire a first memory address accessed by an access request to a storage medium;
[0314] The updating module 1602 is used to update the memory address stored in the address window according to the first memory address to obtain an updated address window, wherein the address window is used to store the memory addresses accessed in the storage medium within a recent period of time.
[0315] In a possible implementation, the address window is a local address window, and the updating module 1602 includes:
[0316] a determining unit, configured to determine, if the address window has stored M second memory addresses and the first memory address does not exist in the M second memory addresses, a third memory address based on the first access count of the M second memory addresses, the third memory address being the memory address with the lowest access heat among the M second memory addresses, where M is the address capacity of the address window;
[0317] An updating unit, used for updating the third memory address in the address window to the first memory address.
[0318] In a possible implementation manner, the determining unit is used to:
[0319] Performing attenuation processing on the first access times of the M second memory addresses;
[0320] If the first access count of any second memory address decays to a first count threshold, the any second memory address is determined as the third memory address.
[0321] In a possible implementation manner, the determining unit is used to:
[0322] Querying the minimum access number among the first access numbers of the M second memory addresses;
[0323] The second memory address to which the minimum access number belongs is determined as the third memory address.
[0324] In a possible implementation, the address window is a global address window, and the apparatus 1600 further includes:
[0325] A first sending module is used to send a first interrupt message to the processor core if the first memory address does not exist in the memory addresses stored in the address window and there is no unused address entry in the address window, wherein the first interrupt message indicates that all address entries in the address window have been used, resulting in an access statistics interruption, and the address entry is used to record a memory address that has been accessed in the storage medium.
[0326] In a possible implementation, the address window includes a plurality of address entries, where the address entry is used to record a memory address that has been accessed in the storage medium, and the updating module 1602 is used to:
[0327] If the first memory address does not exist in the memory addresses stored in the address window, and there is an unused address entry in the address window, the first memory address is filled in the unused address entry.
[0328] In a possible implementation, the address window corresponds to an access statistics window, the access statistics window includes multiple access times, the address entry corresponds to an access time in the access statistics window, and the updating module 1602 is further used to:
[0329] The number of accesses stored in the access statistics window is updated according to the first memory address to obtain an updated access statistics window.
[0330] In a possible implementation, the device 1600 further includes:
[0331] The second sending module is used to send a second interrupt message to the processor core if there is an access number greater than or equal to the second number threshold among the multiple access times, and the second interrupt message indicates that the access statistics interruption occurs due to the memory address having an access number greater than or equal to the second number threshold.
[0332] In a possible implementation, the device 1600 further includes:
[0333] A receiving module, configured to receive an information reading request from a processor core, wherein the information reading request indicates reading access statistics information of the storage medium;
[0334] The third sending module is used to send the access statistics information to the processor core based on each memory address in the address window and the number of accesses to each memory address.
[0335] The first sending module, the second sending module and the third sending module mentioned above may be the same sending module or different sending modules.
[0336] In a possible implementation, the address window is implemented by a content addressable memory CAM.
[0337] When the device 1600 performs access statistics on the storage medium, only the division of the above-mentioned functional modules is used as an example for explanation. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device 1600 is divided into different functional modules to complete all or part of the functions described above. In addition, the device 1600 and the access statistics method of the above-mentioned storage medium are of the same concept, and the specific implementation process is detailed in the above-mentioned Figure 8 The access statistics method process of the storage medium will not be repeated here.
[0338] The implementation of the device 1600 is similar to that of the access statistics device 1200, and the implementation of the device 1600 will not be described in detail here.
[0339] The present application also provides a computing device, which is used to execute the above-mentioned method for determining the page status of a memory page, the method for determining the heat of a memory page, or the method for counting access to a storage medium. The computing device is any electronic device with a computing function, for example, the computing device can be a computer device (such as Fig.14 The electronic device may be a chip, a processor or other hardware form.
[0340] Taking the computing device as a chip as an example, the present application also provides a chip, which includes a logic circuit, and the logic circuit is used to execute the above-mentioned method for determining the page status of a memory page, the method for determining the heat of a memory page, or the method for counting accesses to a storage medium. In one possible implementation, the chip also includes a power supply circuit, the logic circuit is coupled to the power supply circuit, and the functional circuit is used to power the logic circuit so that the logic circuit executes the above-mentioned method for determining the page status of a memory page, the method for determining the heat of a memory page, or the method for counting accesses to a storage medium. Exemplarily, the logic circuit is a CPU, a digital signal processor (digital signal processing, DSP), a DPU, a SoC, an ASIC, a CPLD, a PLD, an FPGA, or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, an acceleration card, an acceleration chip, etc.
[0341] Taking the computing device as a processor as an example, the processor is used to execute the above-mentioned memory page page status determination method, memory page heat determination method or storage medium access statistics method. The implementation method of the processor is the same as the above-mentioned logic circuit, and the implementation method of the processor will not be repeated here.
[0342] The present application also provides a computer-readable storage medium, such as a memory including a program code, wherein the program code can be executed by a processor so that a device (such as a computing device) where the processor is located executes the above-mentioned method for determining the page status of a memory page, the method for determining the hot page of a memory page, or the method for counting access to a storage medium.
[0343] The present application also provides a computer program product or a computer program, which includes a program code, which is stored in a computer-readable storage medium. A processor reads the program code from the computer-readable storage medium, and the processor executes the program code, so that the device where the processor is located (such as a computing device) executes the above-mentioned method for determining the page status of a memory page, the method for determining the heat of a memory page, or the method for counting access to a storage medium.
[0344] In addition, the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor can execute the computer execution instructions stored in the memory to enable the device to execute the above-mentioned memory page page status determination method, memory page heat determination method or storage medium access statistics method.
[0345] Among them, the devices, equipment, computer-readable storage media, computer program products or chips provided in this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0346] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. 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 computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD) or a semiconductor medium. The semiconductor medium may be a solid state disk (SSD).
[0347] The information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the access requests involved in this application are all obtained with full authorization.
[0348] The above is only a specific implementation of the present application. Those skilled in the art may conceive of changes or substitutions based on the specific implementation provided by the present application, which should all be included in the protection scope of the present application.
Claims
1. A method for determining the heat of a memory page, characterized in that: The method comprises: Obtaining a first memory address accessed by an access request to a storage medium; According to the first memory address, the memory address stored in the address window is updated to obtain an updated address window, wherein the address window is used to store the memory addresses accessed in the storage medium within a recent period of time; The heat of the memory page in the storage medium is determined according to the memory address in the updated address window.
2. The method according to claim 1, characterized in that The address window is a local address window, and updating the memory address stored in the address window according to the first memory address includes: If the address window has stored M second memory addresses, and the first memory address does not exist in the M second memory addresses, a third memory address is determined based on the first access count of the M second memory addresses, where the third memory address is the memory address with the lowest access heat among the M second memory addresses, and M is the address capacity of the address window; The third memory address in the address window is updated to the first memory address.
3. The method according to claim 2, characterized in that The determining the third memory address based on the first access counts of the M second memory addresses comprises: Performing attenuation processing on the first access times of the M second memory addresses; If the first access count of any second memory address decays to a first count threshold, the any second memory address is determined as the third memory address.
4. The method according to claim 2, characterized in that: The determining the third memory address based on the first access counts of the M second memory addresses comprises: Querying the minimum access number among the first access numbers of the M second memory addresses; The second memory address to which the minimum access number belongs is determined as the third memory address.
5. The method according to claim 1, characterized in that: The address window is a global address window, and the method further includes: If the first memory address does not exist in the memory addresses stored in the address window and there is no unused address entry in the address window, a first interrupt message is sent to the processor core, and the first interrupt message indicates that all address entries in the address window have been used, resulting in an access statistics interruption, and the address entry is used to record a memory address that has been accessed in the storage medium.
6. The method according to any one of claims 1 to 5, characterized in that The address window includes a plurality of address entries, each of which is used to record a memory address that has been accessed in the storage medium. The updating of the memory address stored in the address window according to the first memory address includes: If the first memory address does not exist in the memory addresses stored in the address window, and there is an unused address entry in the address window, the first memory address is filled in the unused address entry.
7. The method according to any one of claims 1 to 6, characterized in that The address window corresponds to an access statistics window, the access statistics window includes a plurality of access times, the address entry corresponds to an access time in the access statistics window, and the method further includes: According to the first memory address, updating the number of accesses stored in the access statistics window to obtain an updated access statistics window; The heat of the memory page in the storage medium is determined according to the memory address in the updated address window and the number of accesses in the updated access statistics window.
8. The method according to claim 7, characterized in that The method further comprises: If there is an access number greater than or equal to the second number threshold among the multiple access numbers, a second interrupt message is sent to the processor core, and the second interrupt message indicates that the access statistics interruption occurs due to a memory address with an access number greater than or equal to the second number threshold.
9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: receiving an information read request from a processor core, the information read request indicating reading access statistics information of the storage medium; The access statistics information is sent to the processor core based on each memory address in the address window and the number of accesses to each memory address.
10. The method according to any one of claims 1 to 9, characterized in that The address window is implemented by a content addressable memory CAM.
11. A device for determining the heat of a memory page, characterized in that: The device comprises: An acquisition module, used to acquire a first memory address accessed by an access request to a storage medium; An updating module, configured to update the memory address stored in the address window according to the first memory address, to obtain an updated address window, wherein the address window is used to store the memory addresses accessed in the storage medium within a recent period of time; A determination module is used to determine the heat of the memory page in the storage medium according to the memory address in the updated address window.
12. A computer device, characterized in that: The computer device comprises a processor, and the processor is configured to execute program code so that the computer device performs the method according to any one of claims 1 to 10.
13. A chip, characterized in that: The chip comprises a logic circuit, and the logic circuit is used to execute the method according to any one of claims 1 to 10.
14. A processor, characterized in that: The processor is configured to execute the method according to any one of claims 1 to 10.
15. A computer-readable storage medium, characterized in that: At least one program code is stored in the storage medium, and the at least one program code is read and executed by a processor to implement the method according to any one of claims 1 to 10.
Citation Information
Cited By
Hotspot function positioning method and device for system-on-chip and navigation receiver
CN122220186A
Hotspot function locating method, apparatus and navigation receiver for system on chip
CN122220186B