A method for determining the number of accesses to a memory page and a computing device

By using the page attribute table in the memory fetch controller to determine the number of visits to the memory page, the problem of low accuracy in the prior art is solved, and more refined hot and cold data management and statistical accuracy are achieved.

CN117033254BActive Publication Date: 2025-04-25XFUSION DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310804111.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2025-04-25
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

The prior art has problems with low accuracy when determining the number of visits to memory pages, especially when hot data is dispersed into different buckets.

Method used

By providing a page attribute table, which records the mapping relationship between the address of the memory page and the bucket identification, the memory access controller can determine the bucket identification corresponding to the address of the memory page based on this table, and increment the count value of the counter corresponding to the bucket identification according to the preset step value.

Benefits of technology

It improves the accuracy of determining the number of visits to the memory page, realizes flexible placement of hot and cold data and non-uniform bucket size, and improves the accuracy of statistical hot and cold pages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117033254B_ABST
    Figure CN117033254B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method for determining the number of accesses to a memory page and a computing device, in which, in response to receiving a first instruction sent by a processor, a storage address of a page attribution table is obtained; wherein the first instruction includes the address of the memory page; the first instruction is used to indicate the address of the memory page to be accessed; the page attribution table is used to record the mapping relationship between the address of the memory page and the bucket identifier; based on the storage address of the page attribution table and the address of the memory page, the bucket identifier corresponding to the address of the memory page is determined; the count value of the counter corresponding to the bucket identifier is incremented according to a preset step value; wherein the preset step value is 1. This solution can improve the accuracy of the statistics of the number of accesses to the memory page.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of server technology, and more particularly to a method for determining the number of accesses to a memory page and a computing device. Background Art

[0002] Since different storage media have different performances, users want to put data in frequently accessed memory pages (hot pages) in memory into storage media with better performance. To this end, it is necessary to determine the number of accesses to each memory page in the memory.

[0003] In the process of determining the number of accesses to a memory page, the related technology regards a continuous device physical address (DPA) area as a bucket, and determines the number of accesses to the memory page by determining the number of accesses to the bucket.

[0004] However, in the related art, when the hot data (high-frequency access data) of the same task is dispersed into different buckets, and each bucket includes multiple memory pages, the statistics of the number of accesses to each memory page included in these multiple buckets will be affected by the hot data, resulting in the method for determining the number of accesses to the memory page in the related art having a low accuracy problem. Summary of the invention

[0005] The embodiment of the present application provides a method and a computing device for determining the number of accesses to a memory page, which can improve the accuracy of determining the number of accesses to a memory page.

[0006] In a first aspect, an embodiment of the present application provides a method for determining the number of accesses to a memory page, the method comprising:

[0007] In response to receiving a first instruction sent by the processor, a storage address of a page attribution table is obtained; wherein the first instruction includes an address of a memory page; the first instruction is used to indicate the address of accessing the memory page; the page attribution table is used to record a mapping relationship between the address of the memory page and the bucket identifier;

[0008] Based on the * storage address of the page attribution table and the address of the memory page, determine the bucket identifier corresponding to the address of the memory page;

[0009] The count value of the counter corresponding to the bucket identifier is incremented according to a preset step value; wherein the preset step value is 1.

[0010] A page attribution table is provided, which describes the mapping relationship between the physical address of the memory page and the bucket identifier. When receiving the first instruction, the memory access controller can find the bucket identifier corresponding to the address of the memory page from the page attribution table, and increase the count value of the counter corresponding to the bucket identifier according to the preset step value. By flexibly defining the bucket identifier mapping relationship by software, the memory bucket and the memory page have a flexible mapping relationship, which can realize the placement of hot and cold data in different buckets, and the uneven division of the bucket size, thereby ensuring the accuracy of the determination of the number of memory page accesses.

[0011] In one implementation, the page attribution table is a multi-level page table;

[0012] The multi-level page table includes a first page belonging table, a second page belonging table and a third page belonging table;

[0013] Among them, the first page belonging table is a first-level page table; the second page belonging table is an intermediate-level page table; the third page belonging table is a final-level page table; the second page belonging table is a first-level or multi-level page table;

[0014] Each page table entry of the first page attribution table and the second page attribution table is used to store the storage address of the next-level page attribution table; each page table entry of the third page attribution table is used to store the bucket identifier.

[0015] By setting each page table entry of the last-level page attribution table to include a bucket identifier, and each page table entry of the first-level page attribution table and the intermediate-level page attribution table to include the storage address of the next-level page attribution table, the page attribution table can be stored discretely, avoiding the need for continuous memory space to store the entire content of the page attribution table, thereby improving memory space utilization.

[0016] In one implementation, the storage address of the page attribution table is the storage address of the first page attribution table;

[0017] Based on the storage address of the page attribution table and the address of the memory page, determine the bucket identifier corresponding to the address of the memory page, including:

[0018] Determine the storage address of the second page belonging table in the first page belonging table based on the storage address of the page belonging table and the first K bits of the address of the memory page;

[0019] Determine a storage address of a third page belonging table in the second page belonging table based on the storage address of the second page belonging table and the middle M bits in the memory page address;

[0020] Based on the storage address of the third page affiliation table and the last N bits of the memory page address, a bucket identifier corresponding to the address of the memory page is determined in the third page affiliation table.

[0021] Based on the storage address of the page attribution table and the address of the memory page, the bucket identifier corresponding to the address of the memory page can be searched level by level.

[0022] In one implementation, the page ownership table is stored in memory.

[0023] By storing the page ownership table that occupies a large space in the memory, the storage pressure of the memory controller is reduced.

[0024] In one implementation, after determining the bucket identifier corresponding to the address of the memory page, the method further includes:

[0025] The bucket identifier corresponding to the address of the memory page is stored in the first memory.

[0026] After determining the bucket identifier corresponding to the storage address of the memory page, the storage address of the memory page and its corresponding bucket identifier are stored in the first memory of the memory access controller so that the bucket identifier corresponding to the address of the memory page can be directly determined later, thereby improving the speed of obtaining the bucket identifier.

[0027] In one implementation, before obtaining the storage address of the page attribution table, the method further includes:

[0028] Determine whether the first memory stores a bucket identifier corresponding to the address of the memory page;

[0029] In the case where the first memory stores a bucket identifier corresponding to the address of the memory page, the count value of the counter corresponding to the bucket identifier is incremented according to a preset step value, wherein the preset step value is 1.

[0030] When receiving the first instruction, it can be identified whether the first memory of the memory access controller stores the bucket identifier corresponding to the address of the memory page to determine whether the bucket identifier can be quickly obtained. Based on the identification of the bucket identifier corresponding to the address of the memory page stored in the first memory, the bucket identifier can be directly obtained, which improves the speed of obtaining the bucket identifier, and further improves the speed of adding 1 to the number of accesses to the memory page based on the first instruction.

[0031] In one implementation, the method further includes:

[0032] When the first memory does not store the bucket identifier corresponding to the address of the memory page, the storage address of the page attribution table is obtained.

[0033] When it is identified that the first memory of the memory access controller does not store the bucket identifier corresponding to the address of the memory page, the page attribution table may be searched to determine the bucket identifier corresponding to the memory page.

[0034] After the count value of the counter corresponding to the bucket identifier is incremented according to the preset step value, the method further includes:

[0035] The count value of the counter corresponding to the bucket identifier is stored in the second memory.

[0036] The count value of the counter corresponding to the bucket identifier (the number of accesses to the memory page corresponding to the bucket identifier) ​​can be securely stored by storing the count value of the counter corresponding to the bucket identifier in the second memory.

[0037] In one implementation, the method further includes:

[0038] In response to receiving a second instruction sent by the processor, sending a count value of a counter corresponding to the bucket identifier to the processor;

[0039] The second instruction is used to instruct to obtain the number of accesses to the memory page.

[0040] In response to receiving a second instruction sent by the processor, a count value of a counter corresponding to the bucket identifier may be sent to the processor, so that the processor can count the number of hot and cold pages based on the count value of the counter corresponding to the bucket identifier.

[0041] In a second aspect, an embodiment of the present application provides a memory access controller, including:

[0042] A transceiver module, configured to obtain a storage address of a page attribution table in response to receiving a first instruction sent by a processor; wherein the first instruction includes an address of a memory page; the first instruction is used to indicate an address of an access memory page; and the page attribution table is used to record a mapping relationship between an address of a memory page and a bucket identifier;

[0043] A processing module, used for determining a bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page;

[0044] The processing module is further used to increase the count value of the counter corresponding to the bucket identifier according to a preset step value; wherein the preset step value is 1.

[0045] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0046] In one implementation, the page attribution table is a multi-level page table;

[0047] The multi-level page table includes a first page belonging table, a second page belonging table and a third page belonging table;

[0048] Among them, the first page belonging table is a first-level page table; the second page belonging table is an intermediate-level page table; the third page belonging table is a final-level page table; the second page belonging table is a first-level or multi-level page table;

[0049] Each page table entry of the first page attribution table and the second page attribution table is used to store the storage address of the next-level page attribution table; each page table entry of the third page attribution table is used to store the bucket identifier.

[0050] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0051] In one implementation, the storage address of the page attribution table is the storage address of the first page attribution table; the processing module is specifically configured to:

[0052] Determine the storage address of the second page belonging table in the first page belonging table based on the storage address of the page belonging table and the first K bits of the address of the memory page;

[0053] Determine a storage address of a third page belonging table in the second page belonging table based on the storage address of the second page belonging table and the middle M bits in the memory address;

[0054] Based on the storage address of the third page affiliation table and the last N bits of the memory address, a bucket identifier corresponding to the address of the memory page is determined in the third page affiliation table.

[0055] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0056] In one implementation, the page ownership table is stored in memory.

[0057] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0058] In one implementation, after determining the bucket identifier corresponding to the address of the memory page, the processing module is further configured to:

[0059] The bucket identifier corresponding to the address of the memory page is stored in the first memory.

[0060] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0061] In one implementation,

[0062] Before obtaining the storage address of the page attribution table, the processing module is further used to:

[0063] Determine whether the first memory stores a bucket identifier corresponding to the address of the memory page;

[0064] In the case where the first memory stores a bucket identifier corresponding to the address of the memory page, the count value of the counter corresponding to the bucket identifier is incremented according to a preset step value, wherein the preset step value is 1.

[0065] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0066] In one implementation, the processing module is further configured to:

[0067] When the first memory does not store the bucket identifier corresponding to the address of the memory page, the storage address of the page attribution table is obtained.

[0068] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0069] In one implementation, after the count value of the counter corresponding to the bucket identifier is incremented according to the preset step value, the processing module is further configured to:

[0070] The count value of the counter corresponding to the bucket identifier is stored in the second memory.

[0071] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0072] In one implementation, the transceiver module is further used for:

[0073] In response to receiving a second instruction sent by the processor, sending a count value of a counter corresponding to the bucket identifier to the processor;

[0074] The second instruction is used to instruct to obtain the number of accesses to the memory page.

[0075] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0076] In a third aspect, an embodiment of the present application further provides a computing device, the computing device comprising: a memory, a memory access controller and a processor; wherein the memory and the memory access controller are electrically connected; the memory access controller and the processor are electrically connected;

[0077] The memory access controller is used to execute the method for determining the number of memory page accesses of the first aspect.

[0078] The memory access controller in the computing device provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technical descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0080] Figure 1a A schematic diagram of a scenario of a method for determining the number of accesses to a memory page applicable to the related art;

[0081] Figure 1b A schematic diagram of another method for determining the number of memory page accesses applicable to the related art;

[0082] Figure 2 A system architecture diagram of a computing device provided in an embodiment of the present application;

[0083] Figure 3 A flowchart of a first embodiment of a method for determining the number of accesses to a memory page provided in an embodiment of the present application;

[0084] Figure 4a A schematic diagram of the structure of page table entries in page tables of various levels in a page attribution table provided in an embodiment of the present application;

[0085] Figure 4b A schematic diagram of the principle of searching for bucket identifiers provided in an embodiment of the present application;

[0086] Figure 4c A schematic diagram of the structure of page table entries in page tables of various levels in another page attribution table provided in an embodiment of the present application;

[0087] Figure 5 A flowchart of a third embodiment of a method for determining the number of accesses to a memory page provided in an embodiment of the present application;

[0088] Figure 6 A flowchart of a fourth embodiment of a method for determining the number of accesses to a memory page provided in an embodiment of the present application;

[0089] Figure 7 A schematic diagram of a scenario for constructing a page attribution table applicable to an embodiment of the present application;

[0090] Figure 8 A schematic diagram of the structure of a memory access controller provided in an embodiment of the present application. DETAILED DESCRIPTION

[0091] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments made by ordinary technicians in this field under the enlightenment of the embodiments belong to the scope of protection of the present application.

[0092] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0093] Figure 1a A schematic diagram of a scenario of a method for determining the number of memory page accesses applicable to the related art. Figure 1a Three buckets (bucket 1, bucket 2, and bucket 3) and three counters (bucket 1 counter, bucket 2 counter, and bucket 3 counter) are shown. Each bucket (contiguous physical address area) includes four memory pages. A, B, C, and D represent four different tasks.

[0094] Among them, the four memory pages of bucket 1 store the data of task A, task B, task C, and task D respectively. The four memory pages of bucket 2 store the data of task A, task B, task C, and task D respectively; the four memory pages of bucket 3 store the data of task A, task B, task C, and task D respectively.

[0095] In the case where the data of task A is hot data, and the data of tasks B, C, and D are all cold data, bucket 1, bucket 2, and bucket 3 all include the data of task A, so bucket 1, bucket 2, and bucket 3 will all be identified as including hot data. In other words, the determination of the number of accesses to each memory page included in these multiple buckets will be affected by the hot data, resulting in the problem of low accuracy in the method for determining the number of accesses to the memory page in the related art, and at the same time, affecting the accuracy of determining the hot and cold data.

[0096] Figure 1b A schematic diagram of another scenario of a method for determining the number of memory page accesses applicable to the related art. Figure 1b Three buckets (bucket 4, bucket 5, and bucket 6) and three counters (bucket 4 counter, bucket 5 counter, and bucket 6 counter) are shown. Each bucket (contiguous physical address area) can be evenly divided into four memory pages. E, F, G, and H represent four different tasks.

[0097] Among them, of the four memory pages in bucket 4, three memory pages store the data of task E and one memory page stores the data of task H. Of the four memory pages in bucket 5, two memory pages store the data of task F, one memory page stores the data of task G, and one memory page stores the data of task H. Of the four memory pages in bucket 6, four memory pages store the data of task H.

[0098] In the case where the data of task H is hot data and the data of tasks E, F and G are cold data, buckets 4, 5 and 6 will all be identified as including hot data because buckets 4, 5 and 6 all include the data of task H. In other words, the determination of the number of accesses to each memory page included in these multiple buckets will be affected by the hot data.

[0099] In summary, in the related art, a continuous device physical address area is regarded as a bucket, and the continuous device physical address area corresponding to each bucket occupies the same size of memory space. This method of evenly dividing the buckets and treating a continuous device physical address as a bucket has the problem of low accuracy in determining the number of memory page accesses.

[0100] In addition, it should be noted that the hardware (such as the memory access controller) lacks sufficient heuristic information (bucketing logic method) to perform non-uniform bucketing, and the hardware can only perform non-uniform bucketing based on the information transmitted by the software. It should be noted that the software can also tell the hardware how to perform non-uniform bucketing through multiple interactions with the hardware. For example, the software can tell the hardware to divide the buckets according to the size of 4KB for the physical address area of ​​the first device (such as address segment A). For the physical address area of ​​the second device (such as address segment B), the buckets are divided according to the size of 8KB. However, when the physical address area (address segment) of the device is relatively fragmented, multiple interactions between the software and the hardware are required to complete the bucketing process, and the bucketing process is relatively cumbersome.

[0101] Based on the above technical problems, an embodiment of the present application provides a method for determining the number of accesses to a memory page, in which a page attribution table that records the mapping relationship between the address of the memory page and the bucket identifier is provided. When receiving a first instruction including the address of the memory page, the memory access controller can determine the bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page, and increment the count value of the counter corresponding to the bucket identifier according to a preset step value. By flexibly defining the mapping relationship between bucket numbers by software, the buckets and memory pages have a flexible mapping relationship, so that hot and cold data can be placed in different buckets, and the size of the buckets can be unevenly divided, thereby ensuring the accuracy of determining the number of memory page accesses.

[0102] The following is a detailed description of the scheme for determining the number of memory page accesses in an embodiment of the present application.

[0103] Figure 2 A system architecture diagram of a computing device provided in an embodiment of the present application.

[0104] like Figure 2 As shown, the computing device 400 includes: a memory access controller 200 and a processor 100 and a memory 300 electrically connected to the memory access controller 200 respectively.

[0105] The memory access controller 200 is used to control the memory 300 and is responsible for data exchange between the memory 300 and the processor 100 .

[0106] Processor 100: may be a central processing unit (CPU), an out-of-band controller, or other devices with specific processing capabilities.

[0107] Memory access controller 200: The memory access controller 200 may be a memory controller, or a computer express link (CXL) memory access controller, or other types of controllers that can control memory and are responsible for data exchange between the memory and the processor.

[0108] Memory 300: Also called internal memory. Memory 300 is an important component of computing device 400, used to temporarily store the operation data in the processor and the data exchanged between the processor and the external memory, and is a bridge for the external memory (or auxiliary memory) to communicate with the processor. Memory 300 can be CXL memory or dynamic random access memory (DRAM).

[0109] It should be noted that one or more software may be run on the processor 100. For example, the processor 100 may run management software 101, application software 103, and application software 104. The processor 100 may also include a third memory 102 for storing a page attribution table. The page attribution table describes the mapping relationship between the address of the memory page and the bucket identifier.

[0110] The memory access controller 200 may include a memory access interface 201, a setting interface 202, and a query interface 203. The above three interfaces may be a multiplexed interface or may be multiple independent interfaces.

[0111] The memory controller 200 may further include a first memory 205 .

[0112] In one achievable manner, the first memory 205 may be used to store a mapping relationship table of memory page addresses and their corresponding bucket identifiers.

[0113] In an implementable manner, the first memory 205 may also be used to store the storage address of the page attribution table.

[0114] In one implementable manner, there may be two first memories 205, wherein one first memory 205 stores a mapping relationship table of memory page addresses and their corresponding bucket identifiers; exemplarily, the memory used to store the mapping relationship table of memory page addresses and their corresponding bucket identifiers may be a memory such as a flash memory; and the other first memory 205 is used to store the storage address of the page attribution table; exemplarily, the memory used to store the storage address of the page attribution table may be a register.

[0115] The memory access controller 200 may include a second memory 206, and the count value of the counter corresponding to the bucket identifier may be stored in the second memory 206. It should be noted that the first memory 205 and the second memory 206 may be the same memory or different memories.

[0116] The memory controller 200 may run a mapping relationship lookup logic 204 (program).

[0117] The memory access controller 200 may also run a counter 207 (program) (each bucket identifier may correspond to a counter). The count value of the timer may be incremented according to a preset step value.

[0118] The memory access controller 200 can obtain the page attribution table and the storage address of the page attribution table sent by the processor 100. The memory access controller 200 can store the storage address of the page attribution table in the first memory 205, and store the page attribution table in the memory 300. Specifically, the management software 101 on the processor 100 can send the storage address of the page attribution table and the page attribution table to the memory access controller 200 through the setting interface 202. The memory access controller 200 can store the storage address of the page attribution table in the first memory 205. The memory access controller 200 can store the page attribution table in the memory 300.

[0119] The memory access controller 200 can respond to the first instruction sent by the host 100, and search the bucket identifier corresponding to the address of the memory page in the first instruction from the page attribution table stored in the memory 300, and increase the count value of the counter corresponding to the bucket identifier according to the preset step value. Specifically, when the application software 103 or the application software 104 of the processor 100 accesses the memory 300 through the memory access interface 201 of the memory access controller 200, the mapping relationship search logic 204 will be triggered to search the storage address of the page attribution table recorded in the first memory 205, and then determine the bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page, and increase the count value of the counter corresponding to the bucket identifier according to the preset step value.

[0120] The memory access controller 200 may send the count value of the counter corresponding to each bucket identifier to the processor 100 in response to the second instruction sent by the processor 100, so that the processor 100 can count the hot and cold pages according to the count value of the counter corresponding to each bucket identifier. Specifically, the management software 101 on the processor 100 may obtain the count value of the counter corresponding to the bucket identifier stored in the second memory 206 through the query interface 203 of the memory access controller 200.

[0121] It should be noted that Figure 2The processor 100, memory controller 200 and memory 300 shown belong to the same computing device. The processor 100, memory controller 200 and memory 300 may also belong to different computing devices.

[0122] In one implementation, when the processor 100, the memory controller 200, and the memory 300 belong to the same computing device, the memory controller 200 and the memory 300 may be integrated into the same memory device, for example, both may be integrated on the same board.

[0123] In one implementation, when the processor 100 , the memory controller 200 , and the memory 300 belong to the same computing device, the processor 100 and the memory controller 200 may be integrated together; for example, the memory controller 200 may be a memory controller, and the memory controller 200 may be integrated into the processor 100 .

[0124] In one implementation, when the processor 100, the memory controller 200, and the memory 300 belong to different computing devices, the processor 100 may belong to a first computing device, the memory controller 200 and the memory 300 may belong to a second computing device (for example, the second computing device may be a CXL device), and the memory controller 200 and the memory 300 may be integrated in the same memory device. The first computing device and the second computing device may be connected via a cable.

[0125] It should also be noted that the computing device 400 may be a server or a terminal device (such as a computer, etc.).

[0126] It should also be noted that Figure 2 This is only a system architecture diagram of a computing device provided in the embodiment of the present application. Figure 2 The actual form of the various devices included in the Figure 2 The interaction mode between devices is limited, and in the application of the solution, it can be set according to actual needs.

[0127] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0128] Figure 3 A flowchart of a method for determining the number of accesses to a memory page according to an embodiment of the present application. Figure 3 , the method specifically comprises the following steps:

[0129] S301: In response to receiving a first instruction sent by a processor, obtaining a storage address of a page affiliation table.

[0130] In this embodiment, the memory access controller may obtain the storage address of the page affiliation table in response to receiving the first instruction sent by the processor.

[0131] The page attribution table is used to record the mapping relationship between the address of the memory page and the bucket number.

[0132] The first instruction includes the address of the memory, and the first instruction is used to instruct to access the address of the memory page. It should be noted that, since the address of the memory includes the address of the memory page, the first instruction includes the address of the memory page.

[0133] In addition, when receiving the first instruction sent by the memory, the memory access controller can also read the data in the memory page from the memory based on the address of the memory page in the first instruction, and feed the data in the memory page back to the processor.

[0134] It should be noted that the access controller can pre-acquire the page attribution table sent by the processor and store the page attribution table in the memory. The memory controller can also pre-acquire the storage address of the page attribution table sent by the processor and store the storage address of the page attribution table in the first memory of the memory controller.

[0135] It should also be noted that the processor can flexibly construct a page attribution table based on user needs. The page attribution table describes the mapping relationship between the address of the memory page and the bucket identifier. It should be noted that the size of the memory space occupied by the bucket corresponding to each bucket identifier can be the same or different.

[0136] By flexibly defining the bucket number mapping relationship by software, the memory buckets and memory pages have a flexible mapping relationship, which can realize the placement of hot and cold data in different buckets, and the uneven division of bucket sizes, thereby ensuring the accuracy of the determination of the number of memory page accesses.

[0137] Exemplarily, the processor can identify the address of the memory page corresponding to the data of each task based on user requirements (the requirement that the data in all memory pages corresponding to each bucket identifier is the data of the same task) to divide the bucket identifiers corresponding to the addresses of the memory pages corresponding to the data of each task. In the division process, the addresses of multiple memory pages corresponding to the data of each task are corresponded to the same bucket identifier, or to different bucket identifiers. The addresses of memory pages corresponding to the data of different tasks are corresponded to different bucket identifiers. In other words, the data of the same task can be stored in the same bucket or in different buckets, and the data stored in the same bucket is the data of the same task. In one implementation, the processor can construct a page attribution table based on the mapping relationship between the address of the memory page input by the user and the bucket identifier. By setting the page attribution table in which the same bucket only includes the data of the same task, it is possible to place cold and hot data in different buckets, thereby ensuring the accuracy of determining the number of memory page accesses, thereby improving the accuracy of the subsequent processor in counting cold and hot pages based on the number of memory page accesses.

[0138] S302: Determine a bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page.

[0139] In this embodiment, the memory access controller can determine the bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page after obtaining the storage address of the page attribution table and the address of the memory page. That is, the memory access controller can search the page attribution table stored in the memory based on the storage address of the page attribution table and the address of the memory page to determine the bucket identifier corresponding to the address of the memory page. Exemplarily, the bucket identifier can be a bucket number. This embodiment does not limit the specific form of the bucket identifier.

[0140] It should be noted that, in one implementation, a page attribution table may also be stored in the memory access controller. In the case where the memory access controller stores the page attribution table, the memory access controller may, in response to the first instruction sent by the processor, directly search for the bucket identifier corresponding to the address of the memory page from the page attribution table stored in the memory access controller, and increment the count value of the counter corresponding to the bucket identifier according to a preset step value. It should also be noted that before the memory access controller searches for the bucket identifier corresponding to the address of the memory page in the first instruction from the page attribution table, it may obtain the page attribution table sent by the processor and store the page attribution table in the first memory of the memory access controller.

[0141] S303: Increment the count value of the counter corresponding to the bucket identifier according to a preset step value.

[0142] In this embodiment, after determining the bucket identifier corresponding to the address of the memory page, the memory access controller may increase the count value of the counter corresponding to the bucket identifier according to a preset step value, wherein the preset step value is 1.

[0143] In other words, the memory access controller may increase the number of accesses corresponding to the bucket identifier by 1.

[0144] In the present embodiment, a page attribution table is provided, which describes the mapping relationship between the address of the memory page and the bucket identifier. When receiving the first instruction including the address of the memory page, the memory access controller can obtain the storage address of the page attribution table, determine the bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page, and increment the count value of the counter corresponding to the bucket identifier according to the preset step value to add 1 to the number of accesses to the memory page. By the above-mentioned method of flexibly defining the mapping relationship of the bucket numbers by software, the memory buckets and memory pages have a flexible mapping relationship, which can realize the placement of hot and cold data in different buckets, and the uneven division of the bucket sizes, thereby ensuring the accuracy of identifying hot and cold data, and thus improving the accuracy of the subsequent processor statistics of hot and cold pages.

[0145] The following is a detailed description of a process in which the memory access controller determines the bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page through method embodiment 2.

[0146] In this embodiment, the page belonging table may be a multi-level page table. The page belonging table is stored in the memory.

[0147] In the case where the page attribution table is a multi-level page table, the multi-level page table includes a first page attribution table, a second page attribution table, and a third page attribution table. The first page attribution table is a first-level page table; the second page attribution table is a middle-level page table; the third page attribution table is a last-level page table; and the second page attribution table is a first-level or multi-level page table.

[0148] For example, Figure 4a A schematic diagram of the structure of page table entries in each level of page table in a page attribution table provided in an embodiment of the present application. Each page table entry in the first page attribution table and the second page attribution table is used to store the storage address of the next level page attribution table; each page table entry in the third page attribution table is used to store a bucket identifier.

[0149] The memory controller determines the bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page:

[0150] After obtaining the storage address of the page attribution table (the storage address of the first page attribution table), the memory access controller determines the storage address of the second page attribution table in the first page attribution table based on the storage address of the page attribution table (the storage address of the first page attribution table) and the first K bits of the address of the memory page. In other words, the memory access controller can determine that a certain page table entry in the first page attribution table is the first target page table entry based on the storage address of the first page attribution table and the first K bits of the address of the memory page, and use the storage address of the next-level page attribution table stored in the first target page table entry as the storage address of the second page attribution table.

[0151] The memory access controller determines the storage address of the third page attribution table in the second page attribution table based on the storage address of the second page attribution table and the middle M bits in the memory address. That is, the memory access controller can determine that a certain page table entry in the second page attribution table is the second target page table entry based on the storage address of the second page attribution table and the middle M bits in the address of the memory page, and use the storage address of the next-level page attribution table stored in the second target page table entry as the storage address of the third page attribution table.

[0152] The memory access controller determines the bucket identifier corresponding to the address of the memory page in the third page attribution table based on the storage address of the third page attribution table and the last N bits of the memory address. That is, the memory access controller can determine that a certain page table entry in the third page attribution table is the third target page table entry based on the storage address of the third page attribution table and the last N bits of the address of the memory page, and use the bucket identifier stored in the third target page table entry as the bucket identifier corresponding to the address of the memory page.

[0153] Figure 4b A schematic diagram of the principle of searching for bucket identifiers provided in an embodiment of the present application. Figure 4b As shown, for the address of the first memory page and the address of the second memory page, the memory access controller can determine the bucket identifier corresponding to the address of the first memory page, and determine the bucket identifier corresponding to the address of the second memory page.

[0154] Specifically, when the page attribution table is a three-level page table, in the process of determining the bucket identifier corresponding to the address of the first memory page:

[0155] The memory access controller may determine that the fourth page table entry among the multiple page table entries in the first page attribution table is the first target page table entry based on the storage address of the page attribution table (the storage address of the first page attribution table) and the first K bits of the address of the first memory page. The memory access controller may determine that the storage address of the next-level page attribution table in the first target page table entry is the storage address of the second page attribution table. The memory access controller may determine that the second page table entry among the multiple page table entries in the second page attribution table is the second target page table entry based on the storage address of the second page attribution table and the middle M bits of the address of the first memory page. The memory access controller may determine that the storage address of the next-level page attribution table in the second target page table entry is the storage address of the third page attribution table. The memory access controller may determine that the third page table entry among the multiple page table entries in the third page attribution table is the third target page table entry based on the storage address of the third page attribution table and the last N bits of the address of the first memory page. The memory access controller may determine that the bucket identifier (bucket identifier 1) stored in the third target page table entry is the bucket identifier corresponding to the address of the first memory page.

[0156] When the page attribution table is a three-level page table, in the process of determining the bucket identifier corresponding to the address of the second memory page:

[0157] The memory access controller may determine that the fourth page table entry among the multiple page table entries in the first page attribution table is the first target page table entry based on the storage address of the page attribution table (the storage address of the first page attribution table) and the first K bits of the address of the second memory page. The memory access controller may determine that the storage address of the next-level page attribution table in the first target page table entry is the storage address of the second page attribution table. The memory access controller may determine that the fourth page table entry among the multiple page table entries in the second page attribution table is the second target page table entry based on the storage address of the second page attribution table and the middle M bits of the address of the second memory page. The memory access controller may determine that the storage address of the next-level page attribution table in the second target page table entry is the storage address of the third page attribution table. The memory access controller may determine that the fifth page table entry among the multiple page table entries in the third page attribution table is the third target page table entry based on the storage address of the third page attribution table and the last N bits of the address of the second memory page. The memory access controller may determine that the bucket identifier (bucket identifier 4) stored in the third target page table entry is the bucket identifier corresponding to the address of the first memory page. In one implementation, when the page attribution table is a multi-level page table, each page table entry of the first page attribution table and the second page attribution table is used to store the storage address of the next level page attribution table and the bucket identifier corresponding to the next level page attribution table.

[0158] Figure 4c A schematic diagram of the structure of page table entries in each level of page table in another page belonging table provided in an embodiment of the present application. Figure 4cAs shown, in the case where the page attribution table is a three-level page table, each page table entry of the first page attribution table includes the storage address of the next-level page attribution table (the second page attribution table) and the corresponding bucket identifier. Each page table entry of the second page attribution table includes the storage address of the next-level page attribution table (the third page attribution table) and the corresponding bucket identifier. Each page table entry of the third page attribution table includes a bucket identifier.

[0159] In the process of finding the bucket identifier corresponding to the address of the memory page:

[0160] Based on the fact that each page table entry of the first page attribution table (first-level page attribution table) includes the storage address of the next-level page attribution table and the corresponding bucket identifier, the memory access controller can directly determine the bucket identifier corresponding to the address of the memory page in the first page attribution table based on the storage address of the page attribution table (the storage address of the first page attribution table) and the first K bits of the address of the memory page.

[0161] It should be noted that when all page table entries in a certain level of page attribution table correspond to the same bucket identifier, the bucket identifier can be directly registered in the page table entry of the previous level page attribution table corresponding to the page attribution table, so that the memory does not need to store the page attribution table of this level, thereby achieving the effect of saving memory.

[0162] In addition, it should be noted that, since it is easy to distinguish between the bucket identifier and the storage address of the next-level page attribution table, the storage address of the next-level page attribution table included in a page table entry can reuse the same memory unit as the bucket identifier, thereby further saving the memory space required to store the page attribution table. Exemplarily, the storage address of the next-level page attribution table included in a page table entry can be stored in the same page as the bucket identifier, where a page represents the smallest read and write unit in the memory.

[0163] In this embodiment, the page attribution table that occupies a larger space is stored in the memory, and the storage address of the page attribution table that occupies a smaller space is stored in the memory access controller. The memory access controller can search the page attribution table for the bucket identifier corresponding to the address of the memory page by reading the storage address of the page attribution table stored in the memory access controller and the address of the memory page. The embodiment of the present application reduces the storage pressure of the memory access controller by storing the storage address of the page attribution table in the memory access controller and storing the page attribution table in the memory with a larger storage space.

[0164] Figure 5 A flowchart of a third embodiment of a method for determining the number of accesses to a memory page provided in an embodiment of the present application. Figure 5 , the method specifically comprises the following steps:

[0165] S501: In response to receiving a first instruction sent by a processor, determining whether a first memory stores a bucket identifier corresponding to an address of a memory page.

[0166] In this embodiment, in response to receiving the first instruction sent by the processor, the memory access controller can determine whether the first memory stores the bucket identifier corresponding to the address of the memory page.

[0167] When the memory access controller determines that the first memory does not store the bucket identifier corresponding to the address of the memory page, the memory access controller executes S502; when the memory access controller determines that the first memory stores the bucket identifier corresponding to the address of the memory page, the memory access controller executes S506.

[0168] S502: Obtain the storage address of the page attribution table.

[0169] In this embodiment, when the memory access controller determines that the first memory does not store the bucket identifier corresponding to the address of the memory page, it can obtain the storage address of the page attribution table.

[0170] S503: Determine a bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page.

[0171] In this embodiment, after obtaining the storage address of the page attribution table, the memory access controller can determine the bucket identifier corresponding to the address of the memory page according to the storage address of the page attribution table and the address of the memory page. The specific execution is the same as S302 and will not be repeated here.

[0172] S504: Increment the count value of the counter corresponding to the bucket identifier according to a preset step value.

[0173] In this embodiment, the memory access controller may increase the count value of the counter corresponding to the bucket identifier according to a preset step value, wherein the preset step value is 1. The specific execution is the same as S303, and will not be repeated here.

[0174] S505: Store the address of the memory page and its corresponding bucket identifier in the first memory.

[0175] In this embodiment, after determining the bucket identifier corresponding to the address of the memory page, the memory access controller can store the address of the memory page and its corresponding bucket identifier in the first memory of the memory access controller. For example, the address of the memory page and its corresponding bucket identifier are stored in a mapping table so that the bucket identifier corresponding to the memory page can be quickly obtained later.

[0176] It should be noted that the embodiment of the present application does not limit the execution order of S504 and S505. The memory access controller may execute S504 first and then execute S505; the memory access controller may also execute S505 first and then execute S504.

[0177] S506: Increment the count value of the counter corresponding to the bucket identifier according to the preset step value.

[0178] In this embodiment, when the memory access controller determines the bucket identifier corresponding to the address of the memory page stored in the first memory, the count value of the counter corresponding to the bucket identifier may be incremented according to the preset step value. The preset step value is 1. In one implementation, the memory access controller may also add 1 to the number of calls corresponding to the address of the memory page. The memory access controller may sort the addresses of multiple memory pages stored in the memory access controller according to the number of calls corresponding to the address of each memory page, and delete the addresses of the memory pages whose sorting is less than the preset sequence number and their corresponding bucket identifiers.

[0179] In one implementation, the memory access controller may establish a mapping relationship between the address of the memory page and the call time information. The memory access controller may filter out the memory pages whose time interval between the corresponding call time information and the current time information is greater than a preset time interval, and delete the mapping relationship between the filtered memory pages and the bucket identifiers.

[0180] In this embodiment, the memory access controller can determine whether the bucket identifier corresponding to the address of the memory page is stored in the first memory upon receiving the first instruction. In the case where the bucket identifier corresponding to the address of the memory page is stored in the first memory, the count value of the counter corresponding to the bucket identifier is incremented according to the preset step value; in the case where the bucket identifier corresponding to the address of the memory page is not stored in the first memory, the storage address of the page attribution table is obtained, and based on the storage address of the page attribution table and the address of the memory page, the bucket identifier corresponding to the address of the memory page is determined, and the count value of the counter corresponding to the bucket identifier is incremented according to the preset step value. By directly obtaining the bucket identifier according to the bucket identifier corresponding to the address of the memory page stored in the first memory of the memory access controller, the speed of obtaining the bucket identifier is improved, thereby improving the speed of adding 1 to the number of accesses to the memory page based on the first instruction.

[0181] Figure 6 A flowchart of a fourth embodiment of a method for determining the number of accesses to a memory page provided in an embodiment of the present application. Figure 6 , the method specifically comprises the following steps:

[0182] S601: In response to receiving a first instruction sent by a processor, obtaining a storage address of a page affiliation table.

[0183] In this embodiment, the memory access controller obtains the storage address of the page attribution table in response to receiving the first instruction sent by the processor; wherein the first instruction includes the address of the memory page; the first instruction is used to indicate the address of accessing the memory page; the page attribution table is used to record the mapping relationship between the address of the memory page and the bucket identifier.

[0184] The specific implementation method is the same as S301 and will not be repeated here.

[0185] S602: Determine a bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page.

[0186] In this embodiment, the memory access controller may determine the bucket identifier corresponding to the address of the memory page based on the storage address of the page affiliation table and the address of the memory page.

[0187] The specific implementation method is the same as S302 and will not be repeated here.

[0188] S603: Increment the count value of the counter corresponding to the bucket identifier according to a preset step value.

[0189] In this embodiment, the memory access controller may increase the count value of the counter corresponding to the bucket identifier according to a preset step value, wherein the preset step value is 1.

[0190] The specific implementation method is the same as S303 and will not be repeated here.

[0191] S604: Store the count value of the counter corresponding to the bucket identifier in the second memory.

[0192] In this embodiment, the memory access controller may store the count value of the counter corresponding to the bucket identifier in the second memory of the memory access controller, so as to save the count value of the counter corresponding to the bucket number.

[0193] S605: In response to receiving the second instruction sent by the processor, sending the count value of the counter corresponding to the bucket identifier to the processor.

[0194] In this embodiment, the memory access controller may send the count value of the counter corresponding to the bucket identifier to the processor in response to receiving a second instruction sent by the processor, wherein the second instruction is used to indicate the number of accesses to obtain the memory page.

[0195] It should be noted that the processor can count the hot and cold pages according to the count value of the counter corresponding to the bucket identifier.

[0196] In one implementation, after receiving the count value of the counter corresponding to the bucket identifier, the processor determines the memory page corresponding to the bucket identifier whose count value is greater than a preset threshold as a hot page; and determines the memory page corresponding to the bucket identifier whose count value is less than or equal to the preset threshold as a cold page.

[0197] Specifically, the management software in the processor can determine the hot and cold pages corresponding to each bucket identifier based on the preset threshold in the user's requirements and the count value of the counter corresponding to the bucket identifier sent by the memory access controller, thereby determining the hot and cold pages corresponding to each memory page.

[0198] After counting the hot and cold pages, the management software in the processor can migrate the data in the hot page from the memory to the dynamic random access memory (DRAM) directly connected to the processor. Specifically, the management software in the processor can allocate a new page in the DRAM, and then copy the data in the old page (the memory page counted as the hot page) to the new page. The management software in the processor can release the mapping relationship of the old page (the mapping relationship between the logical address and the physical address), map the mapping relationship to the new page, and release the old page.

[0199] In this embodiment, a page attribution table is provided, which describes the mapping relationship between the address of the memory page and the bucket identifier. The memory access controller obtains the storage address of the page attribution table in response to receiving the first instruction sent by the processor. The memory access controller determines the bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page. The memory access controller increments the count value of the counter corresponding to the bucket identifier according to the preset step value. The memory access controller stores the count value of the counter corresponding to the bucket identifier in the second memory. The memory access controller can send the count value of the counter corresponding to the bucket identifier to the processor in response to receiving the second instruction sent by the processor. Through the above-mentioned method of flexibly defining the bucket identifier mapping relationship by software, a more sophisticated bucketing rule can be provided, thereby improving the accuracy of the subsequent processor in counting the hot and cold pages based on the count value of the counter corresponding to the bucket identifier.

[0200] The following is a fifth method embodiment to describe in detail the process in which the memory access controller obtains the page attribution table sent by the processor and stores the page attribution table in the memory.

[0201] In this embodiment, the memory access controller may obtain the page ownership table sent by the processor, and store the page ownership table in the memory.

[0202] Taking the memory as a CXL type 3 storage device as an example, the memory access controller can obtain the page attribution table sent by the processor, and the page attribution table can be a four-level page table, including a first page attribution table, a second page attribution table and a third page attribution table, wherein the second page attribution table can be a two-level page table.

[0203] The size of each level of page attribution table is 4KB. The length of each page table entry in the first page attribution table is 2 bytes, corresponding to a maximum of 65536 buckets (2 bytes 16 bits, which can represent = 65536 states). The page table entries of the remaining levels of page tables are all 8 bytes long, and the entire page attribution table can describe up to 512 512 512 Bucket mapping of 2048 memory pages ( =2048, =512).

[0204] In one implementation, the memory access controller may include 256 counters, that is, supports the use of 256 bucket identifiers.

[0205] Figure 7 A schematic diagram of a scenario for constructing a page attribution table applicable to an embodiment of the present application.

[0206] like Figure 7 As shown, the virtual address space (logical address range) of task 1 is 0x1000-0x6000 and 0x21000-0x23000 respectively.

[0207] The memory pages corresponding to 0x1000-0x6000 are 0x800000, 0x802000, 0x900000, 0x901000, and 0x902000. The memory pages corresponding to 0x21000-0x23000 are 0x801000 and 0x803000.

[0208] The virtual address spaces of task 2 are 0x1000-0x2000 and 0x41000-0x45000 respectively.

[0209] The memory page corresponding to 0x1000-0x2000 is 0x804000. The memory pages corresponding to 0x41000-0x45000 are 0x805000, 0x903000, 0x904000, and 0x905000.

[0210] The management software in the processor can construct a page attribution table, which describes the mapping relationship between the address of the memory page and the bucket identifier. In other words, the page attribution table describes the bucket identifiers corresponding to the memory pages 0x800000, 0x802000, 0x90000, 0x901000, 0x902000, 0x801000, 0x803000, 0x804000, 0x805000, 0x903000, 0x904000 and 0x905000.

[0211] In one implementation, 0x800000, 0x802000, 0x90000, 0x901000, and 0x902000 correspond to bucket identifier 1; 0x801000 and 0x803000 correspond to bucket identifier 2; 0x804000 corresponds to bucket identifier 3; 0x805000, 0x903000, 0x904000, and 0x905000 correspond to bucket identifier 4.

[0212] After constructing the page attribution table, the processor may send the page attribution table to the memory access controller. After receiving the page attribution table, the memory access controller may read the page attribution table in a direct memory access (DMA) manner and store the page attribution table in the memory.

[0213] In this embodiment, the processor can flexibly construct a page attribution table based on user needs. By flexibly defining the bucket identifier mapping relationship by software, more sophisticated bucket rules can be provided, thereby improving the accuracy of the subsequent processor counting the hot and cold pages based on the count value of the counter corresponding to the bucket identifier.

[0214] The following are device embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

[0215] An embodiment of the present application also provides a memory access controller. Figure 8 A schematic diagram of the structure of a memory access controller provided in an embodiment of the present application; Figure 8As shown, the memory access controller 80 includes: a transceiver module 81 and a processing module 82. The transceiver module 81 is used to obtain the storage address of the page attribution table in response to receiving the first instruction sent by the processor; the first instruction includes the address of the memory page; the first instruction is used to indicate the address of the memory page to be accessed; the page attribution table is used to record the mapping relationship between the address of the memory page and the bucket identifier; the processing module 82 is used to determine the bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page; the processing module 82 is also used to increment the count value of the counter corresponding to the bucket identifier according to a preset step value; the preset step value is 1.

[0216] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0217] In one implementation, the page attribution table is a multi-level page table; the multi-level page table includes a first page attribution table, a second page attribution table and a third page attribution table; wherein the first page attribution table is a first-level page table; the second page attribution table is an intermediate-level page table; the third page attribution table is a last-level page table; the second page attribution table is a first-level or multi-level page table; each page table entry of the first page attribution table and the second page attribution table is used to store the storage address of the next-level page attribution table; each page table entry of the third page attribution table is used to store a bucket identifier.

[0218] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0219] In one implementation, the storage address of the page attribution table is the storage address of the first page attribution table; the processing module 82 is specifically used to: determine the storage address of the second page attribution table in the first page attribution table based on the storage address of the page attribution table and the first K bits in the address of the memory page; determine the storage address of the third page attribution table in the second page attribution table based on the storage address of the second page attribution table and the middle M bits in the memory page address; determine the bucket identifier corresponding to the address of the memory page in the third page attribution table based on the storage address of the third page attribution table and the last N bits in the memory page address.

[0220] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0221] In one implementation, the page ownership table is stored in memory.

[0222] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0223] In one implementation, after determining the bucket identifier corresponding to the address of the memory page, the processing module 82 is further configured to: store the bucket identifier corresponding to the address of the memory page in the first memory.

[0224] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0225] In one implementation, before obtaining the storage address of the page attribution table, the processing module 82 is also used to: determine whether the first memory stores the bucket identifier corresponding to the address of the memory page; when the first memory stores the bucket identifier corresponding to the address of the memory page, increase the count value of the counter corresponding to the bucket identifier according to a preset step value, wherein the preset step value is 1.

[0226] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0227] In one implementation, the processing module 82 is further configured to: when the first memory does not store the bucket identifier corresponding to the address of the memory page, obtain the storage address of the page attribution table.

[0228] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0229] In one implementation, after the count value of the counter corresponding to the bucket identifier is incremented according to the preset step value, the processing module 82 is further configured to: store the count value of the counter corresponding to the bucket identifier in the second memory.

[0230] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0231] In one implementation, the transceiver module 81 is further used to: in response to receiving a second instruction sent by the processor, send a count value of a counter corresponding to the bucket identifier to the processor; wherein the second instruction is used to indicate the number of accesses to the memory page.

[0232] The memory access controller provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described again here.

[0233] The embodiment of the present application also provides a computing device, including: a memory, a memory access controller and a processor; wherein the memory and the memory access controller are electrically connected; the memory access controller and the processor are electrically connected;

[0234] The memory access controller is used to execute the technical solution in the aforementioned method embodiment, and its implementation principle and technical effect are similar and will not be repeated here.

[0235] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, disk or optical disk and other media that can store program codes.

[0236] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for determining the number of accesses to a memory page, characterized in that: The method comprises: In response to receiving a first instruction sent by the processor, a storage address of a page attribution table is obtained; wherein the first instruction includes an address of a memory page; the first instruction is used to indicate an address for accessing the memory page; the page attribution table is constructed by the processor based on user requirements, and the page attribution table is used to record a mapping relationship between the address of the memory page and a bucket identifier; Determine a bucket identifier corresponding to the address of the memory page based on the storage address of the page attribution table and the address of the memory page; The count value of the counter corresponding to the bucket identifier is incremented according to a preset step value; wherein the preset step value is 1.

2. The method according to claim 1, characterized in that The page attribution table is a multi-level page table; The multi-level page table includes a first page attribution table, a second page attribution table and a third page attribution table; Wherein, the first page attribution table is a first-level page table; the second page attribution table is a middle-level page table; the third page attribution table is a last-level page table; the second page attribution table is a first-level or multi-level page table; Each page table entry of the first page attribution table and the second page attribution table is used to store a storage address of a next-level page attribution table; each page table entry of the third page attribution table is used to store a bucket identifier.

3. The method according to claim 2, characterized in that The storage address of the page belonging table is the storage address of the first page belonging table; The determining, based on the storage address of the page attribution table and the address of the memory page, a bucket identifier corresponding to the address of the memory page includes: Determine the storage address of the second page belonging table in the first page belonging table based on the storage address of the page belonging table and the first K bits of the address of the memory page; Determine the storage address of the third page belonging table in the second page belonging table based on the storage address of the second page belonging table and the middle M bits in the memory page address; Based on the storage address of the third page attribution table and the last N bits of the memory page address, a bucket identifier corresponding to the address of the memory page is determined in the third page attribution table.

4. The method according to claim 1, characterized in that The page belonging table is stored in the memory.

5. The method according to any one of claims 2 to 4, characterized in that: After determining the bucket identifier corresponding to the address of the memory page, the method further includes: The address of the memory page and the corresponding bucket identifier are stored in the first memory.

6. The method according to claim 5, characterized in that Before obtaining the storage address of the page attribution table, the method further includes: Determine whether the first memory stores a bucket identifier corresponding to the address of the memory page; In a case where the first memory stores the bucket identifier corresponding to the address of the memory page, the count value of the counter corresponding to the bucket identifier is incremented according to a preset step value, wherein the preset step value is 1.

7. The method according to claim 6, characterized in that The method further comprises: When the first memory does not store the bucket identifier corresponding to the address of the memory page, the storage address of the page attribution table is obtained.

8. The method according to any one of claims 1-4, 6-7, characterized in that: After the count value of the counter corresponding to the bucket identifier is incremented according to the preset step value, the method further includes: The count value of the counter corresponding to the bucket identifier is stored in the second memory.

9. The method according to claim 8, characterized in that The method further comprises: In response to receiving a second instruction sent by the processor, sending a count value of the counter corresponding to the bucket identifier to the processor; The second instruction is used to instruct obtaining the number of accesses to the memory page.

10. A computing device, characterized in that: The computing device comprises: a memory, a memory access controller and a processor; wherein the memory and the memory access controller are electrically connected; the memory access controller and the processor are electrically connected; The memory access controller is used to execute the method for determining the number of accesses to a memory page according to any one of claims 1-9.

Citation Information

Patent Citations

  • Bucket cross-pool access method and equipment of distributed storage system

    CN116319839A

  • Method and apparatus for estimating the number of occurrences of frequent values in a data set

    US5542089A