Re-reference interval prediction (RRIP) using pseudo-LRU supplemental timing information

The RRIP and PLRU framework enhances cache performance by predicting re-reference intervals and adaptively selecting data blocks for eviction, addressing the challenge of varying data access patterns.

JP2024533612AActive Publication Date: 2024-09-12ADVANCED MICRO DEVICES INC
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
JP2024517403
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-09-29
Filing Date
2022-08-08
Publication Date
2024-09-12
Estimated Expiration
2042-08-08

AI Technical Summary

Technical Problem

Existing cache replacement algorithms struggle to optimize data block eviction based on varying data access patterns, leading to suboptimal performance across different workloads.

Method used

A tree-based pseudo-LRU (PLRU) algorithm integrated with Re-Reference Interval Prediction (RRIP) framework that learns re-reference likelihoods of cache data blocks, adjusting RRIP values based on access patterns and using a binary tree to select data blocks for replacement, enhancing cache hit rates.

Benefits of technology

The integrated RRIP and PLRU algorithm improves cache hit rates by adaptively selecting data blocks for eviction, optimizing cache performance across diverse workloads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024533612000001
    Figure 2024533612000001
Patent Text Reader

Abstract

A system and method for cache replacement is disclosed. A technique is described for determining a Re-Reference Interval Prediction (RRIP) value for each data block in a cache, the RRIP value representing the likelihood that each data block will be reused within a time interval. A binary tree that tracks the freshness of data blocks in the cache is utilized to select a data block in the cache to be replaced by a data segment when the data segment is not stored in the cache upon access by a processor in memory.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] (CROSS REFERENCE TO RELATED APPLICATIONS) This application claims the benefit of U.S. Patent Application No. 17 / 489,726, filed September 29, 2021, the contents of which are incorporated by reference as if fully set forth herein. [Background technology]

[0002] Caching reduces the time it takes for a processor to access data in main memory by storing frequently accessed data in memory local to the processor (cache), thus making the access faster and more efficient. A cache replacement algorithm (or policy) is used by cache management software to determine which data block to evict from the cache when a processor memory access results in a miss. That is, when a processor needs to read from or write to a data segment in main memory, if the data segment is already stored in the cache (i.e., a cache hit), the data segment will be accessed from the cache; however, if the data segment is not yet stored in the cache (i.e., a cache miss), the data segment will be fetched from the main memory to replace the data block in the cache determined by the replacement algorithm.

[0003] A replacement policy predicts the likelihood that each data block in the cache will be re-referenced (reused), and based on that, selects to replace the data block predicted to be re-referenced in the furthest future. One example of a replacement policy is the Least Recently Used (LRU) replacement policy. The LRU replacement algorithm predicts that the data block that has not been used for the longest time is most likely to be re-referenced in the furthest future, and therefore selects that data block to be replaced. On the other hand, the Re-Reference Interval Prediction (RRIP) replacement algorithm considers the frequency with which a data block is re-referenced instead of recency, and predicts the time interval in which the data block is likely to be reused. Data blocks predicted to be re-referenced in a near-immediate time interval are preserved, while data blocks predicted to be re-referenced in a distant time interval are candidates for eviction.

[0004] Replacement algorithms vary in part by what likelihood of re-reference they assign to newly added data blocks (hit promotion policy) and how they update (learn) the likelihood that a data block will be reused. How well replacement algorithms perform depends on the data access patterns of the applications running on the processor. For example, assigning a near-immediate re-reference likelihood or a distant re-reference likelihood to newly added data blocks is not optimal across all access patterns. Techniques for cache replacement that perform well under different data access patterns are needed.

[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 1A]1 is a block diagram of an example device in which one or more features of the present disclosure may be implemented. [Figure 1B] FIG. 1 is a block diagram of an example system that provides for managing memory access requests from a device in which one or more features of the present disclosure may be implemented. [Diagram 2] 1B is a block diagram of an example cache structure usable by a processor of the device of FIG. 1A, based on which one or more features of the present disclosure may be implemented. [Diagram 3] 1 is a functional block diagram of an example cache replacement method based on a Re-reference Interval Prediction (RRIP) framework, according to which one or more features of the present disclosure may be implemented. [Figure 4] 1 is a block diagram of an example tree-based pseudo-LRU (PLRU) selection procedure, based on which one or more features of the present disclosure may be implemented. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0007] This disclosure describes a system and method for cache replacement that incorporates a tree-based pseudo-LRU (PLRU) algorithm into the RRIP framework. A RRIP algorithm is described herein that learns the re-reference likelihood of each data block in the cache. The RRIP algorithm maintains an RRIP value that can represent multiple re-reference time intervals. Thus, a data block may be predicted to be re-referenced in time intervals from a near-instant time interval (lowest RRIP value), through an intermediate time interval, to a distant time interval (highest RRIP value). For example, when a new data block is placed in the cache, it may be assigned an intermediate re-reference interval, and each time this data block is reused, it may be assigned a shorter time interval, i.e., it is predicted to be re-referenced sooner. When a data block in the cache must be replaced (a cache miss), a data block predicted to be re-referenced in a distant time interval may be selected to be replaced. If such a data block is not found in the cache, the RRIP value of the data block in the cache is increased, a process that allows adaptation to changes in access patterns. However, if multiple data blocks with distant time interval predictions can be found in the cache, the binary tree of the PLRU algorithm can be utilized to select the oldest of the data blocks, as described herein. Applying the PLRU algorithm in synergy with the RRIP algorithm results in a higher cache hit ratio compared to applying the RRIP algorithm alone, given the cache access patterns of many workloads.

[0008] This disclosure describes a method for cache replacement. The method includes determining an RRIP value associated with each of the data blocks in the cache. The RRIP value represents the likelihood that the associated data block will be reused within a time interval, with a larger RRIP value corresponding to a time interval further in the future. If the data segment is not stored in the cache upon access by a processor to a data segment in a memory, the method includes selecting a data block in the cache to be replaced by the data segment. The selection of the data block includes searching for a data block in the cache associated with a maximum RRIP value, and if multiple data blocks are found, selecting one of the data blocks using a binary tree that tracks the freshness of the data blocks in the cache.

[0009] The present disclosure further discloses a system comprising at least one processor and a memory. The memory stores instructions that, when executed by the at least one processor, cause the system to determine an RRIP value associated with each of the data blocks in a cache. The RRIP value represents a likelihood that the associated data block will be reused within a time interval, with a larger RRIP value corresponding to a time interval further in the future. If the data segment is not stored in the cache upon access by the at least one processor to a data segment in the memory, the instructions cause the system to select a data block in the cache to be replaced by the data segment. The selection of the data block includes searching for a data block in the cache associated with a maximum RRIP value, and if multiple data blocks are found, selecting one of the data blocks using a binary tree that tracks the freshness of the data blocks in the cache.

[0010] The present disclosure further discloses a non-transitory computer-readable storage medium including instructions executable by at least one processor to implement a method. The method includes determining a Re-Reference Interval Prediction (RRIP) value associated with each of the data blocks in the cache. The RRIP value represents a likelihood that the associated data block will be reused within a time interval, with a larger RRIP value corresponding to a time interval further in the future. If the data segment is not stored in the cache upon access of a data segment in the medium by the at least one processor, the method includes selecting a data block in the cache to be replaced by the data segment. The selection of the data block includes searching for a data block in the cache associated with a RRIP value having a maximum value, and if multiple data blocks are found, selecting one of the data blocks using a binary tree that tracks the freshness of the data blocks in the cache.

[0011] 1A is a block diagram of an example device 100A in which one or more features of the present disclosure may be implemented. The device 100A may be, for example, but not limited to, a computer, a gaming device, a handheld device, a set-top box, a television, a mobile phone, a tablet computer, or any other computing device. The device 100A includes a processor 102, a memory 104, a storage device 106, one or more input devices 108, and one or more output devices 110. The device 100A also includes one or more input drivers 112 and one or more output drivers 114. Any input driver 112 may be embodied as hardware, a combination of hardware and software, or software, and serves to control (e.g., control the operation of, receive input from, and provide data to) the input device 108. Similarly, any output driver 114 may be embodied as hardware, a combination of hardware and software, or software and serves to control (e.g., control the operation of, receive input from, and provide data to) the output device 110. It should be understood that device 100A may include additional components not shown in FIG. 1A.

[0012] 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 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). In some embodiments, the processor 102 includes one or more caches 120. As is commonly known, a cache stores data items determined by a cache manager to be likely to be accessed by instructions executing on the processor 102 in the near future. The cache 120 represents one or more cache memories of the processor 102. In various embodiments, one or more cache memories are organized into a cache hierarchy, with higher caches in the cache hierarchy servicing misses from lower caches in the cache hierarchy and receiving avoided cache entries from lower caches in the cache hierarchy.

[0013] Storage devices 106 include fixed or removable storage devices (e.g., but not limited to, hard disk drives, solid state drives, optical disks, flash drives). 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). 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).

[0014] The input driver 112 and the output driver 114 include one or more hardware, software, and / or firmware components configured to interface with and drive the input device 108 and the output device 110, respectively. 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. The output driver 114 includes an accelerated processing device (APD) 116 coupled to a display device 118, which in some examples is a physical display device or a simulated device that shows output using a remote display protocol. The APD 116 is configured to accept computational and graphics rendering commands from the processor 102, process the computational and graphics rendering commands, and provide pixel output to the display device 118 for display. As described in further detail below, the APD 116 includes one or more parallel processing units configured to perform computations according to the single-instruction-multiple-data (SIMD) paradigm. Thus, although various functions are described herein as being performed by or in conjunction with the APD 116, in various alternative examples, the functions described as being performed by the APD 116 are additionally or alternatively performed by other computing devices having similar capabilities that are not driven by a host processor (e.g., the processor 102) and that are configured to provide graphical output to the display device 118. For example, it is contemplated that any processing system that performs processing tasks according to the SIMD paradigm may be configured to perform the functions described herein. Alternatively, it is contemplated that computing systems that do not perform processing tasks according to the SIMD paradigm perform the functions described herein.

[0015] 1B is a block diagram of an example system 100B that provides for managing memory access requests from a device in which one or more features of the present disclosure may be implemented. System 100B includes a processor 130 and a memory 122. System 100B may be incorporated into any of a variety of electronic devices, such as a server, a personal computer, a tablet, a set-top box, a gaming system, etc. Processor 130 is generally configured to execute a set of instructions (e.g., a computer program) that operate the circuitry of processor 130 to perform defined tasks.

[0016] Memory 122 facilitates the performance of these tasks by storing data and instructions used by processor 130. Memory 122 may be random access memory (RAM), non-volatile memory (e.g., flash memory or a hard disk drive (HDD)), or a combination thereof. System 100B also includes devices 124, such as physical input / output (I / O) devices. Devices 124 may be, for example, network interface cards (NICs), host bus adapters (HBAs), etc.

[0017] The processor 30 also includes processor cores 140, 150, 160, 170 and a memory controller (e.g., Northbridge) 132. The processor cores 140, 150, 160, 170 are processing units that execute instructions individually and in parallel. In some embodiments, each of the processor cores 140, 150, 160, 170 includes an individual instruction pipeline that fetches instructions, decodes the fetched instructions into corresponding operations, and executes various operations using resources of the system 100B. Although FIG. 1B illustrates the processor 130 with four processor cores 140, 150, 160, 170, the processor 130 may have more or less than four processor cores. Each of the processor cores 140, 150, 160, 170 has a low-level cache dedicated to the processor core. For example, the processor core 140 has a level 1 cache 142 and a level 2 cache 144. Processor core 140 may also include translation lookaside buffer 146. Similarly, processor core 150 has associated level 1 cache 152 and level 2 cache 154. Processor core 150 may also include translation lookaside buffer 156. In a further example, processor core 160 may have level 1 cache 162 and level 2 cache 164. Processor core 160 may also include translation lookaside buffer 166. In another example, processor core 170 may have level 1 cache 172 and level 2 cache 174. Processor core 170 may also include translation lookaside buffer 176. Processor 130 may further include cache memory shared by the pair of processors. For example, processor core 140 and processor core 160 may share L3 cache memory 180, and processor core 150 and processor core 170 may share L3 cache memory 185.

[0018] Processor 130 also includes an input / output memory management unit (IOMMU) 136 that is used to connect devices (such as device 124 as shown in FIG. 1A ) to memory controller 132. In some embodiments, IOMMU 136 communicates with device 124 using a serial bus. The serial bus may conform to a bus standard such as the Peripheral Component Interconnect Express (PCIe) serial bus standard. Memory controller 132 provides an interface through which device 124 communicates with memory 122 or one or more levels of cache memory. IOMMU 136 receives memory access requests (e.g., direct memory access requests such as cache injection memory access requests) from device 124 and controls the provision of those requests to memory 122 or cache memory via memory controller 132. Processor 130 includes a physical tag map 134 for mapping physical steering tags received from IOMMU 136 to physical resources targeted by associated memory access requests, such as cache injection memory access requests, for example, in memory controller 132. In addition, memory controller 132 receives responses to memory access requests from memory 122 or a cache memory, and controls the provision of the responses to device 124.

[0019] Cache injection memory access requests can utilize steering tags to target processor resources, such as lower level caches dedicated to a processor core, caches shared among a subset of processor cores, or shared caches. For example, steering tags can target L1 cache 152 or L2 cache 154 accessible by processor core 150, or L3 cache 185 accessible by processor cores 150 and 170. Thus, to facilitate efficient execution of memory access requests, IOMMU 136 accesses the virtual tag map to translate virtual steering tags received in memory access requests to physical steering tags mapped to physical resources. In response to receiving a memory access request from device 124, IOMMU 136 identifies the virtual steering tags and translates the virtual steering tags using virtual tag map 138. Virtual tag map 138 can be stored in system memory 122, and portions can be cached in IOMMU 136. Alternatively, virtual tag map 138 can be cached in IOMMU 136. IOMMU 136 provides the memory access request and the physical steering tag to memory controller 132. Memory controller 132 translates the physical steering tag to the physical resource targeted by the memory access request, such as a lower level cache targeted by the cache injection memory access request. In one example, the memory access request targets a low level cache dedicated to a processor core. In such an example, an address associated with the request may be translated by a translation lookaside buffer and the cache injection memory access may be performed.

[0020] In some embodiments, device 124 accesses information in memory 122 or a cache memory through a direct memory access (DMA) request by initiating a memory access request including a virtual steering tag and a virtual address sent to IOMMU 136 using memory controller 132. IOMMU 136 can perform steering tag remapping between virtual and physical steering tags, and address translation between virtual and physical addresses in memory 122 or a cache memory. The steering tag remapping and address translation processes may be independent functions of the IOMMU and may be performed simultaneously. For example, device 124 generates a cache injection memory access request, including a write request to store data in a cache memory associated with a processor executing a virtual machine that has use for the data provided by device 124. Each memory access request includes a virtual steering tag that is mapped to a cache resource (e.g., L3 cache 180 or 185; L1 cache 142, 152, 162 or 172; L2 cache 144, 154, 164 or 174) through an associated physical steering tag, and a memory address that indicates a location in the cache resource targeted by the cache injection memory access request. In response to a write request, the resource stores the request's write information at a location corresponding to the memory address of the write request.

[0021] FIG. 2 is a block diagram of an exemplary cache structure 200 usable by a processor of the device of FIG. 1A, based on which one or more features of the present disclosure may be implemented. The cache 210 includes data blocks 220.1-220.N (also referred to as "lines"). Each data block may include a data segment previously fetched from memory. For example, line 220.n may include data segment 250 fetched from address 255 in main memory 240. In addition to the data block, each line (e.g., 220.n) in the cache is associated with a tag (e.g., 215.n) and a flag bit (e.g., 225.n). For example, tag 215.n is associated with address 255 in main memory 240 from which data segment 250 (currently stored in line 220.n) was fetched. The flag bit 225.n is typically used to store data that characterizes (or is associated with) the corresponding data block 220.n. For example, flag 225.n may indicate the validity of the data stored in data block 220.n or whether main memory has not been updated with changes made to the data stored in data block 220.n.

[0022] Thus, tags 215.1-215.N are associated with respective lines 220.1-220.N in cache 210, each representing an actual or virtual address in main memory 240. When a processor executes an instruction requiring a memory access, i.e., when the processor needs to read from or write to a data segment stored at a particular address in main memory, the cache is first checked to see if the requested data segment is already stored in any of the lines 220.1-220.N of the cache. To see if the requested data segment 250 is already stored in any of the lines of the cache, the address 255 of the data segment can be compared with the tags 215.1-215.N of the respective lines 220.1-220.N. In practice, however, the placement policy of the cache stores a memory section of main memory (such as data segment 250) at a particular location in the cache. Thus, if any line in the cache can store any copy of a memory section, then the cache is a fully associative cache. If each memory section can be stored in only one line in the cache, then the cache is a directly mapped cache. If each memory section can be stored in one set of L locations in the cache, as is usually the case, then the cache is an L-way set-associative cache.

[0023] Typically, the bits representing the memory address 255 may be divided into groups based on their bit significance. In FIG. 2, the memory address 230 is shown to include a tag 230.1, an index 230.2, and a block offset 230.3. The block offset 230.3, which comprises the least significant bits of the address 230, provides an offset that points to the location within the data block where the requested data segment 250 is stored. For example, if the data block is a b-byte block, then the block offset 230.3 would have to be log2(b) bits long. The index 230.2 specifies the set of data blocks within the cache in which a particular memory section may be stored (e.g., one set includes L data blocks in an L-way set associative cache). For example, if there are s sets, then the index 230.2 would have to be log2(s) bits long. The tag 230.1, which comprises the most significant bits of the address 230, associates a particular memory section with the line (specified by the index) within the set in which it is stored. Thus, when searching whether a data segment is stored in a cache, the index portion of the address of the data segment points to a set in the cache in which the data segment may be stored, and then the tag portion of the address of the data segment is compared to the tags of the lines in that set. If the cache 210 is a four-way set associative cache, the cache is divided into sets (specified by the index), and each set contains four ways (four data blocks or lines). If the index portion of the address 255 of the data segment 250 points to a first set, then the data segment 250 will be searched for in this set, and the tag portion of the address 255 of the data segment can be compared to the tags of the lines in that set to find out whether any of those lines store the data segment.

[0024] 3 is a functional block diagram of an exemplary cache replacement method 300 based on the RRIP framework, on the basis of which one or more features of the present disclosure may be implemented. When a processor executes an instruction involving a memory access (e.g., a memory read or a memory write), in step 310, the cache is checked to see whether the accessed data segment (i.e., the requested data segment) is already stored in a data block of the cache. The check to see whether the requested data segment is already stored in a data block of the cache may be performed, for example, as described above with reference to FIG. 2. If the requested data segment is already stored in a data block of the cache, a cache hit occurs in step 315, and therefore, the data segment may be read from the data block in step 320. Following a re-reference to the data block 320, in step 325, a re-reference interval prediction value associated with the data block may be updated according to a hit promotion policy. If the requested data segment is not stored in any of the data blocks of the cache, then in step 315 a cache miss occurs and therefore one of the data blocks of the cache needs to be evicted (e.g., there are no invalid blocks available to use), i.e., the requested data segment is fetched from main memory and copied to the data block selected to be replaced by the replacement algorithm 300.

[0025] Various cache replacement algorithms apply different replacement policies. In the RRIP framework for cache replacement, the least likely data block will be evicted. For example, the RRIP framework may maintain M bits associated with each data block in the cache, and 2 M An RRIP value of -1 can be represented as 0, indicating that the data block is predicted to be re-referenced in the near immediate future, and 2 MAn RRIP value of -1 indicates that the data block is predicted to be re-referenced in the distant future. For example, for M=2, there are four possible RRIP values ​​[0, 1, 2, 3], and the lower the RRIP value, the sooner the respective data block is predicted to be re-referenced.

[0026] Thus, in case of a cache miss, in step 330, a data block with the maximum RRIP value (a data block predicted to be referenced later than all other data blocks) is searched for. In one embodiment, a data block with an RRIP value within a range including the maximum RRIP value may be searched for. If a data block with the maximum RRIP value (or within a range including the maximum RRIP value) is not found, in step 340, the RRIP values ​​of all data blocks are incremented by one and another search occurs in step 330. Otherwise, in step 345, if two or more data blocks with the maximum RRIP value (or within a range including the maximum RRIP value) are found, in step 355, one data block is selected to be replaced. If exactly one data block with the maximum RRIP value (or within a range including the maximum RRIP value) is found, that block is replaced in step 350. Thus, if two or more data blocks with the maximum RRIP value (or two or more data blocks with RRIP values ​​within a range including the maximum RRIP value) are found, a procedure must be performed in step 355 to select one data block to be replaced. A simple selection procedure that may be used is, for example, to select the data block with the smallest index. As disclosed herein, a tree-based PLRU selection procedure may be used, as described in detail below.

[0027] After it is determined which data block is to be replaced, in step 350, the requested data segment is fetched from main memory and stored in that data block. For example, if data block 220.n is to be replaced, the requested data segment 250 is copied to data block 220.n, address 215.n is updated with address 255 of data segment 250 in main memory 240, and possibly one or more flag bits are updated, for example, to reflect that the data block contents are valid. Then, in step 360, the RRIP value of the replaced data block may be set depending on how quickly the replaced data block 220.n is expected to be re-referenced. What constitutes a reasonable re-reference interval prediction depends on the memory access patterns of the processor (or of the application the processor executes). The replacement algorithm may learn the likely re-reference intervals, for example, by assigning a high RRIP value if the data block is to be replaced in step 360, and then decreasing this RRIP value by one each time the data block is re-referenced in step 320.

[0028] FIG. 4 is a block diagram 400 of an example tree-based PLRU selection procedure, based on which one or more features of the present disclosure may be implemented. PLRU is a replacement algorithm that approximates the LRU replacement algorithm. While the LRU algorithm basically replaces the data block with the oldest access time (the data block that has not been accessed for the longest time), the PLRU algorithm provides a result that approximates the data block with the oldest access time. The tree-based PLRU algorithm performs with a slightly higher miss rate compared to the LRU algorithm, but has better latency, uses less power, and has lower overhead. The tree-based PLRU maintains a binary tree that points to the next data block to be replaced. Thus, the binary tree 410 of the PLRU algorithm maintains a path to the data block with the approximated oldest access time.

[0029] 4, in the current state of the tree, data block 420.6 is pointed to for replacement via a tree path that includes nodes 410.1, 410.3, and 410.6 in the binary tree. Generally, a node with a value of "1" points to (or is connected to via a tree branch) a lower node to the right, and a node with a value of "0" points to (or is connected to via a tree branch) a lower node to the left. Each time a data block such as data block 420.6 is replaced, the nodes connected to it (410.1, 410.3, and 410.6) are flipped (change their values ​​so that they point to lower nodes), so that another data block in the cache is now pointed to, as shown by tree 440, which points to data block 420.2 to be the next data block to be replaced.

[0030] As discussed above with reference to FIG. 3, if more than one data block has the highest RRIP value, a selection procedure may be applied to select one data block therefrom to be replaced (step 355). The selection procedure disclosed herein may utilize the binary tree of the tree-based PLRU algorithm. FIG. 4 illustrates a cache 420 having eight data blocks 420.1-420.8 and their respective RRIP values ​​430. As shown, three data blocks (420.1, 420.3, and 420.6) have the highest RRIP value of 3. Thus, a selection procedure may be used to select one data block based on the current state of the binary tree 410. As discussed above, the binary tree 410 points to data block 420.6. Since that block is one of the three blocks with the highest RRIP value, that block will be selected to be replaced. Otherwise, for example in a scenario where data block 420.6 has a RRIP value of 2 and only two blocks 420.1 and 420.3 have a maximum RRIP value of 3, the selection procedure may start from a lower level of the tree since the tree in its current state does not point to any of the data blocks with the maximum RRIP value. For example, the selection procedure may start from node 410.2 and trace the path leading to the data block with the maximum RRIP value, in this case data block 420.3 (via node 410.5).

[0031] Alternatively, the selection procedure may start initially at the lowest level of the tree (e.g., 410.4, 410.5, 410.6, and 410.7). If multiple blocks with the maximum RRIP value are pointed to at that level (e.g., 420.1, 420.3, and 420.6), then it may proceed to the next level (e.g., 410.2 and 410.3), and if multiple blocks with the maximum RRIP value are still pointed to from that level (e.g., 420.3 and 420.6), then it may proceed to a higher level of the tree until only one block is pointed to. At the highest level of the tree (e.g., 410.1), only one block 420.6 is pointed to, and that block may be selected to be replaced. In one aspect, data blocks 420.1, 420.3, and 420.6 may have associated with them RRIP values ​​within a range that includes the maximum RRIP value. In such a case, the selection of one data block from them may be performed as if they all had the maximum RRIP value associated with them, as described above.

[0032] 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.

[0033] 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, and the accelerated processing device 116) 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 provided methods may be implemented in a general purpose computer, processor, or processor core. Suitable processors include, by way of example, a general purpose processor, a special purpose processor, a conventional processor, a digital signal processor (DSP), multiple microprocessors, one or more microprocessors in association with a DSP core, a controller, a microcontroller, an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) circuit, any other type of integrated circuit (IC), and / or a state machine. Such a processor may 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 may be stored on a computer-readable medium). The result of such processing may be a mask work that is used in subsequent semiconductor manufacturing processes to produce a processor that implements features of the present disclosure.

[0034] 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 cache replacement, comprising: a cache controller determining a re-reference interval prediction (RRIP) value associated with each of the data blocks in the cache; A processor accessing a data segment in a memory; in response to the data segment not being stored in the cache, selecting a data block in the cache to be replaced by the data segment; Selecting the data block comprises: retrieving a data block in the cache associated with the RRIP value having a maximum value; If a plurality of data blocks are found, selecting one of the plurality of data blocks using a binary tree. method.

2. Selecting any one of the plurality of data blocks using the binary tree includes: selecting a data block having a maximum RRIP value that is uniquely pointed to from one level of the binary tree; 2. The method of claim 1.

3. The RRIP value represents the likelihood that an associated data block will be reused within a time interval.

2. The method of claim 1.

4. A larger RRIP value corresponds to a time interval further in the future.

2. The method of claim 1.

5. the maximum RRIP value is a range of RRIP values ​​that includes the maximum RRIP value; 2. The method of claim 1.

6. The searching comprises: If no data block associated with the RRIP value having the maximum value is found, incrementing a RRIP value associated with each of the data blocks in the cache; repeating the search.

2. The method of claim 1.

7. The searching comprises: selecting a data block associated with the RRIP value having the maximum value if such a data block is found; 2. The method of claim 1.

8. updating an RRIP value associated with a data block when the data segment is stored in the cache upon access by the processor of the data segment; 2. The method of claim 1.

9. the binary tree tracks the freshness of data blocks in the cache; 2. The method of claim 1.

10. 1. A system comprising: At least one processor; A memory for storing instructions, The instructions, when executed by the at least one processor, a cache controller determining a re-reference interval prediction (RRIP) value associated with each of the data blocks in the cache; accessing a data segment in the memory by the at least one processor; in response to the data segment not being stored in the cache, selecting a data block in the cache to be replaced by the data segment; causing the system to Selecting the data block comprises: retrieving a data block in the cache associated with the RRIP value having a maximum value; If multiple data blocks are found, selecting one of the multiple data blocks using a binary tree that tracks the freshness of data blocks in the cache. system.

11. Selecting any one of the plurality of data blocks using the binary tree includes: selecting a data block having a maximum RRIP value that is uniquely pointed to from one level of the binary tree; The system of claim 10.

12. The RRIP value represents the likelihood that an associated data block will be reused within a time interval. The system of claim 10.

13. A larger RRIP value corresponds to a time interval further in the future. The system of claim 10.

14. The maximum RRIP value is a range of RRIP values ​​including the maximum RRIP value. The system of claim 10.

15. The searching comprises: If no data block associated with the RRIP value having the maximum value is found, incrementing a RRIP value associated with each of the data blocks in the cache; repeating the search. The system of claim 10.

16. The searching comprises: selecting a data block associated with the RRIP value having the maximum value if such a data block is found; The system of claim 10.

17. instructions for causing the system to update an RRIP value associated with a data block when the data segment is stored in a data block in the cache upon access of the data segment by the at least one processor; The system of claim 10.

18. 1. A computer-readable storage medium comprising instructions executable by at least one processor to perform a method, comprising: The method comprises: a cache controller determining a Re-Reference Interval Prediction (RRIP) value associated with each of the data blocks in the cache, the RRIP value representing a likelihood that the associated data block will be reused within a time interval, with a larger RRIP value corresponding to a time interval further in the future; accessing a data segment in a memory by the at least one processor; in response to the data segment not being stored in the cache, selecting a data block in the cache to be replaced by the data segment; Selecting the data block comprises: retrieving a data block in the cache associated with the RRIP value having a maximum value; If multiple data blocks are found, selecting one of the multiple data blocks using a binary tree that tracks the freshness of data blocks in the cache. A computer-readable storage medium.

19. The searching comprises: If no data block associated with the RRIP value having the maximum value is found, incrementing a RRIP value associated with each of the data blocks in the cache; repeating the search.

20. The computer readable storage medium of claim 18.

20. The searching comprises: selecting a data block associated with the RRIP value having the maximum value if such a data block is found; 20. The computer readable storage medium of claim 18.

21. updating an RRIP value associated with a data block when the data segment is stored in the cache upon access by the processor of the data segment; 20. The computer readable storage medium of claim 18.

Citation Information

Patent Citations

  • Cache with flexible configuration, data processing system using same, and method therefore

    JP2008544366A

  • Scaled Set Dueling Cache Replacement Policies

    JP2019517690A

  • Two level replacement scheme optimizes for performance, power, and area

    US20120096226A1

  • Cache system with biased cache line replacement policy and method therefor

    US20130311724A1

  • Cache memory control circuit and processor

    US20150248354A1