Method and device for releasing prefetch request

By releasing hit prefetch requests and their associated requests from the prefetch request queue, the problem of repeated data cache lookups for prefetch requests in the processor is solved, reducing power consumption and improving the efficiency of data prefetching.

CN120929258APending Publication Date: 2025-11-11HYGON INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511045378.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

In existing technologies, different prefetch engines in the processor predict memory access behavior, causing the same prefetch request to repeatedly look up the data cache, resulting in additional power consumption.

Method used

By releasing hit prefetch requests and their associated requests from the prefetch request queue, and utilizing hit information from the virtual-to-physical address translation cache and address miss status tracking register, the management of the prefetch request queue is optimized, reducing the power consumption of repeated lookups.

Benefits of technology

It reduces the additional power consumption of data prefetching, and improves the utilization of the prefetch request queue and the accuracy of data prefetching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929258A_ABST
    Figure CN120929258A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for releasing prefetch requests. The method comprises the following steps: acquiring an earliest prefetch request from a prefetch request queue as a prefetch request to be processed; if it is judged that the to-be-processed prefetch request is hit in a virtual-real address translation cache and hit in a target cache, or the to-be-processed prefetch request is hit in the virtual-real address translation cache and hit in an address missing state tracking register; and if so, releasing the to-be-processed prefetch request and the related prefetch request from the prefetch request queue. The device is used for executing the method. According to the prefetching request releasing method and device provided by the embodiment of the invention, the extra power consumption of data prefetching is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more specifically to a method and apparatus for releasing a prefetch request. Background Technology

[0002] As processor design continues to be optimized, the performance gap between it and memory is widening, leading to the memory wall problem. To address this problem, multi-level data caching was introduced, leveraging the spatial and temporal locality of memory access to reduce latency and thus bridge the performance gap between the processor and memory.

[0003] Data prefetching predicts memory access behavior and prefetches the necessary data into a data cache closer to the processor. When this data is accessed, it can be retrieved directly from the faster cache, thus speeding up memory access and bridging the performance gap between the processor and memory. Existing technologies use data prefetching algorithms such as StreamingPrefetch, StridePretch, and region-based prefetching to predict memory access behavior. Since different data prefetching algorithms target different memory access behaviors, processors typically integrate multiple algorithms, each corresponding to a prefetching engine. Different prefetching engines within the processor core are trained to perform different memory access behaviors; however, some memory access behaviors can be captured by different prefetching engines, resulting in identical prefetch requests. Although filtering mechanisms have been implemented to eliminate identical prefetch requests, in practical applications, it has been found that some identical prefetch requests still repeatedly search the data cache, leading to additional power consumption. Summary of the Invention

[0004] To address the problems in the prior art, embodiments of the present invention provide a method and apparatus for releasing prefetch requests, which can at least partially solve the problems existing in the prior art.

[0005] In a first aspect, the present invention proposes a method for releasing a prefetch request, comprising:

[0006] The earliest prefetch request is retrieved from the prefetch request queue as the prefetch request to be processed;

[0007] If it is determined that the pending prefetch request is hit in both the virtual-to-physical address translation cache and the target cache, or that the pending prefetch request is hit in both the virtual-to-physical address translation cache and the address missing status tracking register, then the pending prefetch request and related prefetch requests are released from the prefetch request queue.

[0008] Further, releasing the pending prefetch request and related prefetch requests from the prefetch request queue includes:

[0009] Based on the group number of the prefetch request to be processed, the group queue to which the prefetch request to be processed belongs is determined; wherein, the prefetch request queue includes multiple group queues, and each group queue has a corresponding group number;

[0010] Based on the timestamp of the prefetch request to be processed and the timestamps of other prefetch requests in the group queue to which the prefetch request to be processed belongs, obtain the prefetch request corresponding to a first preset number of timestamps that are later than the timestamp of the prefetch request to be processed and closest to the timestamp of the prefetch request to be processed, and use it as the prefetch request related to the prefetch request to be processed.

[0011] Release the pending prefetch request and related prefetch requests.

[0012] Further, releasing the pending prefetch request and related prefetch requests from the prefetch request queue includes:

[0013] Based on the time tag of the prefetch request to be processed and the time tags of other prefetch requests in the prefetch request queue, obtain the prefetch request corresponding to the second preset number of time tags that are later than the time tag of the prefetch request to be processed and closest to the time tag of the prefetch request to be processed, and use it as the prefetch request related to the prefetch request to be processed.

[0014] Release the pending prefetch request and related prefetch requests.

[0015] Furthermore, the method for releasing a prefetch request provided in this embodiment of the invention further includes:

[0016] Retrieve newly added prefetch requests;

[0017] If it is determined that the newly added prefetch request was not found in the prefetch request queue, then the newly added prefetch request is added to the prefetch request queue.

[0018] Furthermore, adding the newly added prefetch request to the prefetch request queue includes:

[0019] If it is determined that the first address of the newly added prefetch request matches the first address of a group queue already in use by the prefetch request queue, then the newly added prefetch request is assigned to the group queue with the matching first address; or

[0020] If it is determined that the first address of the newly added prefetch request does not match the first address of any of the group queues already used by the prefetch request queue, then a new group queue is created based on the first address of the newly added prefetch request, and the newly added prefetch request is assigned to the new group queue and the time tag of the newly added prefetch request is configured.

[0021] The prefetch request queue includes multiple group queues, each group queue having a corresponding first address; the prefetch request address for each prefetch request includes the first address.

[0022] Furthermore, the step of determining that the newly added prefetch request has not been hit in the prefetch request queue includes:

[0023] If it is determined that the first address of the newly added prefetch request does not match the first address corresponding to the already used block queue in the prefetch request queue, then it is determined that the newly added prefetch request has not been hit in the prefetch request queue; or

[0024] If it is determined that the first address of the newly added prefetch request matches the first address of a used block queue in the prefetch request queue, and the second address of the newly added prefetch request is different from the second addresses of all prefetch requests in the corresponding block queue, then it is determined that the newly added prefetch request was not hit in the prefetch request queue.

[0025] The prefetch request queue includes multiple group queues, each group queue having a corresponding first address; the prefetch request address for each prefetch request is divided into a first address and a second address.

[0026] Furthermore, the method for releasing a prefetch request provided in this embodiment of the invention further includes:

[0027] Retrieve newly added prefetch requests;

[0028] If it is determined that the newly added prefetch request has been matched in the prefetch request queue, then the newly added prefetch request is cancelled.

[0029] Furthermore, the step of determining whether the newly added prefetch request has been matched in the prefetch request queue includes:

[0030] If it is determined that the first address of the newly added prefetch request matches the first address of a used block queue in the prefetch request queue, and the second address of the newly added prefetch request is the same as the second address of a prefetch request in the corresponding block queue, then it is determined that the newly added prefetch request has been hit in the prefetch request queue; wherein, the prefetch request queue includes at least one block queue, each block queue has a corresponding first address; the prefetch request address of each prefetch request is divided into a first address and a second address.

[0031] In a second aspect, the present invention provides a prefetch request release device, comprising:

[0032] The first acquisition module is used to acquire the earliest prefetch request from the prefetch request queue as a prefetch request to be processed;

[0033] The release module is used to release the prefetch request to be processed and related prefetch requests from the prefetch request queue after determining that the prefetch request to be processed has been hit in the virtual-physical address translation cache and in the target cache, or that the prefetch request to be processed has been hit in the virtual-physical address translation cache and in the address missing status tracking register.

[0034] Furthermore, the release module includes:

[0035] The determining unit is configured to determine the group queue to which the prefetch request to be processed belongs based on the group number of the prefetch request to be processed; wherein, the prefetch request queue includes multiple group queues, and each group queue has a corresponding group number;

[0036] The first acquisition unit is used to acquire, based on the time tag of the prefetch request to be processed and the time tags of other prefetch requests in the group queue to which the prefetch request to be processed belongs, the prefetch request corresponding to a first preset number of time tags that are later than the time tag of the prefetch request to be processed and closest to it, as the prefetch request related to the prefetch request to be processed.

[0037] The first release unit is used to release the pending prefetch request and related prefetch requests.

[0038] Furthermore, the release module includes:

[0039] The second acquisition unit is used to acquire, based on the time tag of the prefetch request to be processed and the time tags of other prefetch requests in the prefetch request queue, the prefetch request corresponding to a second preset number of time tags that are later than the time tag of the prefetch request to be processed and closest to it, as the prefetch request related to the prefetch request to be processed.

[0040] The second release unit is used to release the pending prefetch request and related prefetch requests.

[0041] Thirdly, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the program to implement the prefetch request release method described in any of the above embodiments.

[0042] Fourthly, the present invention provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the prefetch request release method described in any of the above embodiments.

[0043] Fifthly, the present invention provides a computer program product, including a computer program / instruction that, when executed by a processor, implements the prefetch request release method described in any of the above embodiments.

[0044] The prefetch request release method and apparatus provided in this embodiment of the invention obtain the earliest prefetch request from the prefetch request queue as a prefetch request to be processed; if it is determined that the prefetch request to be processed hits in the virtual-physical address translation cache and in the target cache, or the prefetch request to be processed hits in the virtual-physical address translation cache and in the address missing status tracking register, then the prefetch request to be processed and related prefetch requests are released from the prefetch request queue, thereby reducing the additional power consumption of data prefetching. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0046] Figure 1 This is a schematic diagram of the hardware data prefetching process provided in the first embodiment of the present invention.

[0047] Figure 2 This is a flowchart illustrating the prefetch request release method provided in the second embodiment of the present invention.

[0048] Figure 3 This is a flowchart illustrating the method for releasing a prefetch request provided in the third embodiment of the present invention.

[0049] Figure 4 This is a flowchart illustrating the prefetch request release method provided in the fourth embodiment of the present invention.

[0050] Figure 5This is a flowchart illustrating the prefetch request release method provided in the fifth embodiment of the present invention.

[0051] Figure 6 This is a flowchart illustrating the method for releasing a prefetch request provided in the sixth embodiment of the present invention.

[0052] Figure 7 This is a schematic diagram of the prefetch request release device provided in the seventh embodiment of the present invention.

[0053] Figure 8 This is a schematic diagram of the prefetch request release device provided in the eighth embodiment of the present invention.

[0054] Figure 9 This is a schematic diagram of the prefetch request release device provided in the ninth embodiment of the present invention.

[0055] Figure 10 This is a schematic diagram of the prefetch request release device provided in the tenth embodiment of the present invention.

[0056] Figure 11 This is a schematic diagram of the structure of the prefetch request release device provided in the eleventh embodiment of the present invention.

[0057] Figure 12 This is a schematic diagram of the physical structure of a computer device provided in the twelfth embodiment of the present invention. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments and descriptions of the present invention are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. The acquisition, storage, use, and processing of data in the technical solutions of this application all comply with the relevant provisions of laws and regulations. The user information in the embodiments of this application is obtained through legal and compliant means, and the acquisition, storage, use, and processing of user information have been agreed upon by the customer.

[0059] To facilitate understanding of the technical solution provided in this application, the relevant content of the technical solution in this application will be explained below.

[0060] Cache memory (cache): A small-capacity, high-speed memory located between the Central Processing Unit (CPU) and main memory. Its main function is to compensate for the speed difference between the CPU and main memory, thereby improving overall system performance. Cache can have multiple levels, such as Level 1 cache (L1), Level 2 cache (L2), and Level 3 cache (L3).

[0061] Hardware data prefetching: The hardware predicts the data addresses that will be used in the future based on the historical information of memory access. Before the data is needed, it initiates a data prefetching request in advance to move the data from memory or a lower-level cache (such as L3) to a higher-level cache (such as L2).

[0062] A prefetch request queue (PRQ) is a first-in, first-out (FIFO) queue in a computer system used to manage prefetch requests, optimizing data access efficiency and reducing latency. Its core function is to cache prefetch operations in chronological order, ensuring the system loads the expected data in advance and improving overall performance.

[0063] Cache line (CL): The smallest unit of data transfer between cache and main memory in a computer's storage system. By utilizing the principle of spatial locality (when a certain address is accessed, its neighboring addresses are likely to be accessed later), a contiguous block of memory is loaded into the cache at once to reduce the communication overhead between the CPU and main memory.

[0064] Address Miss Status Tracker: Used to record each incomplete cache miss event. The information recorded usually includes the address, thread identifier, etc.

[0065] The Translation Look-aside Buffer (TLB) has a fixed number of slots used to store tag table entries that map virtual addresses to physical addresses. Its search keyword is the virtual memory address, and its search result is the physical address. If the requested virtual address exists in the TLB, the Content-Addressable Memory (CAM) will provide a very fast match, after which the obtained physical address can be used to access the cache.

[0066] The prefetch engine is a core component in a computer system responsible for predicting data access patterns and proactively initiating prefetch requests. Its goal is to improve overall system performance by preloading anticipated data into the cache or memory, thereby reducing the wait time for the CPU or applications on slow storage devices. The prefetch engine typically works in conjunction with caching systems (such as L1 / L2 / L3 caches), storage controllers, and PRQ (Prefetch Request).

[0067] Figure 1 This is a schematic diagram of the hardware data prefetching process provided in the first embodiment of the present invention, as shown below. Figure 1 As shown, prefetch requests triggered by each prefetch engine are added to the prefetch request queue, with prefetch requests measured in CLs. Before being added to the prefetch request queue, a check is performed to see if the same prefetch request already exists in the queue. If the same prefetch request already exists, the prefetch request will not be added to the queue. If the same prefetch request does not exist, the prefetch request will be added to the queue.

[0068] Prefetch requests in the prefetch request queue are processed according to the first-in, first-out (FIFO) principle. A prefetch request is retrieved from the queue, its address is resolved, translated into a physical address via the TLB, and then sent to the cache. If a prefetch request is not found in the current cache, the missed prefetch request is added to the address miss status tracker, and the relevant data is retrieved from the next level cache or from memory.

[0069] Although prefetch requests are filtered before entering the prefetch request queue, processor performance analysis revealed that some prefetch requests would hit the data cache repeatedly, with nearly 50% of prefetch requests hitting the data cache repeatedly, thus wasting power.

[0070] To address the aforementioned issues, this application proposes a prefetch request release method based on existing hardware architecture. When a prefetch request hits the data cache or is already waiting for downstream backfilling, the prefetch request is released, and earlier prefetch requests are also released simultaneously. This improves the utilization of the prefetch request queue and reduces the additional power consumption caused by repeatedly prefetching and looking up the data cache.

[0071] Figure 2 This is a flowchart illustrating the prefetch request release method provided in the second embodiment of the present invention, as shown below. Figure 2 As shown, the prefetch request release method provided in this embodiment of the invention includes:

[0072] S201. Obtain the earliest prefetch request from the prefetch request queue as the prefetch request to be processed;

[0073] Specifically, prefetch requests in the prefetch request queue follow a first-in, first-out (FIFO) principle, with the earliest prefetch request retrieved from the queue as the pending prefetch request. Since the cache can have multiple levels, each level can be configured with a prefetch request queue, and the target cache can be any level of cache.

[0074] S202. If it is determined that the prefetch request to be processed is hit in the virtual-physical address translation cache and hit in the target cache, or the prefetch request to be processed is hit in the virtual-physical address translation cache and hit in the address missing status tracking register, then the prefetch request to be processed and the related prefetch requests are released from the prefetch request queue.

[0075] Specifically, after obtaining the prefetch request to be processed, the system checks the TLB to see if a prefetch request identical to the one already exists. If it does, the prefetch request is considered to have a TLB hit. The system also checks the target cache and the address miss status tracker to see if a prefetch request identical to the one already exists. If a prefetch request identical to the one already exists in the target cache, the prefetch request is considered to have a hit in the target cache. If a prefetch request identical to the one already exists in the address miss status tracker, the prefetch request is considered to have a hit in the address miss status tracker. If the prefetch request hits both the virtual / physical address translation cache and the target cache, the prefetch request and its associated prefetch requests are released.

[0076] If a prefetch request to be processed is hit in the TLB, it means that the virtual address to physical address mapping of the prefetch request has been cached in the TLB, and the physical address of the same prefetch request has been accessed. The prefetch request can then be released from the prefetch request queue. Due to the spatial and temporal locality of data access, if a target cache hit or an address miss status tracer hits, it means that the CL adjacent to the physical address of the prefetch request has a high probability of being accessed. While releasing the prefetch request, prefetch requests related to the prefetch request can also be released simultaneously, i.e., a preset number of prefetch requests adjacent to the prefetch request in the prefetch request queue. This helps improve the turnover rate of the prefetch request queue, reduces the probability of invalid data prefetching, improves the accuracy of data prefetching, and reduces the additional power consumption caused by repeatedly searching the target cache and address miss status tracer. The preset number is set according to actual needs and is not limited in this embodiment of the invention.

[0077] The prefetch request release method provided in this embodiment of the invention obtains the earliest prefetch request from the prefetch request queue as a prefetch request to be processed; if it is determined that the prefetch request to be processed hits in the virtual-physical address translation cache and in the target cache, or the prefetch request to be processed hits in the virtual-physical address translation cache and in the address missing status tracking register, then the prefetch request to be processed and related prefetch requests are released from the prefetch request queue, thereby reducing the additional power consumption of data prefetching.

[0078] Figure 3 This is a flowchart illustrating the prefetch request release method provided in the third embodiment of the present invention, as shown below. Figure 3 As shown, based on the above embodiments, further, releasing the pending prefetch requests and related prefetch requests from the prefetch request queue includes:

[0079] S301. Determine the group queue to which the prefetch request to be processed belongs based on the group number of the prefetch request to be processed; wherein, the prefetch request queue includes at least one group queue, and each group queue has a corresponding group number;

[0080] Specifically, based on the GroupID of the prefetch request to be processed, a matching groupID is searched among the group IDs of the group queues included in the prefetch request queue to determine the group queue to which the prefetch request belongs. The prefetch request queue includes multiple group queues, each with a corresponding group ID. The group ID for each group queue is pre-assigned; a group ID is assigned to each group queue when it is established, and the group IDs for each group queue are unique.

[0081] For example, the group number of the first group queue in the prefetch request queue is 0, and the group number is incremented by 1 for each additional group queue. Each group queue has a corresponding first address, and the number of prefetch requests that can be stored in each group queue is preset and set according to actual needs; this embodiment of the invention does not limit this setting.

[0082] S302. Based on the time tag of the prefetch request to be processed and the time tags of other prefetch requests in the group queue to which the prefetch request to be processed belongs, obtain the prefetch request corresponding to the first preset number of time tags that are later than the time tag of the prefetch request to be processed and are closest to the time tag of the prefetch request to be processed, and use it as the prefetch request related to the prefetch request to be processed.

[0083] Specifically, the timestamp of the prefetch request to be processed is compared one by one with the timestamps of other prefetch requests in the group queue to which the prefetch request to be processed belongs. The prefetch request corresponding to the first preset number of timestamps that are later than the timestamp of the prefetch request to be processed is then selected as the prefetch request related to the prefetch request to be processed. The timestamp of the prefetch request is assigned to the prefetch request when it is added to the prefetch request queue; the time when the prefetch request is added to the prefetch request queue can be used as the timestamp of the prefetch request. The first preset number is set according to actual conditions and is not limited in this embodiment of the invention.

[0084] Understandably, since the prefetch request queue follows the first-in-first-out principle, adjacent prefetch requests have consecutive prefetch request addresses, and when a prefetch request is added to the prefetch request queue, a timestamp is assigned. Therefore, adjacent prefetch requests can be determined by comparing the timestamps.

[0085] S303. Release the pending prefetch request and related prefetch requests.

[0086] Specifically, the prefetch request to be processed and its related prefetch requests are released from the group queue to which the prefetch request to be processed belongs, thereby increasing the speed at which prefetch requests are processed and released in the prefetch request queue per unit time and improving queue turnover rate. Furthermore, by searching the group queue to which the prefetch request to be processed belongs using its group number, the related prefetch requests are identified within that group queue, narrowing the search range and improving data processing efficiency.

[0087] Figure 4 This is a flowchart illustrating the prefetch request release method provided in the fourth embodiment of the present invention, as shown below. Figure 4 As shown, based on the above embodiments, further, releasing the pending prefetch requests and related prefetch requests from the prefetch request queue includes:

[0088] S401. Based on the time tag of the prefetch request to be processed and the time tags of other prefetch requests in the prefetch request queue, obtain the prefetch request corresponding to the second preset number of time tags that are later than the time tag of the prefetch request to be processed and are closest to the time tag of the prefetch request to be processed, and use it as the prefetch request related to the prefetch request to be processed.

[0089] Specifically, the timestamp of the prefetch request to be processed is compared one by one with the timestamps of other prefetch requests in the group queue to which the prefetch request to be processed belongs. The prefetch request corresponding to the second preset number of timestamps that are later than the timestamp of the prefetch request to be processed is then selected as the prefetch request related to the prefetch request to be processed. The timestamp of the prefetch request is assigned to the prefetch request when it is added to the prefetch request queue; the time when the prefetch request is added to the queue can be used as the timestamp. The second preset number is set according to actual conditions and is not limited in this embodiment of the invention.

[0090] S402, Release the pending prefetch request and related prefetch requests.

[0091] Specifically, the pending prefetch requests and related prefetch requests are released from the pending prefetch request queue, thereby increasing the speed at which prefetch requests in the prefetch request queue are processed and released per unit time, and improving the queue turnover rate.

[0092] Figure 5 This is a flowchart illustrating the prefetch request release method provided in the fifth embodiment of the present invention, as shown below. Figure 5 As shown, based on the above embodiments, the prefetch request release method provided by the embodiments of the present invention further includes:

[0093] S501, Obtain the newly added prefetch request;

[0094] Specifically, the prefetch requests generated by the prefetch engine will be treated as new prefetch requests. Before a new prefetch request enters the prefetch request queue, it needs to be checked whether there is a duplicate prefetch request in the prefetch request queue in order to avoid duplicate prefetch requests in the prefetch request queue.

[0095] S502. If it is determined that the newly added prefetch request was not found in the prefetch request queue, then the newly added prefetch request is added to the prefetch request queue.

[0096] Specifically, the prefetch request address of the newly added prefetch request is compared with the prefetch request addresses of existing prefetch requests in the prefetch request queue. If the prefetch request address of the newly added prefetch request is different from the prefetch request addresses of all prefetch requests in the prefetch request queue, it means that there are no duplicate prefetch requests in the prefetch request queue, and the newly added prefetch request can be added to the prefetch request queue. If the prefetch request address of the newly added prefetch request is the same as the prefetch request address of a prefetch request in the prefetch request queue, it means that there are duplicate prefetch requests in the prefetch request queue, and the newly added prefetch request will be cancelled.

[0097] Based on the above embodiments, further, adding the newly added prefetch request to the prefetch request queue includes:

[0098] If it is determined that the first address of the newly added prefetch request matches the first address of a group queue already in use by the prefetch request queue, then the newly added prefetch request is assigned to the group queue with the matching first address; or

[0099] If it is determined that the first address of the newly added prefetch request does not match the first address of any of the group queues already used by the prefetch request queue, then a new group queue is created based on the first address of the newly added prefetch request, and the newly added prefetch request is assigned to the new group queue and the time tag of the newly added prefetch request is configured.

[0100] The prefetch request queue includes multiple group queues, each group queue having a corresponding first address; the prefetch request address for each prefetch request includes the first address.

[0101] Specifically, the prefetch request address is divided into a first address and a second address. The first address is the high-order address of the prefetch request address, and the second address is the low-order address. The division of the first and second addresses is set according to actual needs, and this embodiment of the invention does not impose a limitation. The prefetch request queue includes multiple group queues, each group queue having a corresponding first address. The first address corresponding to a group queue includes at least one first address. The number of prefetch requests that each group queue can store is set according to actual needs, and this embodiment of the invention does not impose a limitation. The multiple group queues included in the prefetch request queue are activated one by one.

[0102] The system determines whether the first address of the newly added prefetch request matches the first address corresponding to a used group queue in the prefetch request queue. If the first address of the newly added prefetch request matches the first address corresponding to a used group queue, then the newly added prefetch request is assigned to the group queue that matches the first address of the newly added prefetch request. The first address corresponding to the group queue includes the first address of the newly added prefetch request; therefore, the first address of the newly added prefetch request matches the first address corresponding to the group queue. Here, a used group queue refers to a group queue that has already stored prefetch requests. Group queues that have not stored prefetch requests can be considered unused group queues.

[0103] If the first address of the newly added prefetch request does not match the first address of any of the already used group queues in the prefetch request queue, a new group queue will be created based on the first address of the newly added prefetch request. The first address of the new group queue will include the first address of the newly added prefetch request. When creating the new group queue, a unique group number will be created for the new group queue. The newly added prefetch request will be added to the new group queue, and a timestamp will be configured for the new prefetch request. The time when the new prefetch request is added to the new group queue can be used as the timestamp of the new prefetch request.

[0104] In this invention, the group numbers of the group queues are reusable. The group number accumulates from an initial value to a maximum value, and then restarts from the initial value. The initial and maximum values ​​of the group numbers are set according to actual needs, and this embodiment does not impose any limitations. For example, the initial value of the group number can be set to 0. Each time a group queue is created, the group number is incremented by 1 until the maximum value is reached, and then it starts from 0 again. When there are no more prefetch requests in a group queue, the group number of that group queue can be reclaimed. In this embodiment, the reclamation of group numbers does not require a special step. The number of group numbers can be set to be greater than the total number of group queues included in the prefetch request queue. A currently available group number is maintained. When a group queue is created and a group number is assigned to it, the currently available group number is incremented by 1 until the maximum value is reached, and then the group number starts to be used again from the initial value. This ensures that there are enough group numbers available, and the reclamation of group numbers does not require a special step.

[0105] Based on the above embodiments, further, the step of determining that the newly added prefetch request has not been hit in the prefetch request queue includes:

[0106] If it is determined that the first address of the newly added prefetch request does not match the first address corresponding to the already used block queue in the prefetch request queue, then it is determined that the newly added prefetch request has not been hit in the prefetch request queue; or

[0107] If it is determined that the first address of the newly added prefetch request matches the first address of a used block queue in the prefetch request queue, and the second address of the newly added prefetch request is different from the second addresses of all prefetch requests in the corresponding block queue, then it is determined that the newly added prefetch request was not hit in the prefetch request queue.

[0108] The prefetch request queue includes multiple group queues, each group queue having a corresponding first address; the prefetch request address for each prefetch request is divided into a first address and a second address.

[0109] Specifically, it is determined whether the first address of the newly added prefetch request matches the first address corresponding to the already used group queue in the prefetch request queue. If the first address of the newly added prefetch request does not match the first address corresponding to the already used group queue in the prefetch request queue, it indicates that there is no prefetch request identical to the newly added prefetch request in the prefetch request queue, and it can be determined that the newly added prefetch request has not been hit in the prefetch request queue. Determining whether the newly added prefetch request has been hit by comparing the first address of the newly added prefetch request with the first address corresponding to the already used group queue in the prefetch request queue avoids comparing the newly added prefetch request with all prefetch requests in the prefetch request queue, reducing the amount of data that needs to be compared and improving data processing efficiency.

[0110] If the first address of the newly added prefetch request matches the first address corresponding to a used group queue in the prefetch request queue, then the second address of the newly added prefetch request is compared with the second addresses of all prefetch requests in the used group queue. If the second address of the newly added prefetch request is different from the second addresses of all prefetch requests in the used group queue, then it can be determined that the newly added prefetch request has not been hit in the prefetch request queue. The corresponding group queue for the newly added prefetch request refers to the group queue that matches the first address of the newly added prefetch request. When the first address of the newly added prefetch request matches the first address corresponding to a used group queue in the prefetch request queue, by comparing the second address of the newly added prefetch request with the second addresses of all prefetch requests in the used group queue, it is determined whether the newly added prefetch request has been hit, reducing the number of prefetch request comparisons and improving data processing efficiency.

[0111] Figure 6 This is a flowchart illustrating the prefetch request release method provided in the sixth embodiment of the present invention, as shown below. Figure 6 As shown, based on the above embodiments, the prefetch request release method provided by the embodiments of the present invention further includes:

[0112] S601, Obtain the newly added prefetch request;

[0113] Specifically, the prefetch requests generated by the prefetch engine will be treated as new prefetch requests. Before a new prefetch request enters the prefetch request queue, it needs to be checked whether there is a duplicate prefetch request in the prefetch request queue in order to avoid duplicate prefetch requests in the prefetch request queue.

[0114] S602. If it is determined that the newly added prefetch request has been matched in the prefetch request queue, then the newly added prefetch request is cancelled.

[0115] Specifically, the prefetch request address of the newly added prefetch request is compared with the prefetch request address of the prefetch request already used in the prefetch request queue. If the prefetch request address of the newly added prefetch request is the same as the prefetch request address of a prefetch request in the prefetch request queue, then the newly added prefetch request will be cancelled.

[0116] Based on the above embodiments, the step of determining whether the newly added prefetch request has been matched in the prefetch request queue includes:

[0117] If it is determined that the first address of the newly added prefetch request matches the first address of a used block queue in the prefetch request queue, and the second address of the newly added prefetch request is the same as the second address of a prefetch request in the corresponding block queue, then it is determined that the newly added prefetch request has been hit in the prefetch request queue; wherein, the prefetch request queue includes multiple block queues, each block queue having a corresponding first address; the prefetch request address of each prefetch request is divided into a first address and a second address.

[0118] Specifically, it is determined whether the first address of the newly added prefetch request matches the first address corresponding to a used group queue in the prefetch request queue. If the first address of the newly added prefetch request matches the first address corresponding to a used group queue in the prefetch request queue, then the second address of the newly added prefetch request is compared with the second addresses of each prefetch request in the used group queue. If the second address of the newly added prefetch request is the same as the second address of a prefetch request in the used group queue, then it is determined that the newly added prefetch request has been hit in the prefetch request queue.

[0119] By first determining whether the first address of the newly added prefetch request matches the first address corresponding to the already used block queue, and then comparing whether the second address of the newly added prefetch request is the same as the second address of each prefetch request in the matched already used block queue, the number of comparisons for prefetch requests is reduced, thus improving data processing efficiency.

[0120] Figure 7 This is a schematic diagram of the structure of the prefetch request release device provided in the seventh embodiment of the present invention, as shown below. Figure 7 As shown, the prefetch request release device provided in this embodiment of the invention includes a first acquisition module 701 and a release module 702, wherein:

[0121] The first acquisition module 701 is used to acquire the earliest prefetch request from the prefetch request queue as a prefetch request to be processed; the release module 702 is used to release the prefetch request to be processed and related prefetch requests from the prefetch request queue after determining that the prefetch request to be processed has been hit in the virtual-physical address translation cache and hit in the target cache, or the prefetch request to be processed has been hit in the virtual-physical address translation cache and hit in the address missing status tracking register.

[0122] Specifically, the prefetch requests in the prefetch request queue follow a first-in, first-out (FIFO) principle. The first fetching module 701 retrieves the earliest prefetch request from the prefetch request queue as the prefetch request to be processed. Since the cache can have multiple levels, each level of the cache can be configured with a prefetch request queue, and the target cache can be a cache from any level.

[0123] After obtaining the prefetch request to be processed, the system checks the TLB to see if a prefetch request identical to the one already exists. If it does, the prefetch request is considered to have a TLB hit. The system also checks the target cache and the address miss status tracker to see if a prefetch request identical to the one already exists. If a prefetch request identical to the one already exists in the target cache, the prefetch request is considered to have a hit in the target cache. If a prefetch request identical to the one already exists in the address miss status tracker, the prefetch request is considered to have a hit in the address miss status tracker. If the prefetch request is hit in both the virtual-physical address translation cache and the target cache, the release module 702 will release the prefetch request and any associated prefetch requests.

[0124] The prefetch request release device provided in this embodiment of the invention obtains the earliest prefetch request from the prefetch request queue as a prefetch request to be processed; if it is determined that the prefetch request to be processed has a hit in the virtual-physical address translation cache and a hit in the target cache, or the prefetch request to be processed has a hit in the virtual-physical address translation cache and a hit in the address missing status tracking register, then the prefetch request to be processed and related prefetch requests are released from the prefetch request queue, thereby reducing the additional power consumption of data prefetching.

[0125] Figure 8 This is a schematic diagram of the structure of the prefetch request release device provided in the eighth embodiment of the present invention, as shown below. Figure 8As shown, based on the above embodiments, the release module 702 further includes a determining unit 7021, a first acquiring unit 7022, and a first release unit 7023, wherein:

[0126] The determining unit 7021 is used to determine the group queue to which the prefetch request to be processed belongs based on the group number of the prefetch request to be processed; wherein, the prefetch request queue includes multiple group queues, and each group queue has a corresponding group number; the first obtaining unit 7022 is used to obtain, based on the time tag of the prefetch request to be processed and the time tags of other prefetch requests in the group queue to which the prefetch request to be processed belongs, the prefetch requests corresponding to a first preset number of time tags that are later than the time tag of the prefetch request to be processed and closest to the time tag of the prefetch request to be processed, as the prefetch requests related to the prefetch request to be processed; the first releasing unit 7023 is used to release the prefetch request to be processed and the related prefetch requests.

[0127] Figure 9 This is a schematic diagram of the structure of the prefetch request release device provided in the ninth embodiment of the present invention, as shown below. Figure 9 As shown, based on the above embodiments, the release module 702 further includes a second acquisition unit 7024 and a second release unit 7025, wherein:

[0128] The second acquisition unit 7024 is used to acquire, based on the time tag of the prefetch request to be processed and the time tags of other prefetch requests in the prefetch request queue, a prefetch request corresponding to a second preset number of time tags that are later than the time tag of the prefetch request to be processed and closest to the time tag of the prefetch request to be processed, as a prefetch request related to the prefetch request to be processed; the second release unit 7025 is used to release the prefetch request to be processed and the related prefetch requests.

[0129] Figure 10 This is a schematic diagram of the structure of the prefetch request release device provided in the tenth embodiment of the present invention, as shown below. Figure 10 As shown, based on the above embodiments, the prefetch request release device provided in this embodiment further includes a second acquisition module 703 and a first judgment module 704, wherein:

[0130] The second acquisition module 703 is used to acquire newly added prefetch requests; the first judgment module 704 is used to add the newly added prefetch request to the prefetch request queue after determining that the newly added prefetch request has not been hit in the prefetch request queue.

[0131] Based on the above embodiments, the first determination module 704 is further specifically used for:

[0132] If it is determined that the first address of the newly added prefetch request matches the first address of a group queue already in use by the prefetch request queue, then the newly added prefetch request is assigned to the group queue with the matching first address; or

[0133] If it is determined that the first address of the newly added prefetch request does not match the first address of any of the group queues already used by the prefetch request queue, then a new group queue is created based on the first address of the newly added prefetch request, and the newly added prefetch request is assigned to the new group queue and the time tag of the newly added prefetch request is configured.

[0134] The prefetch request queue includes multiple group queues, each group queue having a corresponding first address; the prefetch request address for each prefetch request includes the first address.

[0135] Based on the above embodiments, the first determination module 704 is further specifically used for:

[0136] If it is determined that the first address of the newly added prefetch request does not match the first address corresponding to the already used block queue in the prefetch request queue, then it is determined that the newly added prefetch request has not been hit in the prefetch request queue; or

[0137] If it is determined that the first address of the newly added prefetch request matches the first address of a used block queue in the prefetch request queue, and the second address of the newly added prefetch request is different from the second addresses of all prefetch requests in the corresponding block queue, then it is determined that the newly added prefetch request was not hit in the prefetch request queue.

[0138] The prefetch request queue includes multiple group queues, each group queue having a corresponding first address; the prefetch request address for each prefetch request is divided into a first address and a second address.

[0139] Figure 11 This is a schematic diagram of the structure of the prefetch request release device provided in the eleventh embodiment of the present invention, as shown below. Figure 11 As shown, based on the above embodiments, the prefetch request release device provided in this embodiment further includes a third acquisition module 705 and a second judgment module 706, wherein:

[0140] The third acquisition module 705 is used to acquire newly added prefetch requests; the second judgment module 706 is used to cancel the newly added prefetch request after determining that the newly added prefetch request has been matched in the prefetch request queue.

[0141] Based on the above embodiments, the second determination module 706 is further specifically used for:

[0142] After determining that the first address of the newly added prefetch request matches the first address of a used block queue in the prefetch request queue, and that the second address of the newly added prefetch request is the same as the second address of a prefetch request in the corresponding block queue, it is determined that the newly added prefetch request has been hit in the prefetch request queue; wherein, the prefetch request queue includes at least one block queue, each block queue having a corresponding first address; the prefetch request address of each prefetch request is divided into a first address and a second address.

[0143] The server embodiments provided in this invention can be used to execute the processing flow of the above method embodiments. Its functions will not be repeated here, but can be referred to the detailed description of the above method embodiments.

[0144] Figure 12 This is a schematic diagram of the physical structure of the computer device provided in the twelfth embodiment of the present invention, as shown below. Figure 12 As shown, the computer device may include a processor 1201, a communications interface 1202, a memory 1203, and a communication bus 1204. The processor 1201, communications interface 1202, and memory 1203 communicate with each other via the communication bus 1204. The processor 1201 can invoke logical instructions in the memory 1203 to execute the following method: retrieve the earliest prefetch request from the prefetch request queue as a prefetch request to be processed; if it is determined that the prefetch request to be processed has a hit in the virtual-physical address translation cache and a hit in the target cache, or the prefetch request to be processed has a hit in the virtual-physical address translation cache and a hit in the address miss status tracker, then release the prefetch request to be processed and related prefetch requests from the prefetch request queue.

[0145] Furthermore, the logical instructions in the aforementioned memory 1203 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0146] This embodiment discloses a computer program product, which includes a computer program / instructions stored on a computer-readable storage medium. When the computer program / instructions are executed by a computer, the computer can execute the methods provided in the above-described method embodiments, including, for example, obtaining the earliest prefetch request from the prefetch request queue as a prefetch request to be processed; if it is determined that the prefetch request to be processed has a hit in the virtual-physical address translation cache and a hit in the target cache, or the prefetch request to be processed has a hit in the virtual-physical address translation cache and a hit in the address miss status tracking register, then releasing the prefetch request to be processed and the related prefetch requests from the prefetch request queue.

[0147] This embodiment provides a computer-readable storage medium that stores a computer program / instruction. When the computer program / instruction is executed by a processor, it causes the computer to perform the methods provided in the above-described method embodiments, such as: obtaining the earliest prefetch request from the prefetch request queue as a prefetch request to be processed; if it is determined that the prefetch request to be processed has a hit in the virtual-physical address translation cache and a hit in the target cache, or the prefetch request to be processed has a hit in the virtual-physical address translation cache and a hit in the address miss status tracking register, then releasing the prefetch request to be processed and related prefetch requests from the prefetch request queue.

[0148] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0149] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0150] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0151] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0152] In the description of this specification, the references to terms such as "an embodiment," "a specific embodiment," "some embodiments," "for example," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0153] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for releasing a prefetch request, characterized in that, include: The earliest prefetch request is retrieved from the prefetch request queue as the prefetch request to be processed; If it is determined that the pending prefetch request is hit in both the virtual-to-physical address translation cache and the target cache, or that the pending prefetch request is hit in both the virtual-to-physical address translation cache and the address missing status tracking register, then the pending prefetch request and related prefetch requests are released from the prefetch request queue.

2. The method according to claim 1, characterized in that, Releasing the pending prefetch request and related prefetch requests from the prefetch request queue includes: Based on the group number of the prefetch request to be processed, the group queue to which the prefetch request to be processed belongs is determined; wherein, the prefetch request queue includes multiple group queues, and each group queue has a corresponding group number; Based on the timestamp of the prefetch request to be processed and the timestamps of other prefetch requests in the group queue to which the prefetch request to be processed belongs, obtain the prefetch request corresponding to a first preset number of timestamps that are later than the timestamp of the prefetch request to be processed and closest to the timestamp of the prefetch request to be processed, and use it as the prefetch request related to the prefetch request to be processed. Release the pending prefetch request and related prefetch requests.

3. The method according to claim 1, characterized in that, Releasing the pending prefetch request and related prefetch requests from the prefetch request queue includes: Based on the time tag of the prefetch request to be processed and the time tags of other prefetch requests in the prefetch request queue, obtain the prefetch request corresponding to the second preset number of time tags that are later than the time tag of the prefetch request to be processed and closest to the time tag of the prefetch request to be processed, and use it as the prefetch request related to the prefetch request to be processed. Release the pending prefetch request and related prefetch requests.

4. The method according to any one of claims 1 to 3, characterized in that, Also includes: Retrieve newly added prefetch requests; If it is determined that the newly added prefetch request was not found in the prefetch request queue, then the newly added prefetch request is added to the prefetch request queue.

5. The method according to claim 4, characterized in that, Adding the newly added prefetch request to the prefetch request queue includes: If it is determined that the first address of the newly added prefetch request matches the first address of a group queue already in use by the prefetch request queue, then the newly added prefetch request is assigned to the group queue with the matching first address; or If it is determined that the first address of the newly added prefetch request does not match the first address of any of the group queues already used by the prefetch request queue, then a new group queue is created based on the first address of the newly added prefetch request, the newly added prefetch request is assigned to the new group queue, and the time tag of the newly added prefetch request is configured. The prefetch request queue includes multiple group queues, each group queue having a corresponding first address; the prefetch request address for each prefetch request includes the first address.

6. The method according to claim 4, characterized in that, The determination that the newly added prefetch request was not found in the prefetch request queue includes: If it is determined that the first address of the newly added prefetch request does not match the first address corresponding to the already used block queue in the prefetch request queue, then it is determined that the newly added prefetch request has not been hit in the prefetch request queue; or If it is determined that the first address of the newly added prefetch request matches the first address of a used block queue in the prefetch request queue, and the second address of the newly added prefetch request is different from the second addresses of all prefetch requests in the corresponding block queue, then it is determined that the newly added prefetch request was not hit in the prefetch request queue. The prefetch request queue includes multiple group queues, each group queue having a corresponding first address; the prefetch request address for each prefetch request is divided into a first address and a second address.

7. The method according to any one of claims 1 to 3, characterized in that, Also includes: Retrieve newly added prefetch requests; If it is determined that the newly added prefetch request has been matched in the prefetch request queue, then the newly added prefetch request is cancelled.

8. The method according to claim 7, characterized in that, The determination that the newly added prefetch request has been matched in the prefetch request queue includes: If it is determined that the first address of the newly added prefetch request matches the first address of a used block queue in the prefetch request queue, and the second address of the newly added prefetch request is the same as the second address of a prefetch request in the corresponding block queue, then it is determined that the newly added prefetch request has been hit in the prefetch request queue; wherein, the prefetch request queue includes at least one block queue, each block queue has a corresponding first address; the prefetch request address of each prefetch request is divided into a first address and a second address.

9. A release device for a prefetch request, characterized in that, include: The first acquisition module is used to acquire the earliest prefetch request from the prefetch request queue as a prefetch request to be processed; The release module is used to release the prefetch request to be processed and related prefetch requests from the prefetch request queue after determining that the prefetch request to be processed has been hit in the virtual-physical address translation cache and in the target cache, or that the prefetch request to be processed has been hit in the virtual-physical address translation cache and in the address missing status tracking register.

10. The apparatus according to claim 9, characterized in that, The release module includes: The determining unit is configured to determine the group queue to which the prefetch request to be processed belongs based on the group number of the prefetch request to be processed; wherein, the prefetch request queue includes multiple group queues, and each group queue has a corresponding group number; The first acquisition unit is used to acquire, based on the time tag of the prefetch request to be processed and the time tags of other prefetch requests in the group queue to which the prefetch request to be processed belongs, a first preset number of time tags that are later than the time tag of the prefetch request to be processed and closest to the time tag of the prefetch request to be processed, as the prefetch request related to the prefetch request to be processed. The first release unit is used to release the pending prefetch request and related prefetch requests.

11. The apparatus according to claim 9, characterized in that, The release module includes: The second acquisition unit is used to acquire, based on the time tag of the prefetch request to be processed and the time tags of other prefetch requests in the prefetch request queue, a second preset number of time tags that are later than the time tag of the prefetch request to be processed and closest to the time tag of the prefetch request to be processed, as the prefetch request related to the prefetch request to be processed. The second release unit is used to release the pending prefetch request and related prefetch requests.

12. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the method according to any one of claims 1 to 8.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program / instructions that, when executed by a processor, implement the method described in any one of claims 1 to 8.

14. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method described in any one of claims 1 to 8.

Citation Information

Cited By

  • Data prefetching method and device and chip

    CN121560781A