Performance-Aware Partial Cache Avalanche
In the partial cache avalanche procedure, selecting the least frequently used cache line based on the deterministic cache ejection policy for avalanche, solving the problem of low cache hit rate and improving the performance of processing devices.
Patent Information
- Application Number
- CN202380041224.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-05-27
- Filing Date
- 2023-03-29
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2043-03-29
AI Technical Summary
The prior art fails to effectively consider the nearest degree of cache lines relative to other cache channels when executing partial cache avalanche procedures, resulting in reduced cache hit rate and performance losses.
By selecting the least frequently used cache lines for avalanche based on the deterministic cache ejection strategy, optimizing cache hit rate and reducing main memory access.
Improves cache hit rate, reduces the number of main memory accesses, and improves the performance of processing devices.
Smart Images

Figure CN119213387B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to U.S. patent application No. 17 / 827,302, filed on May 27, 2022, which is assigned to the assignee of the present application and is hereby expressly incorporated by reference in its entirety as if fully set forth below and for all applicable purposes. Background Art Technical Field
[0004] Aspects of the present disclosure relate to memory devices, and in particular, to systems and methods for improving the performance of partial cache avalanche by a processing device.
[0005] Related technologies
[0006] Typically, the main memory in a computing system may use random access memory (RAM) devices as a source of volatile memory. RAM is particularly useful as a memory due to its density and speed. One disadvantage is that RAM may occasionally experience errors due to, for example, neutrons or alpha particles passing through the die, faulty components, inaccurate system timing, etc. This disadvantage can be particularly problematic for computing systems that communicate critical data or require data that is virtually error-free.
[0007] For this reason, a computer system may include an error correction device that generates and stores one or more error correction code (ECC) bits corresponding to the data stored in the RAM. Here, when the stored data is read from the main memory, the associated ECC bits are also read out and sent to the error correction device for proper evaluation and, if necessary, error correction. In some RAM devices, the ECC bits are stored "inline" with the corresponding data. In one example, for every 512 bits of payload data stored in the RAM device, there are associated ECC bits stored in the same DRAM in another location (address) different from the payload data.
[0008] However, in order to perform certain memory functions (e.g., partial data writes), the RAM area storing the data and its corresponding ECC bits must be initialized to matching values. For example, an application or processor may need to perform a process for initializing the RAM area storing both the data and the ECC bits by writing zeros to the area. However, such a process may require a relatively large amount of time and power. In one example, this may cause problems for battery-powered RAM devices. As RAM devices are increasingly utilized, there is a need for further improvements to such devices. Summary of the Invention
[0009] The systems, methods, and devices of the present disclosure each have several aspects, no single aspect of which is solely responsible for its desired properties. Without limiting the scope of the present application as expressed by the claims that follow, some features will now be briefly discussed. After considering this discussion, and particularly after reading the section entitled "Detailed Description," one will understand how the features of the present disclosure provide advantages.
[0010] Certain embodiments provide a method for performing a partial cache avalanche procedure. The method generally includes: counting a number of cache lines that meet eviction criteria based on a deterministic cache eviction policy in each cache way in a group of cache ways; selecting at least one cache way from the group for avalanche based on a corresponding number of cache lines that meet the eviction criteria; and performing the partial cache avalanche procedure based on the at least one cache way selected from the group for avalanche.
[0011] The following description and the associated drawings set forth in detail certain illustrative features of one or more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings depict certain aspects of the one or more embodiments and, therefore, are not to be considered limiting of the scope of the disclosure.
[0013] Figure 1 Example components and interconnects in a system on a chip (SoC) coupled to a memory that may be suitable for implementing various aspects of the present disclosure are illustrated.
[0014] Figure 2 is a diagram illustrating partial cache avalanche in an example cache according to aspects of the present disclosure.
[0015] Figure 3A and Figure 3B An example diagram illustrating a performance-aware partial cache avalanche procedure according to aspects of the present disclosure.
[0016] Figure 4A and Figure 4B The example allocates cache lines that meet non-eviction criteria from a selected way to a non-selected way according to aspects of the present disclosure.
[0017] Figure 5 is a graph of memory access latency for various levels of memory.
[0018] Figure 6 is a flow diagram illustrating example operations for executing a partial cache avalanche procedure in accordance with aspects of the present disclosure.
[0019] Figure 7Illustrated are processing systems that may include various components (eg, corresponding to means-plus-function components) configured to perform operations for the techniques disclosed herein.
[0020] To facilitate understanding, identical reference numerals have been used, where possible, to designate identical elements that are common to the figures. It is contemplated that elements and features of one embodiment may be beneficially incorporated in other embodiments without further recitation. DETAILED DESCRIPTION
[0021] Aspects of the present disclosure provide methods and apparatus for improving the performance of a processing device against partial buffer avalanches.
[0022] In devices that perform computer processing (e.g., computers, smartphones, systems on chips (SoCs), etc.), cache memory is a supplemental memory system that temporarily stores frequently used instructions and data for faster processing by the device's processor (e.g., a central processing unit (CPU)). Using cache memory can reduce the average time and / or energy used by the processor to access data compared to accessing data from the device's main memory. In other words, when data is found in cache memory (in what is known as a cache hit), accessing the data is much faster than retrieving it from main memory. The number of searches that result in a cache hit relative to the total number of searches is known as the cache hit ratio.
[0023] Some devices may be configured to perform partial cache avalanche, which generally refers to a mechanism for saving power by selectively applying power to a portion of a shared cache (power gating). Processors based on the Advanced Reduced Instruction Set Computer (RISC) Machine (ARM) architecture are examples of devices that can perform a partial cache avalanche procedure. When a device performs a partial cache avalanche procedure, the avalanched portion of the cache is typically checked for cache lines in which a dirty bit (i.e., a bit indicating whether the corresponding cache line has been updated) is set. That is, to capture updated data, each dirty line of the channel being avalanched is written to main memory, and the channel is avalanched (i.e., power gated).
[0024] In conventional partial cache avalanche procedures, the selection of the way being avalanched and the writing of dirty cache lines to main memory are performed without regard to how recent the avalanching cache line is relative to the other cache ways. Therefore, without regard to the eviction policy (the policy applied to decide which cache entries to remove and which to keep), the number of main memory accesses during an avalanche is typically equal to the number of dirty lines in the avalanching way. Unfortunately, this reduces cache hit rates and results in a performance penalty.
[0025] However, aspects of the present disclosure provide techniques that can lead to improvements in some cache avalanche procedures. For example, by considering the recency of an avalanche cache line relative to other cache ways, the cache hit rate can be improved, resulting in a corresponding improvement in performance.
[0026] Memory System Overview
[0027] The following description provides examples and does not limit the scope, applicability or implementation scheme set forth in the claims. Without departing from the scope of this disclosure, the function and arrangement of the elements discussed may be changed. Each example may omit, replace or add various procedures or components as appropriate. For example, the method described may be performed in a different order than described, and various steps may be added, omitted or combined. In addition, the features described for some examples may be combined in some other examples. For example, any number of aspects set forth herein may be used to implement an apparatus or practice method. In addition, the scope of this disclosure is intended to cover such apparatus or methods practiced using other structures, functions, or structures and functions that supplement or replace the various aspects of the disclosure set forth herein. It should be understood that any aspect of the disclosure disclosed herein may be embodied by one or more elements of the claims.
[0028] Although certain teachings of the present disclosure are illustrated using dynamic random access memory (DRAM) devices as example memory devices, the teachings are applicable to other areas, such as other volatile memory devices (e.g., static RAM (SRAM), synchronous SRAM (SDRAM), Rambus DRAM (RDRAM), etc.). Furthermore, although certain teachings of the present disclosure are illustrated using system-on-chip (SoC), the teachings are applicable to any suitable computing device that utilizes memory. Therefore, the disclosed teachings should not be construed as limited to DRAM devices or SoCs or the illustrated embodiments. The illustrated embodiments are merely vehicles for describing and illustrating examples of the inventive teachings disclosed herein.
[0029] Figure 1Example components and interconnects in a system-on-chip (SoC) 100 coupled to volatile memory 124 (e.g., DRAM) that may be suitable for implementing various aspects of the present disclosure are illustrated. SoC 100 may include multiple heterogeneous processors, such as a central processing unit (CPU) 102, a modem processor 104, a graphics processor 106, and an application processor 108. Each processor 102, 104, 106, 108 may include one or more cores, and each processor / core may perform operations independently of the other processors / cores. Processors 102, 104, 106, 108 may be organized in close proximity to one another (e.g., on a single substrate, die, integrated chip, etc.), allowing the processors to operate at much higher frequencies / clock rates than would be possible if signals were propagated off-chip. The proximity of the cores may also allow for sharing of on-chip memory and resources (e.g., voltage rails), as well as for more coordinated collaboration between the cores.
[0030] Processors 102, 104, 106, 108 may be interconnected to memory controller 114 and other system components (not shown) via an interconnect / bus module 122, which may include an array of reconfigurable logic gates and / or implement a bus architecture (e.g., CoreConnect, Advanced Microcontroller Bus Architecture (AMBA), etc.) Communication may also be provided by a high-level interconnect, such as a high-performance network on chip (NoC).
[0031] The memory controller 114 may include a dedicated hardware module configured to receive various memory transactions from one or more master devices and address and communicate the memory transactions to the memory 124. The multiple master devices may include one or more of the processors 102, 104, 106, 108 and / or applications operating on the processors 102, 104, 106, 108. The memory controller 114 may also manage the maintenance of the memory 124, such as scheduling and / or initiating refresh cycles and clearing content (e.g., data and / or code) commands as described herein. In some examples, the memory controller 114 may include one or more processors configured to perform the operations disclosed herein. Examples of processors include microprocessors, microcontrollers, digital signal processors (DSPs), field programmable gate arrays (FPGAs), programmable logic devices (PLDs), state machines, gating logic, discrete hardware circuits, and other suitable hardware configured to perform the various functionalities described throughout this disclosure. Memory 124 and memory controller 114 may be on-chip components of SoC 100 (e.g., on a substrate, die, integrated chip, etc.); however, it should be noted that in some examples, one or more of memory 124 and memory controller 114 may be located off-chip.
[0032] Memory 124 is a computer-readable storage medium having an interface to processors 102, 104, 106, 108 via bus module 122. As discussed, memory 124 can be an on-chip component, or alternatively (as shown) an off-chip component. Memory 124 can provide volatile storage, such as DRAM, for processors 102, 104, 106, 108 and / or other functional aspects of SoC 100. As shown, memory controller 114 includes an ECC module 130. ECC module 130 is configured to implement ECC logic for detecting and correcting errors in memory 124, as discussed and known in the art. In some aspects, ECC module 130 is configured to perform inline ECC logic.
[0033] The memory 124 may also include a hierarchy of one or more banks 134 and multiple libraries 132a to 132j (collectively referred to as libraries 132) in each bank 134. For example, the memory 124 may include multiple banks, each of which contains multiple internal library structures. In some examples, each library structure may include multiple memory pages or "rows." Generally speaking, a row of memory can be accessed on each library at a given time. Each library in the library 132 of a given bank 134 can share a bus (not shown) for reading / writing data. The memory controller 114 can support simultaneous operation of different banks 134 and libraries 132 that can be accessed independently. Because each library 132 acts as an independent entity, the library 132 can service multiple memory requests in parallel, thereby providing library-level parallelism.
[0034] Overview of cache architectures with partial cache avalanches
[0035] Figure 2 is a diagram illustrating an example cache architecture 200 that may be configured with a conventional partial cache avalanche procedure. The cache architecture 200 may be included in the memory controller 114 of the SoC 100, or may be built into any of the CPU 102, modem processor 104, GPU 106, or application processor 108, all of which are in Figure 1 Cache 200 includes a cache controller 202 and a cache memory 220. Cache memory 220 stores cache lines, where each cache line includes a cache tag (shown at 222), a validity bit (shown at 224), a dirty bit (shown at 226), and data (shown at 228). The cache tag in each cache line indicates which memory location in main memory the cache line was copied from. The valid bit indicates whether the cache line has been loaded with valid data.
[0036] During cache operation, a processor core (e.g., any of the CPU 102, modem processor 104, GPU 106, or application processor 108) issues a memory address 210 of memory that the processor core needs to access for a read or write. In the example cache, the cache controller compares the tag portion 212 of the memory address with the cache tag (shown at 222) of a cache line stored in the cache memory. If the cache controller finds that the tag portion matches the cache tag in the cache memory, a cache hit has occurred. However, if the cache controller does not find a cache tag in the cache memory that matches the tag portion, a cache miss has occurred. In the case of a cache hit, the cache controller immediately reads or writes the data of the corresponding cache line. In the case of a processor core issuing a read to a memory location, the cache controller delivers the data of the corresponding cache line to the processor core via data bus 230. In the case of a cache miss, the cache controller allocates a new cache line in the cache memory and copies the data from main memory to the new cache line, then satisfies the request from the processor core from the contents of the new cache line.
[0037] The example cache is a four-channel cache, and therefore each main memory location corresponds to a location in each of the four channels 240, and the data of any particular main memory location can be stored in a corresponding location in each of the four channels. Each of the four cache memory locations in which the data of the main memory location can be stored (i.e., one cache memory location in each channel) can be referred to as a member of a cache memory location set, and each such set has a corresponding set index. Each channel has a corresponding channel mask 270. When a cache miss occurs, the cache controller attempts to allocate a new cache line in a currently unused location in the cache memory. Therefore, in the example four-channel cache, when the cache controller is allocating a new cache line, the cache controller checks up to four locations (one location in each channel) to determine whether any location is unused. If there is no unused location, the cache controller consults the eviction policy 260 to determine which of the four locations can have its current data evicted so that a new cache line can be allocated.
[0038] When a device including the example cache determines to perform a partial cache avalanche, one of the four channels is selected for power gating. The cache controller executes corresponding channel avalanche logic (shown at 280) when avalanching the selected channel. Each of the channel avalanche logic includes executing sequential dirty line search logic 250, which searches the selected channel for cache lines marked as dirty (i.e., cache lines for which the dirty bit 226 is set) and writes those cache lines to their corresponding main memory locations, which are known from the cache line's cache tag.
[0039] As previously described, in conventional partial cache avalanche procedures, the selection of the way being avalanched and the writing of dirty cache lines to main memory are performed without regard to how recent the avalanched cache line is relative to the other cache ways. Therefore, without regard to the eviction policy (the policy applied to decide which cache entries to remove and which to keep), the number of main memory accesses during avalanche is typically equal to the number of dirty lines in the avalanching way, reducing cache hit rates and resulting in performance losses.
[0040] Example Technique for Performance-Aware Partial Cache Avalanche
[0041] However, aspects of the present disclosure provide techniques that can lead to improvements in partial cache avalanche procedures. For example, by considering the recency of an avalanche cache line relative to other cache ways, cache hit rates can be improved relative to systems utilizing conventional partial cache avalanche procedures.
[0042] The partial avalanche mechanism described herein can help optimize the performance of the partial cache avalanche procedure by improving the cache hit rate. This improved cache hit rate can lead to improved performance.
[0043] The operations performed during the performance-aware partial cache avalanche procedure proposed herein may be referred to herein as sequential channel processing. Figure 3A As shown, a cache architecture 300 configured to implement the performance-aware partial cache avalanche procedure proposed herein may include cache line swap logic 350 including sequential search logic, details of which are described below.
[0044] This sequential channel processing can be initiated when certain avalanche criteria are met. If such avalanche criteria are not met, the cache can behave as a regular cache (e.g., without sequential channel processing logic). Depending on the specific implementation, the avalanche criteria can be based on the number of active cores or based on a dedicated request for partial cache avalanche by a core or software. For example, the avalanche criterion can be that the number of active cores is greater than a threshold number before a partial cache avalanche is executed. As another example, the number of channels avalanched can depend on the number of active cores.
[0045] If the avalanche criteria are met, the sequential channel processing logic and additional hardware (e.g. Figure 3A Logic 350) can activate and implement the selected avalanche strategy.
[0046] In some cases, the cache architecture 300 may include logic 380 configured to count the number of cache lines that meet eviction criteria based on a deterministic cache eviction policy 360 in each cache way in a set of cache ways. Any suitable deterministic cache eviction policy may be used. For example, the deterministic cache eviction policy may provide that the least recently used (LRU) or least frequently used (LFU) cache lines are evicted. Thus, the logic 380 may include a counter ("crit-sat") for each way to count the number of cache lines that meet eviction criteria, such as the number of LRU or LFU cache lines for a given way.
[0047] The cache controller may then select the at least one cache way from the group for avalanche based on the number of cache lines of the at least one cache way's corresponding cache way that meet the eviction criteria (and perform a partial cache avalanche procedure based on selecting the at least one cache way from the group for avalanche).
[0048] For example, in Figure 3B In the example shown, channel 0 is selected for avalanche because this channel has the most cache lines that meet the criteria of the deterministic cache eviction policy (eg, has the most LRU lines or the most LFU lines).
[0049] The logic 350 may then sequentially check the selected avalanche cache way (or ways) for non-LRU cache lines. Once a non-LRU cache line is found, the least recently used cache line of the corresponding non-avalanche way from the same set may be evicted and replaced by a non-LRU line from the avalanche way. This approach may help avoid evicting non-LRU cache lines, resulting in improved cache hits and reduced DDR reads (and therefore, improved performance).
[0050] For reference Figure 4A and Figure 4B To understand this method. Figure 4A As illustrated, the channel selected for avalanche (e.g., from Figure 3B Channel 0) may have one or more non-LRU cache lines 410 (meaning it has been accessed relatively recently), while channels not selected for avalanche may have one or more LRU cache lines 420 (meaning it has not been accessed relatively recently).
[0051] like Figure 4BAs illustrated, the LRU cache line 420 from the non-avalanche channel may be evicted and replaced by the non-LRU cache line 410 from the avalanche channel. In other words, the evicted LRU cache line 420 from the non-avalanche channel is assigned to the non-LRU cache line 410 from the avalanche channel.
[0052] like Figure 4B As indicated, in some cases, when selecting which LRU cache lines to evict from the non-avalanche path, cache lines with non-dirty bits can be selected when possible. This approach can result in cache lines being evicted (flushed) without requiring a write, thereby saving memory transactions and further saving time and power.
[0053] While the above examples consider avalanching a single channel, in some cases it may be necessary (or desirable) to avalanche more than one channel (e.g., N channels). In such cases, the above techniques can be performed to select the N channels with the most lines that meet the eviction criteria. For example, the N channels with the N highest counted LRU lines can be selected and excluded from the replacement operation of the first channel avalanche. When avalanching is performed, the N channels contain the LRU, LRU-1, LRU-2, ..., LRU-(N-1) cache lines.
[0054] The performance-aware partial avalanche procedure described herein can have many benefits. For example, selecting the channel (or channels) with the highest LRU row for avalanche can reduce the amount of activity during the avalanche. An avalanche strategy that evicts available LRU rows from active channels rather than from avalanche channels can avoid local corruption. An avalanche strategy that retains the MRU row (or at least the time-critical cache row) according to the implemented cache eviction strategy can help reduce potential DDR transactions by improving cache hit rates.
[0055] Considering example memory access latencies for different memory levels, one can understand potential performance improvements. For example, Figure 5 As illustrated, the latency of memory accesses to DDR memory (510) may average 128 CPU cycles per memory access, the latency of memory accesses to level 3 (L3) cache (520) may average 26 CPU cycles per memory access, the latency of memory accesses to level 2 (L2) cache (530) may average 7 CPU cycles per memory access, and the latency of memory accesses to level 1 (L1) cache (540) may average 2 CPU cycles per memory access. Given these example values, increasing cache hit rates using the performance-aware partial avalanche procedure described herein may help avoid a potential approximately 5x time penalty for DDR accesses during an avalanche.
[0056] The sequential processing for the performance-aware partial avalanche procedure described herein may take a certain amount of time, e.g., to complete the reference Figure 4A and Figure 4B In some cases, if a read or write request (to L3) arrives during this time, sequential processing may be paused until the request is serviced.
[0057] In some cases, all channels (including the channel being considered for avalanche) can remain visible to reads. If a read request is for an index that has already been processed and results in a cache hit on a cache line in one of the channels not selected for partial avalanche, then the index may not need to be processed. On the other hand, if the read request hits the avalanche channel, then the index can be reprocessed.
[0058] In some cases, sequential processing can be paused when a write request arrives. As a result, the write request can essentially see the L3 cache with only non-avalanche channels active. In other words, the channel being considered for avalanche may not be visible to the write. If a write is made to an already processed index, then because the write request evicts one of the non-avalanche channels, the evicted line can be written back to the DDR (if dirty) or swapped with the avalanche channel line (e.g., if the avalanche line is non-dirty, depending on which is prioritized). Writes to unprocessed indexes can be processed like normal L3 writes, where all channels are visible.
[0059] In some cases, the avalanche strategy can use information about speculative traffic to initiate sequential processing using the selected avalanche strategy with the help of existing logic such as address pattern detection, random address pattern detectors, and pre-fetch block addresses. In such cases, it is possible to create address access patterns that can keep sequential processing stopped or repeatedly process the same INDEX. To avoid such locks, timer-based sequential processing cancellation can be implemented. As an alternative, a limit on the number of scans used for sequential processing can be set. In such cases, if the timer expires or the scan limit is met, avalanche processing can be suspended, as this can indicate that the traffic volume is high, or L3 transactions can be suspended to complete avalanche processing.
[0060] Example Method
[0061] Figure 6 is a flow diagram illustrating example operations 600 for performing a partial cache avalanche procedure in accordance with certain aspects of the present disclosure. For example, Figure 6 The steps of the operation may be performed by a memory controller (e.g., Figure 1 14) or another suitable circuit to perform.
[0062] Operations 600 begin at step 605 by counting the number of cache lines that meet eviction criteria based on a deterministic cache eviction policy in each cache way in a set of cache ways.
[0063] Operations 600 may continue at step 610 by selecting at least one cache way from the group for avalanche based on a number of cache lines corresponding to the at least one cache way that meet eviction criteria.
[0064] Operations 600 may continue at step 615 by performing a partial cache avalanche procedure based on selecting at least one cache way from the group for avalanche.
[0065] In certain aspects, the deterministic cache eviction policy includes at least one of: a least recently used (LRU) cache line eviction policy or a least frequently used (LFU) cache line eviction policy.
[0066] In certain aspects, the operation 600 includes determining that one or more avalanche criteria are satisfied prior to executing the partial cache avalanche procedure.
[0067] In certain aspects, the avalanche criteria is based on at least one of a number of active cores or a request for partial cache avalanche.
[0068] In some aspects, performing a partial cache avalanche procedure includes identifying one or more sets, each of the one or more sets containing at least one cache line that does not meet eviction criteria in a cache way selected from a group for avalanche; and in each of the identified sets, evicting a cache line that meets the eviction criteria from another cache way in the group of ways that is not selected for avalanche, and assigning the evicted cache line to a cache line that does not meet the eviction criteria in the cache way selected from the group for avalanche.
[0069] In some aspects, a cache line from at least one other cache way satisfies additional criteria
[0070] In some aspects, the operation 600 includes selecting a cache line from one or more non-dirty cache lines of at least one other cache way that satisfies additional criteria.
[0071] In some aspects, selecting at least one cache way from the set for avalanching includes selecting a cache way for avalanching having a highest number of cache lines that meet eviction criteria.
[0072] In some aspects, selecting at least one cache way from the set for avalanching includes selecting a plurality of cache ways having a highest number of cache lines that meet eviction criteria.
[0073] In certain aspects, performing the partial avalanche procedure includes excluding cache lines of the plurality of cache ways that meet eviction criteria from replacement operations.
[0074] Figure 7 7 illustrates a processing system 700 that may include processors configured to perform operations for the techniques disclosed herein (such as in Figure 6 The processing system 700 includes a processor 704 coupled to a computer-readable medium / memory 712 via a bus 706. In some aspects, the computer-readable medium / memory 712 is configured to store instructions that, when executed by the processor 704, cause the processor 704 to perform Figure 6 Computer-executable instructions (eg, computer-executable code) for performing the operations illustrated in or other operations discussed herein for performing various techniques for performing partial cache avalanche.
[0075] In certain aspects, the computer-readable medium / memory 712 stores code 714 for counting a number of cache lines that meet eviction criteria based on a deterministic cache eviction policy in each cache way in a set of cache ways; code 716 for selecting at least one cache way from the set for avalanching based on a corresponding number of cache lines that meet the eviction criteria; and code 717 for performing a partial cache avalanche procedure based on selecting the at least one cache way from the set for avalanching.
[0076] In certain aspects, the processor 704 has circuitry configured to implement code stored in the computer-readable medium / memory 712. The processor 704 includes circuitry 720 for counting a number of cache lines that meet eviction criteria based on a deterministic cache eviction policy in each cache way in a group of cache ways; circuitry 722 for selecting at least one cache way from the group for avalanche based on a corresponding number of cache lines that meet the eviction criteria; and circuitry 724 for performing a partial cache avalanche procedure based on selecting the at least one cache way from the group for avalanche.
[0077] Sample Clauses
[0078] Specific implementation examples are described in the following numbered clauses:
[0079] Clause 1: A method for performing a partial cache avalanche procedure, the method comprising: counting a number of cache lines that meet eviction criteria based on a deterministic cache eviction policy in each cache way in a set of cache ways; selecting at least one cache way from the set for avalanching based on a corresponding number of cache lines that meet the eviction criteria; and performing the partial cache avalanche procedure based on the at least one cache way selected from the set for avalanching.
[0080] Clause 2: The method of Clause 1, wherein the deterministic cache eviction policy comprises at least one of: a least recently used (LRU) cache line eviction policy or a least frequently used (LFU) cache line eviction policy.
[0081] Clause 3: The method of clause 1, further comprising determining that one or more avalanche criteria are satisfied prior to executing the partial cache avalanche procedure.
[0082] Clause 4: The method of clause 3, wherein the avalanche criteria is based on at least one of a number of active cores or a request for partial cache avalanche.
[0083] Clause 5: The method of clause 1, wherein performing the partial cache avalanche procedure comprises: identifying one or more sets, each of the one or more sets containing at least one cache line that does not meet the eviction criteria in the cache way selected from the group for avalanche; and in each of the identified sets, evicting a cache line that meets the eviction criteria from another cache way in the group of ways that is not selected for avalanche, and assigning the evicted cache line to a cache line that does not meet the eviction criteria in the cache way selected from the group for avalanche.
[0084] Clause 6: The method of Clause 5, wherein the cache line from the another cache way satisfies an additional criterion.
[0085] Clause 7: The method of clause 6, further comprising selecting the cache line that satisfies the additional criteria from one or more non-dirty cache lines of the another cache way.
[0086] Clause 8: The method of Clause 1, wherein selecting at least one cache way from the set for avalanche comprises selecting a cache way for avalanche having a highest number of cache lines that meet the eviction criteria.
[0087] Clause 9: The method of Clause 1, wherein selecting at least one cache way from the group for avalanche comprises selecting a plurality of cache ways having a highest number of cache lines that meet the eviction criteria.
[0088] Clause 10: The method of Clause 9, wherein performing the partial avalanche procedure comprises excluding cache lines of the plurality of cache ways that meet the eviction criteria from replacement operations.
[0089] Clause 11: An apparatus comprising: a memory comprising executable instructions; and a processor configured to execute the executable instructions and cause the apparatus to perform the method of any one of clauses 1 to 10.
[0090] Clause 12: An apparatus comprising means for performing the method of any one of clauses 1 to 10.
[0091] Clause 13: A non-transitory computer-readable medium comprising executable instructions that, when executed by a processor of an apparatus, cause the apparatus to perform the method of any one of clauses 1 to 10.
[0092] Clause 14: A computer program product embodied on a computer-readable storage medium, the computer program product comprising code for performing the method according to any one of clauses 1 to 10.
[0093] Additional Information
[0094] The previous description is provided to enable any person skilled in the art to practice the various embodiments described herein. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the universal principles defined herein can be applied to other embodiments. For example, without departing from the scope of this disclosure, the function and arrangement of the elements discussed may be changed. Each example may omit, replace, or add various procedures or components as appropriate. In addition, the features described for some examples may be combined in some other examples. For example, any number of aspects set forth herein may be used to implement an apparatus or practice method. In addition, the scope of this disclosure is intended to encompass such apparatus or methods practiced using other structures, functions, or structures and functions that supplement or replace the various aspects of the disclosure set forth herein. It should be understood that any aspect of the disclosure disclosed herein may be embodied by one or more elements of the claims.
[0095] As used herein, the word “exemplary” means “serving as an example, instance, or illustration.” Any aspect described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other aspects.
[0096] As used herein, a phrase referring to "at least one of" a list of items refers to any combination of those items (including single members). By way of example, "at least one of a, b, or c" is intended to cover a, b, c, ab, ac, bc, and abc, as well as any combination with multiples of the same element (e.g., aa, aaa, aab, aac, abb, acc, bb, bbb, bbc, cc, and ccc, or any other ordering of a, b, and c).
[0097] As used herein, the term "determining" encompasses a wide variety of actions. For example, "determining" may include calculating, computing, processing, deriving, investigating, searching (e.g., searching in a table, database, or another data structure), ascertaining, and the like. Furthermore, "determining" may include receiving (e.g., receiving information), accessing (e.g., accessing data in a memory), and the like. Furthermore, "determining" may include resolving, selecting, choosing, establishing, and the like.
[0098] The method disclosed herein includes one or more steps or actions for implementing the method. The steps and / or actions of the method can be interchangeable with each other without departing from the scope of the claims. In other words, unless a specific order of steps or actions is specified, the order and / or use of specific steps and / or actions can be modified without departing from the scope of the claims. In addition, the various operations of the method described above can be performed by any appropriate component that can perform the corresponding function. The component can include various hardware and / or software components and / or modules, including but not limited to circuits, application specific integrated circuits (ASICs) or processors. Typically, in the case of operations illustrated in the accompanying drawings, those operations can have corresponding corresponding components with similar numbers plus functional components.
[0099] The various illustrative logical blocks, modules, and circuits described in conjunction with this disclosure may be implemented or executed using a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete hardware components, or any combination thereof, designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any commercially available processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.
[0100] The processing system can be implemented using a bus architecture. Depending on the specific application and overall design constraints of the processing system, the bus can include any number of interconnecting buses and bridges. The bus can link various circuits together, including a processor, machine-readable media, and input / output devices, etc. A user interface (e.g., a keypad, display, mouse, joystick, etc.) can also be coupled to the bus. The bus can also link various other circuits, such as timing sources, peripherals, voltage regulators, power management circuits, etc., which are well known in the art and will not be described further. The processor can be implemented using one or more general-purpose processors and / or special-purpose processors. Examples include microprocessors, microcontrollers, DSP processors, and other circuits that can execute software. Those skilled in the art will recognize how to best implement the described functionality of the processing system depending on the specific application and the overall design constraints imposed on the entire system.
[0101] If implemented in software, each function may be stored as one or more instructions or codes on or transmitted via a computer-readable medium. Software should be broadly interpreted to mean instructions, data, or any combination thereof, whether referred to as software, firmware, middleware, microcode, hardware description language, or otherwise. Computer-readable media includes both computer storage media and communication media, such as any medium that facilitates the transfer of computer programs from one location to another. The processor may be responsible for managing the bus and general processing, including executing software modules stored on a computer-readable storage medium. A computer-readable storage medium may be coupled to the processor so that the processor can read information from and write information to the storage medium. In an alternative, the storage medium may be integral to the processor. By way of example, the computer-readable medium may include a transmission line, a carrier modulated by data, and / or a computer-readable storage medium having instructions stored thereon, separate from the wireless node, all of which may be accessed by the processor via a bus interface. Alternatively or in addition, the computer-readable medium or any portion thereof may be integrated into the processor, such as in the case of a cache and / or general register file. By way of example, examples of machine-readable storage media may include RAM (random access memory), flash memory, ROM (read-only memory), PROM (programmable read-only memory), EPROM (erasable programmable read-only memory), EEPROM (electrically erasable programmable read-only memory), registers, magnetic disks, optical disks, hard drives, or any other suitable storage media, or any combination thereof. The machine-readable medium may be embodied in a computer program product.
[0102] A software module may include a single instruction or perhaps multiple instructions and may be distributed across several different code segments, between different programs, and across multiple storage media. A computer-readable medium may include multiple software modules. A software module includes instructions that, when executed by a device such as a processor, cause a processing system to perform various functions. A software module may include a sending module and a receiving module. Each software module may reside in a single storage device or be distributed across multiple storage devices. By way of example, when a triggering event occurs, a software module may be loaded from a hard drive into RAM. During execution of the software module, the processor may load some of the instructions into a cache to increase access speed. One or more cache lines may then be loaded into a general register file for execution by the processor. When referring to the functionality of a software module, it will be understood that such functionality is implemented by the processor when executing instructions from the software module.
[0103] The following claims are not intended to be limited to the embodiments shown herein, but should be granted the full scope consistent with the language of the claims. Within the claims, unless otherwise specified, reference to an element in the singular is not intended to mean "one and only one", but "one or more". Unless otherwise specified, the term "some" refers to one or more. No claim element should be interpreted under the provisions of 35 U.S.C. § 112 (f) unless the element is explicitly recorded using the phrase "a means for..." or, in the case of a method claim, the element is recorded using the phrase "a step for...". All structural and functional equivalents of the elements of the various aspects described throughout this disclosure that are known or will later be known to one of ordinary skill in the art are expressly incorporated herein by reference and are intended to be covered by the claims. In addition, nothing disclosed herein is intended to be dedicated to the public, regardless of whether such disclosure is explicitly recorded in the claims.
Claims
1. A method for executing a partial cache avalanche procedure, the method comprising: counting a number of cache lines that meet an eviction criterion based on a deterministic cache eviction policy in each cache way in a set of cache ways; Selecting at least one cache way from the group for avalanche based on a number of cache lines corresponding to the at least one cache way that meet the eviction criteria, wherein selecting the at least one cache way comprises one of: Selecting a cache way for avalanche that has the highest number of cache lines that meet the eviction criteria, or selecting a plurality of cache ways having a highest number of cache lines that meet the eviction criteria; as well as The partial cache avalanche procedure is performed based on selecting the at least one cache way from the group for avalanche. 2 . The method of claim 1 , wherein the deterministic cache eviction policy comprises at least one of: a least recently used (LRU) cache line eviction policy or a least frequently used (LFU) cache line eviction policy. 3 . The method of claim 1 , further comprising determining that one or more avalanche criteria are satisfied before executing the partial cache avalanche procedure. 4 . The method of claim 3 , wherein the avalanche criteria is based on at least one of a number of active cores or a request for partial cache avalanche.
5. The method of claim 1 , wherein executing the partial cache avalanche procedure comprises: identifying one or more sets, the one or more sets each containing at least one cache line that does not meet the eviction criteria in the cache way selected from the group for avalanche; as well as In the set under consideration in the identified sets, a cache line that meets an eviction criterion is evicted from another cache way in the set of cache ways that is not selected for avalanche, and the evicted cache line is assigned to a cache line that does not meet the eviction criterion of the cache way selected from the set for avalanche. The method of claim 5 , wherein the cache line from the other cache way satisfies an additional criterion. 7 . The method of claim 6 , further comprising selecting the cache line that meets the additional criterion from one or more non-dirty cache lines of the other cache way. 8 . The method of claim 1 , wherein performing the partial cache avalanche procedure comprises excluding cache lines of the plurality of cache ways that meet the eviction criteria from replacement operations.
9. An apparatus for executing a partial cache avalanche procedure, the apparatus comprising: a memory comprising computer-executable instructions; and one or more processors configured to execute the computer-executable instructions and cause the apparatus to: counting a number of cache lines that meet an eviction criterion based on a deterministic cache eviction policy in each cache way in a set of cache ways; selecting at least one cache way from the group for avalanching based on a number of cache lines corresponding to the at least one cache way that meet the eviction criteria, wherein to select the at least one cache way, the one or more processors are configured to cause the apparatus to: Selecting a cache way for avalanche that has the highest number of cache lines that meet the eviction criteria, or selecting a plurality of cache ways having a highest number of cache lines that meet the eviction criteria; as well as The partial cache avalanche procedure is performed based on selecting the at least one cache way from the group for avalanche.
10. The apparatus of claim 9, wherein the deterministic cache eviction policy comprises at least one of: a least recently used (LRU) cache line eviction policy or a least frequently used (LFU) cache line eviction policy. 11 . The apparatus of claim 9 , wherein the processor is further configured to determine that one or more avalanche criteria are satisfied prior to executing the partial cache avalanche procedure.
12. The apparatus of claim 11, wherein the avalanche criteria is based on at least one of a number of active cores or a request for partial cache avalanche.
13. The apparatus of claim 9, wherein the processor being configured to execute the partial cache avalanche procedure comprises the processor being configured to: identifying one or more sets, the one or more sets each containing at least one cache line that does not meet the eviction criteria in the cache way selected from the group for avalanche; and In the set under consideration in the identified sets, a cache line that meets an eviction criterion is evicted from another cache way in the set of cache ways that is not selected for avalanche, and the evicted cache line is assigned to a cache line that does not meet the eviction criterion of the cache way selected from the set for avalanche.
14. The apparatus of claim 13, wherein the processor is further configured to determine that the cache line from the other cache way satisfies additional criteria. 15 . The apparatus of claim 14 , wherein the processor is further configured to select the cache line that meets the additional criterion from one or more non-dirty cache lines of the another cache way. 16 . The apparatus of claim 9 , wherein the processor being configured to perform the partial cache avalanche procedure comprises the processor being configured to exclude cache lines of the plurality of cache ways that meet the eviction criteria from replacement operations.
17. A non-transitory computer-readable medium comprising computer-executable instructions that, when executed by one or more processors of a device, cause the device to perform a partial cache avalanche procedure, the partial cache avalanche procedure comprising: counting a number of cache lines that meet an eviction criterion based on a deterministic cache eviction policy in each cache way in a set of cache ways; Selecting at least one cache way from the group for avalanche based on a number of cache lines corresponding to the at least one cache way that meet the eviction criteria, wherein selecting the at least one cache way comprises one of: Selecting a cache way for avalanche that has the highest number of cache lines that meet the eviction criteria, or selecting a plurality of cache ways having a highest number of cache lines that meet the eviction criteria; as well as The partial cache avalanche procedure is performed based on selecting the at least one cache way from the group for avalanche.
18. The non-transitory computer-readable medium of claim 17, wherein the deterministic cache eviction policy comprises at least one of: a least recently used (LRU) cache line eviction policy or a least frequently used (LFU) cache line eviction policy.
19. The non-transitory computer-readable medium of claim 17, wherein the partial cache avalanche procedure further comprises determining that one or more avalanche criteria are satisfied prior to executing the partial cache avalanche procedure.
20. The non-transitory computer-readable medium of claim 19, wherein the avalanche criteria is based on at least one of a number of active cores or a request for partial cache avalanche.
21. The non-transitory computer-readable medium of claim 17, wherein executing the partial cache avalanche procedure comprises: identifying one or more sets, the one or more sets each containing at least one cache line that does not meet the eviction criteria in the cache way selected from the group for avalanche; as well as In the set under consideration in the identified sets, a cache line that meets an eviction criterion is evicted from another cache way in the set of cache ways that is not selected for avalanche, and the evicted cache line is assigned to a cache line that does not meet the eviction criterion of the cache way selected from the set for avalanche.
22. The non-transitory computer-readable medium of claim 21, wherein the cache line from the another cache way satisfies additional criteria.
23. The non-transitory computer-readable medium of claim 22, wherein the partial cache avalanche procedure further comprises selecting the cache line that meets the additional criteria from one or more non-dirty cache lines of the another cache way.
24. An apparatus for executing a partial cache avalanche procedure, the apparatus comprising: means for counting a number of cache lines that meet eviction criteria based on a deterministic cache eviction policy in each cache way of a set of cache ways; means for selecting at least one cache way from the group for avalanche based on a number of cache lines corresponding to the at least one cache way that meet the eviction criteria, wherein the means for selecting comprises one of: means for selecting a cache way for avalanche having a highest number of cache lines satisfying said eviction criteria, or means for selecting a plurality of cache ways having a highest number of cache lines meeting the eviction criteria; and Means for executing the partial cache avalanche procedure based on selecting the at least one cache way from the group for avalanching.
Citation Information
Patent Citations
Cost-aware cache replacement
CN108885590A
A system and method for avoiding cache avalanche through multi-level caching in micro-service
CN109669960A