Cache Miss Predictor
A cache miss predictor using a history table and adaptive resolution enhances cache searches by anticipating misses, optimizing memory access and reducing latency through efficient parallelism.
Patent Information
- Application Number
- JP2024517402
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-09-30
- Filing Date
- 2022-08-26
- Publication Date
- 2024-09-12
AI Technical Summary
The inefficiencies in accessing information from lower levels of the memory hierarchy due to increased access latency and the potential for unnecessary parallel searches, which can reduce memory bandwidth and affect system performance.
Implementing a cache miss predictor that utilizes a history table to anticipate cache misses, adjusting its resolution based on available memory bandwidth and feedback, and combining temporal and spatial prediction methods to optimize cache searches.
Reduces memory bandwidth penalties by minimizing unnecessary parallel searches, thereby improving system performance and reducing latency.
Smart Images

Figure 2024533611000001
Abstract
Description
[Technical field]
[0001] (CROSS REFERENCE TO RELATED APPLICATIONS) This application claims the benefit of U.S. Patent Application No. 17 / 490,739, filed September 30, 2021, the contents of which are incorporated by reference as if fully set forth herein. [Background technology]
[0002] A computer system includes memory devices that store information for use by a processing device. A computer system typically includes several types of memory with different functions, such as processor registers, cache memory, and main memory. The various types of memory are typically organized into a memory hierarchy based on access latency or other suitable metrics. The memory hierarchy may include processor registers, cache memory, and main memory. Other devices, such as hard disk drives and tape backup drives, are also included in the memory hierarchy in some implementations, but such devices are often referred to as storage devices rather than memory devices. Access latency refers to the time between a request for information from memory and the access being completed, either by returning an indication that the requested data or information is not stored in memory, for example.
[0003] Devices at the top of the memory hierarchy, such as processor registers, have the fastest access times and are most immediately accessible for access in the system (e.g., are powered up and / or organized for more immediately accessible), but typically have smaller storage capacities and / or are more expensive (e.g., in terms of power consumption and / or die area cost). Devices lower in the memory hierarchy have slower access times and / or are less immediately accessible, but typically have larger storage capacities and / or are less expensive. A processing unit typically only directly accesses devices at the top of the memory hierarchy (e.g., processor registers).
[0004] More frequently used information is stored at higher levels of the memory hierarchy and less frequently used information is stored at lower levels. If information required for a calculation by a processor is not present at the top of the memory hierarchy, the information is retrieved from the next lower level of the hierarchy and stored at the top of the memory hierarchy. For example, if information required for an operation is not present in a processor register, the information is fetched from a cache memory. If the information is not available at the next lower level of the hierarchy, the information is fetched from an even lower level (e.g., a lower level cache or system memory). The time used to determine whether information is available at a particular level of the memory hierarchy and to retrieve it from a lower level of the memory hierarchy contributes to access latency, which affects the performance of a computer system.
[0005] A more detailed understanding may be had from the following description, given by way of example in conjunction with the accompanying drawings, in which: [Brief description of the drawings]
[0006] [Figure 1] FIG. 1 is a block diagram of an example device capable of implementing one or more features of the present disclosure. [Diagram 2] 4 is a flowchart illustrating an example adjustment of history tracking resolution based on available memory bandwidth. [Diagram 3] 11 is a flow chart illustrating an example adjustment of historical tracking resolution based on feedback. [Figure 4] FIG. 1 is a block diagram illustrating an example of a memory system. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0007] In some embodiments, a method is provided for retrieving information based on a cache miss prediction. A prediction that a cache lookup for the information will miss the cache is made based on a history table. The cache lookup for the information is performed based on a request. A main memory fetch for the information is initiated before the cache lookup is completed based on the prediction that the cache lookup for the information will miss the cache.
[0008] In some embodiments, predicting that a cache lookup for the information will miss the cache based on the history table includes comparing a first set of bits stored in the history table to a second set of bits stored in the history table. In some embodiments, a resolution of the history table corresponds to a number of bits that track the history of cache misses. In some embodiments, the resolution of the history table is adjusted based on an amount of available memory bandwidth. In some embodiments, the resolution of the history table is adjusted in response to a cache lookup for the information hitting the cache. In some embodiments, the history table tracks a history of cache misses per core, per source type, or per thread.
[0009] In some embodiments, predicting that a cache lookup for the information will miss the cache based on the history table includes comparing at least a portion of an address of the request for information to a set of bits in the history table. In some embodiments, a resolution of the history table corresponds to a number of bits that comprise the set of bits in the history table. In some embodiments, the resolution of the history table is adjusted based on an amount of available memory bandwidth. In some embodiments, the resolution of the history table is adjusted in response to predicting that a request for the information will miss the cache and detecting a corresponding cache hit that does not match the prediction.
[0010] Some embodiments provide a processor configured to retrieve information based on a cache miss prediction. The processor includes circuitry configured to receive a request for the information. The processor also includes circuitry configured to predict that a cache lookup for the information will miss the cache based on a history table. The processor also includes circuitry configured to perform a cache lookup for the information based on the request. The processor also includes circuitry configured to initiate a main memory fetch for the information before the cache lookup is completed based on the prediction that the cache lookup for the information will miss the cache.
[0011] In some embodiments, the circuitry configured to predict that a cache lookup of the information will miss the cache based on the history table includes circuitry configured to compare a first set of bits stored in the history table with a second set of bits stored in the history table. In some embodiments, a resolution of the history table corresponds to a number of bits that track a history of cache misses. In some embodiments, the processor includes circuitry configured to adjust a resolution of the history table based on an amount of available memory bandwidth. In some embodiments, the processor includes circuitry configured to adjust a resolution of the history table in response to a cache lookup of the information hitting the cache. In some embodiments, the history table tracks a history of cache misses per core, per source type, or per thread.
[0012] In some embodiments, the circuitry configured to predict that a cache lookup of the information will miss the cache based on the history table includes circuitry configured to compare at least a portion of an address of a request for information with a set of bits in the history table. In some embodiments, a resolution of the history table corresponds to a number of bits that comprise the set of bits in the history table. In some embodiments, the processor includes circuitry configured to adjust the resolution of the history table based on available memory bandwidth. In some embodiments, the processor includes circuitry configured to predict that a request for information will miss the cache, and adjust the resolution of the history table in response to detecting a corresponding cache hit that does not match the prediction.
[0013] 1 is a block diagram of an example device 100 capable of implementing one or more features of the present disclosure. Device 100 may include a computer, a gaming device, a handheld device, a set-top box, a television, a mobile phone, a server, a tablet computer, or other type of computing device. Device 100 includes a processor 102, a memory 104, a storage device 106, one or more input devices 108, and one or more output devices 110. Device 100 may also include optional input drivers 112 and output drivers 114. It should be understood that device 100 may include additional components not shown in FIG. 1.
[0014] In various alternatives, the processor 102 includes a central processing unit (CPU), a graphics processing unit (GPU), a CPU and a GPU located on the same die, or one or more processor cores, each of which may be a CPU or a GPU. In various alternatives, the processor 102 includes registers and one or more levels of cache memory. In various alternatives, the processor 102 includes a memory controller and / or other circuitry configured to manage a memory hierarchy, the memory hierarchy including registers, cache memory, and the memory 104. In various alternatives, the memory 104 is located on the same die as the processor 102 or is located separately from the processor 102. The memory 104 includes volatile or non-volatile memory (e.g., random access memory (RAM), dynamic RAM, cache).
[0015] The storage devices 106 include fixed or removable storage devices (e.g., hard disk drives, solid state drives, optical disks, flash drives). In various alternatives, the storage devices 106 are also part of the memory hierarchy. The input devices 108 include, but are not limited to, a keyboard, a keypad, a touch screen, a touch pad, a detector, a microphone, an accelerometer, a gyroscope, a biometric scanner, or a network connection (e.g., a wireless local area network card for transmitting and / or receiving wireless IEEE 802 signals). The output devices 110 include, but are not limited to, a display, a speaker, a printer, a haptic feedback device, one or more optical, antennae, or network connections (e.g., a wireless local area network card for transmitting and / or receiving wireless IEEE 802 signals).
[0016] The input driver 112 communicates with the processor 102 and the input device 108, allowing the processor 102 to receive input from the input device 108. The output driver 114 communicates with the processor 102 and the output device 110, allowing the processor 102 to send output to the output device 110. It should be noted that the input driver 112 and the output driver 114 are optional components, and that the device 100 operates in the same manner when the input driver 112 and the output driver 114 are not present. The output driver 114 includes an accelerated processing device ("APD") 116 coupled to a display device 118. The APD accepts computational and graphics rendering commands from the processor 102, processes the computational and graphics rendering commands, and provides pixel output to the display device 118 for display. As described in more detail below, the APD 116 includes one or more parallel processing units that perform computations according to a single-instruction-multiple-data ("SIMD") paradigm. Thus, although various functions are described herein as being performed by or in conjunction with APD 116, in various alternatives, the functions described as being performed by APD 116 may additionally or alternatively be performed by other computing devices having similar capabilities that are not driven by a host processor (e.g., processor 102) to provide graphical output to display device 118. For example, it is contemplated that any processing system that performs processing tasks according to the SIMD paradigm may perform the functions described herein. Alternatively, it is contemplated that computing systems that do not perform processing tasks according to the SIMD paradigm may perform the functions described herein.
[0017] If a processor, memory controller, or other hardware requests information from a level of the memory hierarchy and the information is available at that level, the request may be referred to as a hit. If the information is not available at that level, the request may be referred to as a miss.
[0018] In an exemplary computing system, when a processor executes an instruction to load particular information into a processor register, the memory system determines whether the information is available at the top level or next level of the memory hierarchy, such as an L0 cache. In some embodiments, this determination is made by a memory controller or other suitable hardware. If the information is not available in the top level cache, the instruction may be said to have missed the top level cache. In this situation, the memory system will typically perform a lookup at the next lower level of the memory hierarchy (e.g., an L1 cache) to determine whether the information is available there. This lookup may also be a hit or a miss. Thus, the process may continue down the memory hierarchy until the information is found and ultimately loaded into a processor register.
[0019] As a memory system searches through the memory hierarchy for requested information, searches at each level typically become slower and slower due to increased access latency at lower levels of the memory hierarchy.
[0020] For example, in a memory hierarchy that includes four levels of cache (L0, L1, L2, L3 caches) above a main memory (e.g., DRAM) level, there may be significant differences in access latency between the different levels. In some embodiments, the differences in access latency may be due to a significantly larger size of the next lower level cache, a longer wireline distance to the main memory, and / or increased complexity in accessing the main memory, etc.
[0021] Because the access latency of the next lower level in the memory hierarchy can be large, in some cases it is advantageous to initiate a search of the next lower level before the current level returns a hit or miss. In one example, on an L2 cache miss, it is usually necessary to perform a relatively slow L3 cache lookup. Because an L3 cache lookup is slow and a main memory (DRAM in this example) lookup (e.g., a main memory fetch) is even slower, in some embodiments, a DRAM lookup is performed in parallel with the L3 cache lookup. In some embodiments, the parallel DRAM lookup is initiated simultaneously with the L3 cache lookup or is initiated before the end of the L3 cache lookup. If the L3 cache lookup misses, the parallel DRAM lookup returns its results sooner than if the memory system had waited for an L3 miss before initiating the DRAM lookup. The parallel DRAM lookup is ignored, terminated, and / or discarded, etc., if the L3 cache hits. This parallel search is conceptually possible between other levels of the memory hierarchy, such as performing both an L2 lookup and an L3 lookup in parallel in response to an L1 cache miss, or performing both a DRAM lookup and a hard disk lookup in parallel in response to an L3 cache miss, etc. Further parallelism is also conceptually possible, such as performing parallel L3, DRAM and hard disk lookups in response to an L2 cache miss.
[0022] In some embodiments, initiating parallel searches of two or more lower levels of the memory hierarchy comes at the expense of communication bandwidth. For example, main memory typically communicates with processors (and on-chip caches) via a memory bus. The memory bus is a shared electrical connection. In some embodiments, the memory bus transfers information between different modules of main memory and different processors via the same memory bus. Thus, a potentially unnecessary main memory fetch (e.g., a DRAM lookup) on an L2 cache miss may have the effect of reducing the amount of memory bus bandwidth available for communication by other processors, DRAM modules, etc. Similar bandwidth costs apply to other memory communications, such as between cache memory and processor registers, or on-chip interconnects between backing stores and multiple computer systems. Thus, in some embodiments, whether and which parallel searches are used at a particular level of the memory hierarchy depends on factors such as improved access latency, design cost, complexity, and / or memory bandwidth balance.
[0023] In some embodiments, miss prediction is used to reduce, minimize, or otherwise manage the memory bandwidth penalty of performing parallel lookups. For example, in some embodiments, if on a given L2 miss, it is predicted that L3 will miss, then a parallel DRAM lookup is performed, but if it is predicted that L3 will not miss, then a parallel DRAM lookup is not performed.
[0024] Some embodiments provide cache miss prediction based on tracking hit and miss history or by tracking address space proximity. In some embodiments, the hit and miss history or address space proximity history is tracked using a variable number of bits. In some embodiments, the number of bits is adjusted based on feedback. In some embodiments, the feedback relates to accuracy of past predictions and / or available memory bandwidth. In some embodiments, the number of bits is adjusted based on accuracy of past predictions and / or available memory bandwidth.
[0025] In some embodiments, the miss prediction is based on tracking the hit and miss history of the cache and may be referred to as a time prediction, for example, in some embodiments, the time prediction is based on the past history of cache lookups.
[0026] In some embodiments, the miss prediction is based on tracking the hit and miss history of a memory region and may be referred to as a spatial prediction. For example, in some embodiments, the spatial prediction is based on tracking whether a hit or miss has occurred for data stored in the same region (e.g., within a given address range) of a memory or cache memory.
[0027] In some embodiments, the prediction is based on a combination of temporal and spatial predictions, the prediction being performed by circuitry configured to predict whether a request will miss (or hit) a cache (or other memory).
[0028] In some embodiments, a time miss prediction circuit (herein a miss predictor) tracks the hit or miss history and determines a repetitive pattern in the history. If a repetitive pattern is detected, a prediction is made as to whether the next cache lookup will be a hit or a miss based on the pattern.
[0029] In some embodiments, the time miss predictor tracks hit or miss history on a per-thread basis. In such embodiments, a history of cache hits and misses is recorded for each particular thread. If a repeating pattern is detected, a prediction is made as to whether the next cache lookup by that thread will be a hit or a miss based on the pattern. Tracking cache hits / misses on a per-thread basis can improve predictions.
[0030] In some embodiments, the time miss predictor tracks hit or miss history for each source. In this context, a "source" is the source of a request or "lookup" for information stored at a location. Cache memory and / or other memories are queried for information based on a request from a source. For example, cache lookup requests may come from different sources or types / classes of sources (e.g., code requests, data requests, translation lookaside buffer (TLB lookup), prefetch, etc.). In some embodiments, a history of cache hits and misses is recorded for each particular source. Tracking cache hits / misses based on source, type and / or class can improve predictions.
[0031] In some embodiments, the time miss predictor tracks hit or miss history on both a per-source and per-thread basis. For example, each thread may receive cache lookup requests from different sources or types / classes of sources (e.g., code requests, data requests, TLB, prefetch, etc.). Tracking cache hits / misses for each thread based on source class may improve predictions.
[0032] In some embodiments, the time miss predictor tracks hit or miss history on some other basis, such as per core.
[0033] In the following example, cache hits / misses are tracked using an 8-bit history. For each request, the hit or miss result is stored as the most significant bits after the bits of the history are shifted down to the remaining bits. The most significant 4 bits are compared to the least significant 4 bits to determine if they match, indicating a repeating pattern. A prediction as to whether the next request will hit or miss the cache is made based on whether a match (i.e., a repeating pattern) is detected. In some embodiments, two or more groups of history are compared to detect a pattern. For example, if the history is tracked with 9 bits (e.g., 8 to 0), the most significant 3 bits (8 to 6) are compared to the least significant 3 bits (2 to 0) and also the middle order bits (5 to 3), indicating a pattern where all three groups match. In some embodiments, this may have the advantage of resulting in a more reliable prediction.
[0034] Table 1 shows an 8-bit history of the temporal miss predictor that tracks hit or miss (denoted by H or M, respectively) history per core and per thread for a single source type.
[0035] [Table 1]
[0036] In this example, the most recent cache lookup by source type for thread 0 on core 0 was a hit, as indicated by the H in the most significant bit 7 in the left-most column. Comparing the most significant 4 bits with the least significant bit indicates a repeating pattern. In this example, the HMHM pattern in bits 7-4 matches the HMHM pattern in bits 3-0. In some embodiments, the next cache lookup by source type for thread 0 on core 0 is predicted to be a miss based on the detected 4-bit repeating pattern. Thus, in some embodiments, a parallel lookup to a lower level of cache or DRAM is performed based on a prediction that it will miss. In some embodiments, this determination includes other factors, such as available memory bandwidth, as described further herein.
[0037] As shown in the second row of Table 1, the most recent cache lookup by source type for thread 1 on core 0 was a hit, as indicated by the H in most significant bit 7 in the left-most column. Comparing the most significant 4 bits with the least significant bit indicates a repeating pattern of hits and misses. In this example, the HHMH pattern in bits 7-4 matches the HHMH pattern in bits 3-0. In some embodiments, the next cache lookup by source type for thread 1 on core 0 is predicted to be a hit based on the detected repeating pattern of the 4 bits. Thus, in some embodiments, a parallel lookup to a lower level of cache or DRAM is performed based on a prediction that there will be a hit. In some embodiments, this determination includes other factors, such as available memory bandwidth, as described further herein.
[0038] As shown in the third row of Table 1, the most recent cache lookup by source type for thread 0 on core 1 was a hit, as indicated by the H in most significant bit 7 of the left-most column. Comparing the most significant 4 bits to the least significant bit indicates that there is no repeating pattern detected. In this example, the HMHH pattern in bits 7-4 does not match the MMMM pattern in bits 3-0. In some embodiments, based on the absence of a repeating pattern detected, no prediction is made for the next cache lookup by source type for thread 0 on core 1. Thus, in some embodiments, whether a parallel lookup to a lower level of cache or DRAM is performed is based on other factors, such as default settings, available memory bandwidth, and / or other factors, e.g., as described further herein. In some embodiments, the default for whether to initiate a parallel lookup if no repeating pattern is detected is selectable (e.g., as an implementation choice or tuning parameter, etc.).
[0039] The number of bits used to track history or the resolution of the history can be considered as an indication of the accuracy of the prediction. For example, in some embodiments, the number of bits used to track history is related to the level of confidence in the prediction, where more history tracking bits result in a higher resolution match and a higher confidence that the miss prediction based on the repeating pattern (or the absence of the repeating pattern) is accurate. Fewer history tracking bits result in a lower resolution match and a lower confidence that the miss prediction based on the repeating pattern (or the absence of the repeating pattern) is accurate. Thus, the accuracy of the prediction, or the so-called reliability of the miss prediction, can be increased or relaxed based on the number of bits used to store the history. For example, using 8 bits to track hit and miss history will produce a higher resolution and potentially more accurate prediction than using 2 bits to track hit and miss history.
[0040] In some embodiments, the prediction resolution can be adjusted based on available bandwidth (e.g., memory bandwidth). Note that while the prediction resolution is adjusted based on memory bandwidth in the examples herein, in some embodiments, the prediction resolution can be adjusted based on other bandwidths (e.g., interconnect bandwidth) in addition to or instead of memory bandwidth. For example, when available memory bandwidth is relatively abundant (e.g., without affecting other memory traffic or when other memory traffic is high enough to allow parallel search without being delayed beyond a threshold amount), iterations within 2 bits can provide sufficiently accurate miss prediction in some circumstances, since the memory bandwidth cost of an incorrect prediction is relatively lower. In other words, initiating an unnecessary parallel search (e.g., of DRAM) by mispredicting a miss causes a relatively lower performance penalty without delaying (or excessively delaying) other memory traffic, provided there is sufficient bandwidth to handle the parallel search.
[0041] On the other hand, if available memory bandwidth is relatively scarce, in some embodiments it may be preferable to base the miss prediction on a repeating pattern over a larger number of bits to provide a more accurate miss prediction. In some embodiments, basing the miss prediction on a larger number of history tracking bits may have the advantage of reducing or avoiding unnecessary DRAM lookups. In other words, reducing the likelihood of mispredicting a lookup miss may have the advantage of reducing delays to other memory traffic by increasing the number of traffic history bits.
[0042] In some embodiments, increasing the number of history bits used for prediction can have the advantage of increasing prediction accuracy. In some embodiments, increasing the number of history bits used for prediction can have the disadvantage of missing detection of some patterns that are mixed with other patterns. In some embodiments, increasing the number of history bits used for prediction can have the disadvantage of taking longer to detect a pattern, e.g., the history buffer takes longer to fill due to its increased size.
[0043] FIG. 2 is a flow chart illustrating an example adjustment of history tracking resolution based on available memory bandwidth.
[0044] In step 202, the memory system receives a request for a cache lookup. In some embodiments, the memory system receives a request from a source, such as a code request, a data request, a TLB, a prefetch, etc. In some embodiments, the memory system includes a memory controller that receives the request.
[0045] In step 204, the memory system compares the currently available memory bandwidth with the memory bandwidth that was available following the previous cache lookup request. In some embodiments, the comparison is performed by a component other than the memory system.
[0046] If the currently available memory bandwidth is the same (or within a threshold amount) as the available memory bandwidth following the previous cache lookup request (i.e., there has been no change in the available memory bandwidth or there has been a change but within a threshold amount), the history tracking resolution is not changed in step 206 and flow returns to step 202 for the next cache lookup.
[0047] If the available memory bandwidth following the previous cache lookup request was greater than the currently available memory bandwidth (or was greater than a threshold amount) (i.e., whether there has been a decrease in available memory bandwidth or whether there has been a decrease by more than a threshold amount), the history tracking resolution is increased in step 208 (e.g., changed from 2 bits to 8 bits) and flow returns to step 202 for the next cache lookup.
[0048] If the available memory bandwidth following the previous cache lookup request was less than the currently available memory bandwidth (or was less than a threshold amount) (i.e., whether there has been an increase in the available memory bandwidth or an increase by more than a threshold amount), the history tracking resolution is decreased (e.g., changed from 8 bits to 2 bits) in step 210. In some embodiments, flow returns to step 202 for the next cache lookup, but in this example, in the condition 212 that the currently available bandwidth exceeds the maximum threshold, the predictor is turned off in step 214 before flow returns to step 202, and in the condition 212 that the currently available bandwidth does not exceed the maximum threshold, flow returns directly to step 202. In such an embodiment, a miss prediction is deemed unnecessary when the memory bandwidth is above the threshold and a parallel lookup is initiated for each cache lookup, since there is sufficient bandwidth to handle the parallel lookup without delaying (or unduly delaying) other memory traffic.
[0049] In some embodiments, the resolution of the prediction can alternatively be adjusted based on feedback. For example, when a request for a cache (or other memory) lookup is received by a memory system (e.g., a memory controller), a prediction is made based on the current history whether the cache lookup will miss. After the lookup is finally completed, the actual result is compared to the prediction. This comparison is used as feedback to the prediction history. In other words, the resolution (e.g., number of bits) of the history can be adjusted based on feedback in some embodiments. For example, if a miss prediction was incorrect, more bits can be used for future predictions, and vice versa.
[0050] FIG. 3 is a flow chart illustrating an example adjustment of historical tracking resolution based on feedback.
[0051] In step 302, a memory system receives a request for a cache or other memory lookup. In some embodiments, the memory system receives the lookup request from a source, such as a code request, a data request, a TLB, a prefetch, etc. In some embodiments, the memory system includes a memory controller that receives the request.
[0052] In step 304, the prediction circuit generates a prediction of whether the request will hit or miss the cache. In condition 308 where the predictor incorrectly predicts whether the request will hit or miss the cache (i.e., the prediction does not match the actual result), the tracking history resolution is updated (e.g., the number of bits is increased) in step 310. In condition 308 where the predictor correctly predicts whether the request will hit or miss the cache (i.e., the prediction matches the actual result), the tracking history resolution is not updated (e.g., the number of bits remains the same), as shown in box 312. In either case, flow returns to step 302 for the next cache lookup. In some embodiments, the tracking history resolution is updated in step 310 on the condition that the miss prediction is inaccurate a threshold number of times.
[0053] Some embodiments provide cache miss prediction based on whether there was a hit or a miss in the same region of memory. For example, for an L2 cache lookup, the requested memory address is compared to the history of L3 misses within the address range of the requested memory address. Similar to the temporal predictor above, a history is maintained for each L3 lookup, but the tracker stores past miss addresses rather than past hit or miss results. For example, if a lookup request is for an address on the same memory page as an address that missed the L3 cache and is stored in the history, the request may be predicted to miss the L3 cache.
[0054] Table 2 shows an example of the history of an exemplary spatial miss predictor that tracks memory addresses that miss the L3 cache.
[0055] [Table 2]
[0056] In this example, history is also tracked per thread and per source, showing that these concepts can be combined with spatial prediction. Here, the history reflects that at least one lookup request for a memory address beginning with the most significant 32 bits 0xFAB12345 missed the L3 cache. It also shows that this memory request was for thread 0 (indicated by thread identifier TID) and came from the data cache (DC). Similarly, historical cache misses for memory addresses beginning with the most significant bits 0xCAFEBB8, 0xCODEB123 (from the instruction cache (ICC)), and 0xDEADBOB (from the translation lookaside buffer (TLB)) are also recorded in the history.
[0057] In some embodiments, cache lookups for memory addresses within a certain range of the recorded miss addresses are predicted to miss. In some embodiments, the misses are dependent on cache lookups coming from the same source type, or the same thread, core, etc. In some embodiments, the prediction resolution is defined by a number of bits. For example, if the resolution is defined as 16 bits, then a lookup request to an address that has the same most significant 16 bits as an address in the history that missed the same cache is predicted to miss the cache as well. The spatial predictor also stores a certain number of addresses. This number may be referred to as the depth of the predictor.
[0058] The resolution of the spatial predictor can be adjusted by changing the number of most significant bits used in the comparison. For example, if the resolution is changed from 16 bits to 256 bits, predictions are made for addresses within a smaller range of addresses from the missed addresses stored in the spatial prediction history, which in some embodiments is considered to be stricter or more accurate. The resolution and / or depth of the spatial predictor can also be dynamically adjusted in a manner similar to the temporal predictor described above. For example, the prediction may be set to be stricter if the available memory bandwidth falls below a threshold or decreases, or vice versa.
[0059] In some embodiments, the spatial predictor tracks hit or miss history on a per-thread basis. In such embodiments, a history of cache hits and misses is recorded for each particular thread. If a repeating pattern is detected, a prediction is made as to whether the next cache lookup by that thread will be a hit or a miss based on the pattern. Tracking cache hits / misses on a per-thread basis can improve predictions.
[0060] In some embodiments, the spatial miss predictor tracks hit or miss history by source. For example, cache lookup requests may come from different sources or types / classes of sources (e.g., code requests, data requests, TLB, prefetch, etc.). In some embodiments, cache hit and miss history is recorded for each particular source. Tracking cache hits / misses based on source, type and / or class can improve predictions.
[0061] In some embodiments, the spatial miss predictor tracks hit or miss history on both a per-source and per-thread basis. For example, each thread may receive cache lookup requests from different sources or types / classes of sources (e.g., code requests, data requests, TLB, prefetch, etc.). Tracking cache hits / misses for each thread based on source class may improve predictions.
[0062] Spatial and temporal predictors can be combined, for example some embodiments track both the history of hits and misses and the history of missed addresses, and a hit or miss prediction is made based on both spatial and temporal predictions.
[0063] 4 is a block diagram illustrating an example of a memory system 400. The memory hierarchy of memory system 400 includes an L2 cache 402, an L3 cache 404, and a DRAM 406. Memory system 400 also includes a miss predictor 408 and miss history buffers 410 and 412.
[0064] In this example, if a request for information to the L2 cache 402 misses, the L2 cache miss is recorded in the miss history buffer 410, and the miss predictor 408 predicts (or does not predict) whether the request for information will also miss the L3 cache.
[0065] If the predictor 408 predicts an L3 cache miss, it initiates a parallel search 414 for the information in the DRAM 406 .
[0066] If the predictor 408 predicts that the request will hit the L3 cache, or if no prediction is made, then a parallel search 414 of the DRAM 406 is not initiated.
[0067] In either case, if the request misses the L3 cache 404, an L3 cache miss is recorded in a miss history buffer 412 and a DRAM lookup 416 of the information is sent to the DRAM 406. If the L3 cache miss was predicted by the predictor 408, the information (or an indication of the DRAM miss) will be available sooner than if the miss had not been predicted by the predictor 408, due to a prior parallel DRAM lookup 414. In either case, the DRAM 406 returns the information or the DRAM miss indication to the L3 cache 404.
[0068] It should be understood that many variations are possible based on the disclosure herein, and although features and elements have been described above in particular combinations, each feature or element can be used alone without the other features and elements, or in various combinations with or without the other features and elements.
[0069] The various functional units illustrated in the figures and / or described herein (including, but not limited to, the processor 102, the input driver 112, the input device 108, the output driver 114, the output device 110, the acceleration processing device 116, the scheduler 136, the graphics processing pipeline 134, the computation unit 132, and the SIMD unit 138) may be implemented as a general purpose computer, processor, or processor core, or as a program, software, or firmware stored in a non-transitory computer-readable storage medium or another storage medium executable by the general purpose computer, processor, or processor core. The methods provided may be performed in a general purpose computer, processor, or processor core. Suitable processors include, by way of example, general purpose processors, special purpose processors, conventional processors, digital signal processors (DSPs), multiple microprocessors, one or more microprocessors associated with a DSP core, controllers, microcontrollers, Application Specific Integrated Circuits (ASICs), Field Programmable Gate Array (FPGA) circuits, any other type of integrated circuit (IC), and / or state machines. Such processors can be manufactured by configuring a manufacturing process using the results of processed hardware description language (HDL) instructions and other intermediate data, including netlists (instructions that can be stored on a computer readable medium). The result of such processing can be a mask work that is used in a subsequent semiconductor manufacturing process to manufacture a processor implementing features of the present disclosure.
[0070] The methods or flow charts provided herein may be implemented in a computer program, software, or firmware embodied in a non-transitory computer-readable storage medium for execution by a general purpose computer or processor. Examples of non-transitory computer-readable storage media include read only memory (ROM), random access memory (RAM), registers, cache memory, semiconductor memory devices, magnetic media such as internal hard disks and removable disks, magneto-optical media, and optical media such as CD-ROM disks and digital versatile disks (DVDs).
Claims
1. 1. A method for retrieving information based on a cache miss prediction, comprising: receiving a request for information; predicting, based on a history table, that a cache lookup of the information will result in a cache miss; performing a cache lookup of the information based on the request; fetching the information from a main memory before the cache lookup is completed based on a prediction that the cache lookup of the information will result in a cache miss. method.
2. predicting a cache lookup of the information that will result in a cache miss based on the history table includes comparing a first set of bits stored in the history table to a second set of bits stored in the history table.
2. The method of claim 1.
3. The resolution of the history table corresponds to the number of bits to track the history of cache misses.
2. The method of claim 1.
4. adjusting a resolution of the history table based on an amount of available memory bandwidth. The method of claim 3.
5. adjusting the resolution of the history table in response to a cache lookup of the information resulting in a cache hit. The method of claim 3.
6. fetching the information from main memory is completed after the cache search is completed.
2. The method of claim 1.
7. predicting a cache miss for a cache lookup of the information based on the history table includes comparing at least a portion of an address of the request for the information to a set of bits in the history table.
2. The method of claim 1.
8. the resolution of the history table corresponds to the number of bits that comprise the set of bits of the history table; The method of claim 7.
9. adjusting a resolution of the history table based on an amount of available memory bandwidth. The method of claim 8.
10. predicting that a request for the information will miss a cache, and adjusting resolution of the history table in response to detecting a corresponding cache hit that does not match the prediction.
9. The method of claim 8.
11. 1. A processor configured to retrieve information based on a cache miss prediction, comprising: a circuit configured to receive a request for information; a circuit configured to predict, based on a history table, that a cache lookup of the information will result in a cache miss; a circuit configured to perform a cache lookup of the information based on the request; and circuitry configured to fetch the information from a main memory before the cache lookup is completed based on a prediction that a cache lookup of the information will miss the cache. Processor.
12. the circuitry configured to predict a cache lookup of the information will miss a cache based on a history table includes circuitry configured to compare a first set of bits stored in the history table with a second set of bits stored in the history table; The processor of claim 11.
13. 12. The processor of claim 11, wherein a resolution of the history table corresponds to a number of bits that track a history of cache misses.
14. a circuit configured to adjust a resolution of the history table based on an amount of available memory bandwidth; The processor of claim 13.
15. circuitry configured to adjust a resolution of the history table in response to a cache lookup of the information resulting in a cache hit; The processor of claim 13.
16. fetching the information from main memory is completed after the cache search is completed. The processor of claim 11.
17. the circuitry configured to predict a cache miss for a cache lookup of the information based on the history table includes circuitry configured to compare at least a portion of an address of a request for the information with a set of bits in the history table. The processor of claim 11.
18. the resolution of the history table corresponds to the number of bits that comprise the set of bits of the history table; 20. The processor of claim 17.
19. a circuit configured to adjust the resolution of the history table based on an amount of available memory bandwidth; 20. The processor of claim 18.
20. circuitry configured to adjust resolution of the history table in response to predicting that a request for the information will miss a cache and detecting a corresponding cache hit that does not match the prediction; 20. The processor of claim 18.
Citation Information
Patent Citations
Cache predicting preload device and microcomputer and electronics
JP2001134439A
Prefetcher-based speculative dynamic random access memory read request technique
JP2021510886A
Predicting cache misses using data access behavior and instruction address
US20120284463A1
Filtering pre-fetch requests to reduce pre-fetching overhead
US20130246708A1
Cache memory architecture with on-chip tag array and off-chip data array
US6247094B1
