Using Request Classes and Reuse Records in One Cache for the Insertion Policy of Another Cache

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

Patent Information

Application Number
JP2024518288
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-09-28
Filing Date
2022-08-01
Publication Date
2024-09-12

Smart Images

  • Figure 2024533656000001
    Figure 2024533656000001
Patent Text Reader

Abstract

Systems and methods for maintaining an insertion policy for a lower level cache are disclosed. Techniques are described for selecting an insertion policy from among the insertion policies based on metadata of an evicted data block received from a higher level cache. Then, based on the selected insertion policy, a decision is made as to whether to insert the data block into the lower level cache. If a decision is made to insert, the data block is inserted into the lower level cache according to the selected insertion policy. Techniques are also disclosed for dynamically updating the insertion policy for the lower level cache.
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 / 488,206, filed September 28, 2021, the contents of which are incorporated by reference as if fully set forth herein. [Background technology]

[0002] In today's multi-core processors, the processors benefit from a hierarchy of caches. For example, a processor core may have access to a first level cache that is dedicated to its use. The first level cache is typically small and local to the processor core it serves, and therefore may be accessed efficiently. In addition, a processor core may have access to a second level cache, and possibly a third level cache, that are also used by other processor cores in the multi-core processor computer. The second and third level caches are typically larger caches, but are remote to the processor core, and therefore less efficient to access. In a multi-level cache architecture, data blocks (i.e., lines) that are evicted from a higher level cache are considered for insertion into a lower level cache in the cache hierarchy. Thus, the caches that store the evicted data blocks, i.e., victim-fill caches, have an insertion policy according to which they decide whether to insert or otherwise send the evicted data blocks to the next level cache down the hierarchy. Techniques are needed to optimize the insertion policy of victim-fill caches.

[0003] 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]

[0004] [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 hierarchy including a four-way set associative cache employable by a processor of the device of FIG. 1A in which one or more features of the present disclosure may be implemented. [Diagram 3] 1 is a flow diagram of an example operation of an upper level cache controller in which one or more features of the present disclosure may be implemented. [Figure 4] 1 is a flow diagram of an example operation of a lower-level cache controller in which one or more features of the present disclosure may be implemented. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0005] The present disclosure describes a method for maintaining an insertion policy for a lower-level cache. The method includes receiving a data block and associated metadata from a higher-level cache, where the metadata includes a reuse bit and a request class. Then, based on the reuse bit and the request class, select one of the insertion policies, and determine whether to insert the data block into the lower-level cache based on the selected insertion policy. If the decision is made to insert, insert the data block into the lower-level cache according to the selected insertion policy. Furthermore, upon insertion, the method may update the selected insertion policy based on the metadata. The selected insertion policy applies a Re-Reference Interval Prediction (RRIP) replacement policy and assigns an RRIP value to the inserted data block. Also, the selected insertion policy applies a Least Recently Used (LRU) replacement policy and assigns a recency value to the inserted data block.

[0006] In an alternative example, the lower level cache is a set associative cache. In that case, the method further includes selecting a first insertion policy candidate and a second insertion policy candidate for an insertion policy based on the reuse bit and the request class. Then, based on the first insertion policy candidate, it is determined whether to insert the data block into a first group of the set in the lower level cache, and if so, inserts the data block into the first group according to the first insertion policy candidate. Then, based on the second insertion policy candidate, it is further determined whether to insert the data block into a second group of the set in the lower level cache, and if so, inserts the data block into the second group according to the second insertion policy candidate. Based on either the first or second candidate policy, the method updates the selected insertion policy. For example, updating the selected insertion may include tracking performance of the first group and the second group based on a performance metric, selecting a new insertion policy based on the performance of the first group and the second group, and updating the selected insertion policy based on the new insertion policy. In another example, updating the selected insertion may include tracking the number of cache misses that occurred in the first group and the second group, and updating the selected insertion policy based on the first insertion policy candidate if the least number of cache misses occurred in the first group.

[0007] The present disclosure further discloses a system comprising at least one processor and a memory, the memory storing instructions which, when executed by the at least one processor, cause the system to: receive a data block and associated metadata from a higher level cache, the metadata including a reuse bit and a request class, select one of the insertion policies based on the reuse bit and the request class, determine whether to insert the data block into a lower level cache based on the selected insertion policy, and if determined to insert, insert the data block into the lower level cache according to the selected insertion policy.

[0008] The present disclosure further discloses a non-transitory computer-readable storage medium comprising instructions executable by at least one processor to perform operations including: receiving a data block and associated metadata from a higher-level cache, the metadata including a reuse bit and a request class, selecting one of the insertion policies based on the reuse bit and the request class, determining whether to insert the data block into a lower-level cache based on the selected insertion policy, and if determined to insert, inserting the data block into the lower-level cache according to the selected insertion policy.

[0009] 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 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. It should be understood that device 100A may include additional components not shown in FIG. 1A.

[0010] 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, the one or more cache memories are organized into a cache hierarchy, with higher caches in the cache hierarchy servicing misses and receiving evicted cache entries from lower caches in the cache hierarchy.

[0011] 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).

[0012] The input driver 112 and the output driver 114 each 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 calculations 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 not driven by a host processor (e.g., the processor 102) but are additionally or alternatively performed by other computing devices having similar capabilities 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.

[0013] 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. Generally, processor 130 is configured to execute a set of instructions (e.g., a computer program) that operate the circuitry of processor 130 to perform defined tasks.

[0014] 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 such as 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), or the like.

[0015] 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 simultaneously. 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 lower 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 has 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 has 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.

[0016] 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 delivery 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.

[0017] A cache injection memory access request may utilize steering tags to target processor resources such as a lower level cache dedicated to a processor core, a cache shared among a subset of processor cores, or a shared cache. For example, the steering tags may 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 may be stored in system memory 122 and may be partially cached in IOMMU 136. Alternatively, virtual tag map 138 may 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 lower 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.

[0018] In some embodiments, device 124 uses memory controller 132 to access 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. IOMMU 136 may 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, via an associated physical steering tag, 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) 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 write information of the request at a location corresponding to the memory address of the write request.

[0019] Figure 2 is a block diagram of an example cache hierarchy 200 including a four-way set associative cache employable by a processor of the device of Figure 1A in which one or more features of the present disclosure may be implemented. Figure 2 illustrates an upper level cache 210 that may be located at a particular level in the cache hierarchy and a lower level cache 250, i.e., a victim-fill cache, that may be located at a level below the level of cache 210. Both caches may be L-way set associative caches. For example, as illustrated in Figure 2, caches 210, 250 are set associative caches. A four-way set associative cache is divided into sets (specified by indexes), each containing four data blocks (or four lines), e.g., four ways 215, 220, 225, 230 in the upper level cache 210 and four ways 255, 260, 265, 270 in the lower level cache 250, so that each memory section from the main memory can be stored in any of the four ways of a set based on their particular address.

[0020] For example, memory address 280 (for a particular memory section in main memory) is shown to include tag 280.1, index 280.2, and block offset 280.3. Block offset 280.3, which comprises the least significant bits of address 280, provides an offset that points to the location within the data block where the data being accessed is stored. Index 280.2 specifies the set of data blocks in which the memory section may be stored in the cache, e.g., index 0 (for upper level cache 210) specifies the set that includes data blocks 215.1, 220.1, 225.1, and 230.1. Tag 280.1, which comprises the most significant bits of address 280, is used to associate the memory section with a data block within the set. Thus, when a memory section is stored in a particular data block, the tag of the memory section is saved as metadata for the data block. In this way, when the memory section is later re-referenced, the tag of the address of the memory section may be compared to the tags associated with each data block in the set specified by the index of the address of the memory section. If such a tag cannot be found in the set, then one of the data blocks in the set needs to be replaced (evicted), i.e., a memory section is copied to the memory location of the evicted data block, replacing its contents with the contents of the memory section, and updating the tag with the address of the memory section.

[0021] When several caches are arranged in a cache hierarchy 200, an evicted data block 240 that has been evicted from an upper-level cache 210 may be provided to a cache at a lower level of the cache hierarchy, such as lower-level cache 250, along with its associated metadata 245. The controller of the lower-level cache may then consider whether to insert the evicted data block 240 into the cache according to an insertion policy that it maintains and based on the metadata of the evicted data block 245.

[0022] The metadata associated with the data block may include an address tag, a RRIP value, a validity bit, a coherence state, a reuse bit, and a request class. The address tag (e.g., including a tag and an index) associates the data block with a memory section from the main memory in which the data block stores its contents, as described above. The RRIP value may be a value assigned by a replacement algorithm of a higher level cache. The validity bit indicates, for example, whether the data block stores valid data. The coherence state indicates whether the main memory has not been updated with changes made to the contents of the data block since the data block was read from the main memory. The reuse bit is typically reset to zero when the contents of the data block are first inserted into the cache, and is then set to one when the data block is being re-referenced. The request class may represent information related to the source that requested the insertion of the contents of the data block (or may represent the circumstances that brought the contents of the data block into the cache). The request classes may include, for example, instruction fetches, demand loads, stores, translation lookaside buffer (TLB) table walks, certain hardware prefetchers, certain types of software prefetches, locked instructions, user mode instructions, or supervisor mode instructions. Thus, a controller of a victim fill cache, such as lower level cache 250 of FIG. 2, may use the metadata of the evicted data block to determine whether to insert the data block into cache 250.

[0023] FIG. 3 is a flow diagram of an example operation of an upper level cache controller 300 in 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 if the accessed data segment (i.e., the requested data segment) is already stored in a data block of the cache. The check to see if 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 (320), and thus, in step 330, the data segment may be read from the data block in which it is stored. Following re-referencing of the data block 330, metadata associated with the data block may be updated in step 340. For example, a reuse bit may be set to 1 if the data block is re-referenced. In another example, the RRIP value associated with the data block may be updated according to a hit promotion policy used by the cache controller 300.

[0024] If the requested data segment is not stored in the cache, a cache miss occurs (320), and therefore one of the data blocks in the cache must be selected for eviction in step 350 according to the replacement policy used by the cache controller 300. For example, a cache that applies the RRIP framework for its cache replacement policy assigns an RRIP value to each data block in the cache. Thus, an M-bit RRIP value may be assigned to each data block, with an RRIP value of zero indicating that the data block is predicted to be re-referenced in the immediate future, while an RRIP value of 2M-1 indicates that the data block is predicted to be re-referenced in the distant future. For example, for M=2, four RRIP values ​​are possible: [0, 1, 2, 3], with the lower the RRIP value, the sooner the respective data block is predicted to be re-referenced. The replacement algorithm may then select to replace the data block with the maximum RRIP value in step 350.

[0025] After a data block is selected for eviction based on the replacement policy employed by the cache controller 300, the evicted data block and its associated metadata may be sent to the lower-level cache 250 in step 360. In addition, the requested data segment is fetched from the main memory and copied to the memory location in the cache of the data block selected for eviction in step 370. Then, in step 380, metadata associated with the data block that stores the requested data segment may be updated. For example, the tag of the data block is updated with the tag portion of the address of the data segment in the main memory. Next, as described with reference to FIG. 4, the controller of the lower-level cache 250, upon receipt of the evicted data block and its associated metadata from the controller of the upper-level cache 210, must decide whether to insert the evicted data block or send it and its associated metadata to the controller of the next level cache in the cache hierarchy.

[0026] 4 is a flow diagram of an example operation of a lower-level cache controller 400 in which one or more features of the present disclosure may be implemented. As described above, in step 410, the controller of the lower-level cache 250 may receive the evicted data block and its associated metadata from the upper-level cache 210. The controller 400 may then select an insertion policy based on the metadata in step 420. The controller 400 may then decide whether to insert the data block into the cache based on the selected insertion policy in step 430. If a decision is made not to insert the data block (440), then in step 450, the evicted data block and its associated metadata are sent to the next level cache down the cache hierarchy, or evicted to memory if at the last level of the hierarchy. If a decision is made to insert the data block (440), then the evicted data block may be inserted into the cache 250 in step 460 according to the insertion policy, possibly replacing another data block in the cache according to a replacement policy used by the controller of the cache 250. The insertion policy may then be updated in step 470, as described in more detail below.

[0027] The insertion policy of victim fill cache 250 may be predetermined statistically, for example, by employing a performance simulator. The insertion policy lookup table (e.g., Table 1) may be hardwired into system 100 or may be implemented in a programmable manner. Simulation may model different policies for different workloads deemed important and determine the best overall policy for optimizing hit ratio (or other cache performance metric). If the insertion policy lookup table is programmable, a user or vendor may experiment to determine the best policy for their particular workload. The policy determined to be best by cache performance simulation or by experimentation may be applied during the lifetime of system 100, for example, by method 400, using the lookup table as described below.

[0028] The insertion policy of the victim fill cache may be derived from a lookup table that correlates the metadata of the evicted data block with the respective insertion policy. For example, the reuse bit and the request class associated with the evicted data block may indicate how likely the data block would be re-referenced if the data block were inserted into the cache 250. For example, a data block having a request class that represents a demand load line that has been reused in the eviction cache 210 may have a higher likelihood of being hit in the victim fill cache 250 than a data block having other request classes. Table 1 provides an example of an insertion policy lookup table. Thus, in step 420, the lookup table may be consulted to determine which insertion policy to use for a given metadata of an evicted data block. As shown in Table 1, the metadata information regarding the reuse bit and the request class may be used to look up the insertion policy. For example, an insertion policy that applies an RRIP replacement policy based on the metadata of the data block may be used, in which case the data block may be inserted into the cache with a parameter indicating a high replacement policy strength (e.g., a low RRIP value) or a low replacement policy strength (e.g., a high RRIP value). In another example, an insertion policy that applies an LRU replacement policy based on the metadata of the data block may be used, in which case the data block may be inserted into the cache with a parameter indicating a recency (age) value.

[0029] Specifically, as shown in Table 1, an evicted block with a reuse bit of 0 and a demand load request class in its metadata will be inserted into the cache. According to the lookup table, the replacement policy to be used in this case is the RRIP replacement policy, and therefore an RRIP value of 0 will be associated with the inserted data block. Similarly, as shown in Table 1, an evicted block with a reuse bit of 1 and a demand load request class in its metadata will be inserted into the cache. According to the lookup table, the replacement policy to be used in this case is also the RRIP replacement policy, but an RRIP value of 3 will be associated with the inserted data block. Meanwhile, an evicted block with a reuse bit of 0 or 1 and a software prefetch request in its metadata will not be inserted into the cache. In yet another example, an evicted block with a reuse bit of 0 or 1 and a user mode instruction request class in its metadata will be inserted into the cache. According to the lookup table, the replacement policy to be used in this case is the LRU replacement policy, and therefore a recency parameter of value 0 or 1 will be associated with the inserted data block, respectively.

[0030] [Table 1]

[0031] Table 1 may be updated in step 470 based on statistics derived from information in the metadata of the inserted data block, for example. For example, the RRIP values ​​derived from the metadata of a data block having a reuse bit of 1 and a demand load requirement class may be used to form statistics of RRIP values. Such statistics may be used when inserting future blocks (including a reuse bit of 1 and a demand load requirement class) into the cache, and the corresponding RRIP parameter in the lookup table (currently a value of 3) may be updated with the statistics.

[0032] In an alternative example, the insertion policy may be dynamically determined. For example, victim fill cache 250 may dedicate two test groups, each of which may include a subset of the set (i.e., some indexes in the cache). Both groups correspond to a particular reuse bit (0 or 1) and a particular request class, but each group is assigned a different insertion policy candidate. The test groups are then used to test their respective insertion policy candidates, and the candidate with the better policy may then be applied to the cache. For example, a non-reused (non-reused hardware prefetch request class may be associated with a strong replacement policy in one group and a weaker replacement policy in a second group. The test groups may then be tracked to see which group is performing better according to a performance metric. The performance metric may be, for example, the number of cache misses. The insertion policy candidate that results in the fewest cache misses may then be applied to the remainder of the cache set (indexes) for the corresponding reuse bit and request class (e.g., non-reused hardware prefetch in the example above). In an alternative, tracking of the test groups and application of the selected insertion policy candidates to the remainder of the cache may be performed concurrently with operation of the cache. In another alternative, a separate mirrored cache may be used for the test groups. In this case, tracking of the test groups in the mirrored cache and application of the selected insertion policy candidates to the mirrored cache 250 may be performed concurrently with operation of the cache.

[0033] It should be understood that many variations are possible based on the disclosure herein, and although features and elements have been described above in specific combinations, each feature or element can be used alone without other features and elements, or in various combinations with or without other features and elements.

[0034] The various functional units shown 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 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 associated 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.

[0035] 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 maintaining an insertion policy for a lower level cache, comprising: receiving a data block and associated metadata from a higher level cache, the metadata including a reuse bit and a request class; selecting one of the insertion policies based on the reuse bit and the request class; determining whether to insert the data block into the lower level cache based on a selected insertion policy; if a determination is made to insert, inserting the data block into the lower level cache in accordance with the selected insertion policy. method.

2. The selected insertion policy applies a Re-Reference Interval Prediction (RRIP) replacement policy and assigns an RRIP value to the inserted data block.

2. The method of claim 1.

3. The selected insertion policy applies a least recently used (LRU) replacement policy and assigns the most recent value to the inserted data block.

2. The method of claim 1.

4. if a decision is made to insert, updating the selected insertion policy based on the metadata.

2. The method of claim 1.

5. the lower level cache is a set associative cache; The method comprises: selecting a first insertion policy candidate and a second insertion policy candidate from among the insertion policies based on the reuse bit and the request class; determining whether to insert the data block into a first group of sets in the lower-level cache based on the first insertion policy candidate, and if so, inserting the data block into the first group in accordance with the first insertion policy candidate; determining whether to insert the data block into a second group of sets in the lower-level cache based on the second insertion policy candidate, and if so, inserting the data block into the second group in accordance with the second insertion policy candidate; updating the selected insertion policy based on either the first candidate insertion policy or the second candidate insertion policy.

2. The method of claim 1.

6. Updating the selected insertion policy based on either the first insertion policy candidate or the second insertion policy candidate includes: tracking performance of the first group and the second group based on a performance metric; selecting a new insertion policy based on the performance of the first group and the second group; updating the selected insertion policy based on the new insertion policy. The method of claim 5.

7. Updating the selected insertion policy based on either the first insertion policy candidate or the second insertion policy candidate includes: tracking a number of cache misses that occurred in the first group and the second group; and updating the selected insertion policy based on the first candidate insertion policy if a minimum number of cache misses occurs in the first group. The method of claim 5.

8. 1. A system for maintaining an insertion policy for a lower level cache, comprising: At least one processor; A memory for storing instructions, The instructions, when executed by the at least one processor, receiving a data block and associated metadata from a higher level cache, the metadata including a reuse bit and a request class; selecting one of the insertion policies based on the reuse bit and the request class; determining whether to insert the data block into the lower level cache based on a selected insertion policy; if a decision is made to insert, inserting the data block into the lower level cache in accordance with the selected insertion policy; causing the system to system.

9. The selected insertion policy applies an RRIP replacement policy and assigns an RRIP value to the inserted data block. The system of claim 8.

10. The selected insertion policy applies a least recently used replacement policy and assigns the most recent value to the inserted data block. The system of claim 8.

11. The instruction: if a decision is made to insert, causing the system to update the selected insertion policy based on the metadata. The system of claim 8.

12. the lower level cache is a set associative cache; The instruction: selecting a first insertion policy candidate and a second insertion policy candidate from among the insertion policies based on the reuse bit and the request class; determining whether to insert the data block into a first group of sets in the lower-level cache based on the first insertion policy candidate, and if so, inserting the data block into the first group in accordance with the first insertion policy candidate; determining whether to insert the data block into a second group of sets in the lower-level cache based on the second insertion policy candidate, and if so, inserting the data block into the second group in accordance with the second insertion policy candidate; updating the selected insertion policy based on either the first candidate insertion policy or the second candidate insertion policy; causing the system to The system of claim 8.

13. Updating the selected insertion policy based on either the first insertion policy candidate or the second insertion policy candidate includes: tracking performance of the first group and the second group based on a performance metric; selecting a new insertion policy based on the performance of the first group and the second group; updating the selected insertion policy based on the new insertion policy. The system of claim 12.

14. Updating the selected insertion policy based on either the first insertion policy candidate or the second insertion policy candidate includes: tracking a number of cache misses that occurred in the first group and the second group; and updating the selected insertion policy based on the first candidate insertion policy if a minimum number of cache misses occurs in the first group. The system of claim 12.

15. 1. A computer-readable storage medium comprising instructions executable by at least one processor to perform operations for maintaining an insertion policy of a lower level cache, the instructions comprising: The operation includes: receiving a data block and associated metadata from a higher level cache, the metadata including a reuse bit and a request class; selecting one of the insertion policies based on the reuse bit and the request class; determining whether to insert the data block into the lower level cache based on a selected insertion policy; if a determination is made to insert, inserting the data block into the lower level cache in accordance with the selected insertion policy. A computer-readable storage medium.

16. The selected insertion policy applies an RRIP replacement policy and assigns an RRIP value to the inserted data block.

16. The computer readable storage medium of claim 15.

17. The selected insertion policy applies a least recently used replacement policy and assigns the most recent value to the inserted data block.

16. The computer readable storage medium of claim 15.

18. if a decision is made to insert, updating the selected insertion policy based on the metadata.

16. The computer readable storage medium of claim 15.

19. the lower level cache is a set associative cache; The operation includes: selecting a first insertion policy candidate and a second insertion policy candidate from among the insertion policies based on the reuse bit and the request class; determining whether to insert the data block into a first group of sets in the lower-level cache based on the first insertion policy candidate, and if so, inserting the data block into the first group in accordance with the first insertion policy candidate; determining whether to insert the data block into a second group of sets in the lower-level cache based on the second insertion policy candidate, and if so, inserting the data block into the second group in accordance with the second insertion policy candidate; updating the selected insertion policy based on either the first candidate insertion policy or the second candidate insertion policy.

16. The computer readable storage medium of claim 15.

20. Updating the selected insertion policy based on either the first insertion policy candidate or the second insertion policy candidate includes: tracking performance of the first group and the second group based on a performance metric; selecting a new insertion policy based on the performance of the first group and the second group; updating the selected insertion policy based on the new insertion policy.

20. The computer readable storage medium of claim 19.

21. Updating the selected insertion policy based on either the first insertion policy candidate or the second insertion policy candidate includes: tracking a number of cache misses that occurred in the first group and the second group; and updating the selected insertion policy based on the first candidate insertion policy if a minimum number of cache misses occurs in the first group.

20. The computer readable storage medium of claim 19.

Citation Information

Patent Citations

  • Scaled Set Dueling Cache Replacement Policies

    JP2019517690A

  • Cache management based on reuse period

    JP2022552124A

  • Empirically Based Dynamic Control of Acceptance of Victim Cache Lateral Castouts

    US20100262784A1

  • Systems and methods for implementing a tag-less shared cache and a larger backing cache

    US20150347297A1

  • Systems and methods for tracking of cache sector status

    US20170149924A1