Cache replacement policy optimization for producer-consumer flows
By introducing a segmented retention state mechanism into the cache memory and adjusting the cache line retention state level, the problem of premature replacement of data in the cache is solved, and the durability of data storage and system performance are improved.
Patent Information
- Application Number
- CN202380025805.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-03-28
- Filing Date
- 2023-01-17
- Publication Date
- 2024-10-22
AI Technical Summary
In modern computer systems, due to space constraints in cache memory, data may be replaced prematurely before it is consumed, affecting data storage efficiency and reliability.
By introducing a segmented retention state mechanism in the cache memory, the retention state level of each cache line is adjusted based on the type and frequency of data transactions to avoid premature replacement of data.
It effectively reduces the probability of premature replacement of data in cache memory, improves the durability of data storage and memory efficiency, reduces the number of accesses to main memory, and improves the overall performance of the system.
Smart Images

Figure CN118829975A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a computing system. More specifically, the present disclosure relates to techniques for managing cache memory usage. Background Art
[0002] In modern computer system architectures, data flows may include frequent interactions between data producers and consumers involving cache memories of computer systems. Cache memories are high-speed memories that can be coupled to processors and can be formed as part of the process of manufacturing processors—for example, formed using the same die or socket, where the socket can contain multiple dies in a single package. The amount of data storage available in cache memories can be less than other types of computer system memories, but has lower read and write latency and higher read and write bandwidth. Due to the space constraints associated with cache memories, the control of data input and data output can be well characterized to prevent conflicts between data transactions and data loss. Certain challenges associated with such operations may arise. In some scenarios, for example, data transactions involving cache memories are controlled to facilitate the consumption of data by the host while minimizing interactions involving storage devices or access data using other types of memory. BRIEF DESCRIPTION OF THE DRAWINGS
[0003] Figure 1 An example computer system is illustrated in accordance with one or more embodiments.
[0004] Figure 2 The present invention illustrates a method according to one or more embodiments of the present invention. Figure 1 A first example flow chart of components of a computer system managing cache memory.
[0005] Figure 3 The present invention illustrates a method according to one or more embodiments of the present invention. Figure 1 A second example flow chart of components of a computer system managing cache memory.
[0006] Figure 4 The present invention illustrates a method for Figure 1 A collection of data transactions implemented in a computer system.
[0007] Figure 5 A method for reducing the probability that data stored in a cache memory of a processor system is replaced prematurely is illustrated in accordance with one or more embodiments.
[0008] Figure 6 A method for reducing the probability that data stored in a cache memory of a processor system is replaced prematurely is illustrated in accordance with one or more embodiments.
[0009] Figure 7 Illustrated is a simplified block diagram of an example computer system in accordance with one or more embodiments. DETAILED DESCRIPTION
[0010] In the following description, for the purpose of explanation, many examples and specific details are set forth in order to provide a comprehensive understanding of the present disclosure. These examples and details should not be interpreted as overly limiting the elements of the claims or the subject matter of the entire claims. For those skilled in the art, based on the language of different claims, the subject matter of the claims may include some or all of the features in these examples alone or in combination, and may further include modifications and equivalents of the features and techniques described herein.
[0011] Embodiments herein relate to data replacement in a cache memory of a computer system. Features disclosed herein reduce the likelihood that data stored in a cache memory of a processor system is replaced prematurely before the stored data is consumed. One or more embodiments herein disclose a retention state for a segment of a cache memory that implements data storage. The retention state is adjusted based on transactions between components of the computer system and the segment of the memory. Therefore, data stored in a segment of a cache memory can be prevented from being replaced prematurely by other data.
[0012] Figure 1 A computer system 100 is illustrated in accordance with one or more embodiments. Computer system 100 includes a processing unit 102 including a set of processor cores 104, a cache memory 106, and a controller 108 that controls data transactions involving cache memory 106. In some embodiments, processing unit 102 may be a system on a chip including additional components not shown. In some embodiments, the components shown as part of processing unit 100 are disaggregated silicon components located on the same socket or the same package. Computer system 100 may also include one or more hardware accelerators 110-1, 110-2, ... 110-N (collectively referred to as "accelerators 110"), one or more data sources 112, and a main memory 114.
[0013] Each core in the processor core set 104 is configured to process data independently of the other cores in the processor core set 104. The hardware accelerator 110 is a hardware module that is configured to offload, pre-process, decrypt, or perform other operations to improve the efficiency of the processor core set 104. In some embodiments, one or more of the hardware accelerators 110 are included in the processing unit 102—for example, one or more of the hardware accelerators 110 can be formed as part of the same manufacturing process that forms the processing unit 102. In some embodiments, one or more of the hardware accelerators 110 can be separate from the processing unit 102. One or more of the hardware accelerators 110 can be specifically configured (e.g., hardwired) to perform one or more acceleration processes. One or more of the hardware accelerators 110 can include software and / or firmware that, as a result of execution, causes one or more of the hardware accelerators 110 to perform as described herein. Hardware accelerator 110 is communicatively coupled to processing unit 102 and, in some embodiments, is configured to retrieve data from cache memory 106 and / or one or more data sources 112 .
[0014] As non-limiting examples, one or more data sources 112 may include a network interface controller (NIC), an input / output (I / O) device (e.g., a mouse, keyboard), a port, and / or a peripheral device. One or more data sources 112 may be an I / O device with or without inherent acceleration capabilities. As non-limiting examples, one or more data sources 112 may include a storage device including one or more types of non-volatile (e.g., read-only) memory, such as solid-state memory, a hard drive, an electrically erasable programmable read-only memory, and flash memory. Main memory 114 is an area of random access or volatile memory that is primarily accessible and visible to processing unit 102.
[0015] Figure 2 A first example flowchart 200 is illustrated in which components of computer system 100 manage cache memory according to one or more embodiments. Flowchart 200 includes data transactions involving one or more data sources 202, cache memory 204, one or more processor cores 206, and main memory 208. Main memory 208 may include data transactions involving Figure 11. The phrase "data transaction" as used herein refers to an operation in which data is produced to or from cache 204 or consumed from cache 204 by another entity. Production of data involves allocating data to memory, while consumption of data involves reading data from memory. Consumption of data involves a request by another component to read a line of cache 204. However, not all read operations are consumption operations associated with a particular replaceability attribute, as discussed above.
[0016] See also Figure 2 , data source 202 performs a write operation 210 (e.g., write 64B) in which data is produced to a row of cache 204. Processor core 206 issues a request 212 (e.g., read 64B) to read the row of cache 204 produced by data source 202 in write operation 210. Request 212 is a consume operation, which may include information identifying a specific row in cache 204 to be read. Cache 204 accesses information associated with the requested cache row and determines that the cache row is storing the allocated data (e.g., from write operation 210). As a result, cache 204 records a cache hit 213 and enables processor core 206 to perform a read operation 214, thereby producing data from the row of cache 204 to processor core 206.
[0017] After the read operation 214, the data source 202 performs a write operation 216, thereby generating data to be stored in the line of the cache 204. After a period of time in which the line of the cache 204 has not been read by another component, as determined by Figure 1 As a result of a cache replacement policy implemented by the controller 108, data stored in a line of the cache 204 may be evicted. A non-limiting example of such a cache replacement policy is a least recently used (LRU) policy, in which unused lines of the cache 204 are replaced with new data or marked as available for writing. For example, an eviction operation 218 may be performed, in which data stored in the cache line 204 is generated or written to the main memory 208 (e.g., RAM, ROM).
[0018] Thereafter, processor core 206 issues a request 220 to read or use the data stored in the row of cache 204 in which data source 202 wrote the data in write operation 216. Cache 204 determines that the data previously generated in write operation 216 is not available in the row of cache 204 and registers a cache miss 222. Cache 204 (e.g., via controller 108) issues a read operation 224 to main memory 208 to retrieve the data generated in write operation 216. Figure 2As shown in FIG. 2 , read operation 224 corresponds to the consume operation in flowchart 200 . In response to successfully obtaining the requested data from main memory 208 , read operation 226 is performed, in which processor core 206 reads the data from main memory 208 .
[0019] Reading data from main memory 208 involves using more time and computing resources than reading data from cache 204. The efficiency of cache allocations is significantly reduced as a result of cache miss 220 and subsequent read operations 224 and 226. In some scenarios, data stored in a line of cache 204 may be overwritten or corrupted, causing cache allocations to be invalid.
[0020] Figure 3 A second example flowchart 300 is illustrated in which components of computer system 100 manage cache memory according to one or more embodiments. The configuration of the computer system operating in flowchart 300 is different from the configuration of the computer system operating in flowchart 200. More specifically, the computer system of flowchart 300 is configured to implement a retention state for individual lines of cache memory. The data transactions of flowchart 300 involve one or more data sources 302, cache memory 304, one or more processor cores 306, and / or memory 308. Various features of flowchart 300 are substantially similar to those described in flowchart 200 and elsewhere herein, and therefore, further description thereof is omitted for brevity.
[0021] In flowchart 300, data source 302 performs a write operation 310 (e.g., write 64B) in which data is generated to a row of cache 304. As a result of performing write operation 310, a retention state update 312 of a retention state of the row of cache 304 is implemented. In retention state update 312, the retention state of the cache row is updated to a first level in which data stored in the row of cache 304 has an increased retention level or protection level to prevent overwriting or deletion of the contents of the data in the row of cache 304. For example, data associated with the row of cache 304 may indicate a retention level associated with the data stored in the row of cache 304. A cache memory controller (e.g., controller 108) may control data interactions with the row of cache 304 based on the level of retention.
[0022] The processor core 306 issues a request 314 (e.g., a read 64B) to read the line of the cache 304 generated by the data source 302 in the write operation 310. The request 314 is a consume operation, which may include information identifying a specific line in the cache 304 to be read. The cache 304 accesses information associated with the requested cache line and determines that the cache line is storing the allocated data (e.g., from the write operation 310). As a result of the consume operation, the cache 304 registers a cache hit 316 and implements a retention state update 318 on the retention state of the cache line. More specifically, the retention state update 318 is to reduce the retention level for the cache line to a second level, the second retention level being lower than the first retention level. The retention state update 318 may be performed by a controller of the cache memory 304 (such as the controller 108).
[0023] In response to the cache hit 318, the processor core 306 completes the read operation by receiving corresponding read data 320 from the row of the cache 304. After receiving the read data 320, the data source 302 performs a write operation 322, resulting in data to be stored in the row of the cache 304. In response to the write operation 322, a retention status update 324 is performed to update the retention status level of the row of the cache 304 to the first level, i.e., the increased retention level to prevent overwriting or deletion of the data stored in the cache line.
[0024] After a period of time in which another component has not read the line of cache 304, processor core 306 issues a request 326 (e.g., read 64B) to read the line of cache 304 generated by data source 302 in write operation 322. Request 326 is a consume operation, which may include information identifying a specific line in cache 304 to be read. Cache 304 accesses information associated with the requested cache line and determines that the cache line is storing the allocated data (e.g., from write operation 322). As a result of the consume operation, cache 304 records a cache hit 328, and cache 304 performs a retention state update 330 on the retention state of the cache line. Retention state update 330 is to reduce the retention level for the cache line to a second level, the second retention level being lower than the first retention level.
[0025] In response to the cache hit 328, the processor core 306 completes the read operation by receiving the corresponding read data 328 from the line of the cache 304. After receiving the read data 320, the processor core 306 issues a request 334 (e.g., read 64B) to read the line of the cache 304 generated by the data source 302 in the write operation 322. The request 334 is a consume operation, which may include information identifying the specific line to be read in the cache 304. The cache 304 accesses the information associated with the requested cache line and determines that the cache line is storing the allocated data (e.g., from the write operation 322).
[0026] As a result of the consumption operation, the cache 304 registers a cache hit 336 and performs a retention state update 338 on the retention state of the cache line. The retention state update 338 is further reduced to a third retention level for the cache line, the third retention level being lower than the second retention level. In some embodiments, the third level of retention is a retention level that designates data stored in the cache line as evicted or otherwise not isolated from deletion or overwriting. In some embodiments, there may be more than three retention levels, with each successive level of retention being lower than the previous level.
[0027] In some embodiments, the cache line with the third retention level is converted to a different cache replacement strategy. For example, the cache line can be included in a cache line set of the cache memory 304, and different cache replacement strategies are implemented for the cache line. Non-limiting examples of such cache replacement strategies include LRU, most recently used (MRU), least frequently used, last in first out (LIFO), and / or first in last out. In response to the cache hit 336, the processor core 306 completes the read operation by receiving the corresponding read data 320 from the row of the cache 304.
[0028] Figure 4 4 is a diagram illustrating a set of data transactions implemented in a computer system 400 according to one or more embodiments. The components of computer system 400 correspond to the components described with respect to computer system 100, and therefore further description thereof is omitted for the sake of brevity. The data transactions involved in computer system 400 include production operations and consumption operations, as described with respect to flowcharts 200 and 300. Although not shown, computer system 400 may include a main memory, such as with respect to Figure 1 Main memory 114 is discussed.
[0029] In FIG. 4 , a write operation 402 is performed in which a data source 404 generates data to a line of a cache memory 406 of a processing unit 408. A controller 414 of the processing unit 408 updates a retention state 410 of the cache line to a first retention level 412 in response to the write operation 402, as described with respect to FIG. Figure 3 The retention state 410 may correspond to a set of bits in a register of the processing unit 408 that defines a replacement policy to be applied to a region of the cache memory 406. In some embodiments, the controller 414 of the processing unit 408 may maintain the retention state 410 for individual lines of the cache memory 406. The execution of a generate operation (such as the write operation 402) may cause the controller 414 to set a defined state for the retention state 410. For example, the controller 414 may inject a defined value into the retention state 410 in response to a generate operation performed on a cache line.
[0030] Some consumption operations may not affect the retention state 410. Some data may include associated metadata for which the consumption operations may not affect the retention state 410. As a non-limiting example, a data packet transmitted over a network may include a header indicating, for example, a source address, a destination address, a data packet length, and a protocol identifier. The write operation 402 may include generating a network data packet to one or more rows of the cache memory 406. The processor core 416 may perform a read operation 418 to obtain or consume metadata associated with the network data packet. The read operation 418 may not affect the first retention level 412 of the retention state 410. The execution of subsequent data transactions associated with the computer system 400 may be based on the metadata processed by the processor core 416 via the read operation 418.
[0031] A read operation 420 is performed, wherein the data written in the write operation 402 is represented by Figure 1 The accelerator 422-2 of the set of accelerators 422-1, 422-2, ... 422-N described above is used. As a result of the read operation 420, the retention state 410 of the cache line is updated to a second retention level 424 that is lower than the first retention level 412. The accelerator 422-2 processes the data read in the read operation 420, such as by decrypting the data using an encryption key accessible to the accelerator 422-2 to produce decrypted data. A write operation 426 is performed, wherein the processed data is produced to a cache line of the cache memory 406. For the cache line storing the data produced in the write operation 426, the retention state 410 is updated to the first retention level 412. The read operation 420 and the write operation 426 can go to and from separate cache lines having different memory addresses, respectively.
[0032] A second core 428 of the processing unit 408 performs a read operation 430 that consumes data stored on a cache line of the cache memory 406. As a result of the read operation 430, the retention state 410 of the cache line is updated to the second retention level 424. Another read operation 432 is performed, wherein the data stored in the cache line is consumed by a memory 436 coupled to the processing unit 408. The read operation 432 causes the retention state 410 to be updated to a third retention level 434 that is lower than the second retention level 434. The controller 414 can then transition the cache line to a different cache replacement policy, such as the LRU policy described herein. The data source 404 can then perform a write operation 438 that produces data to the cache line and overwrites the data consumed in the read operations 430 and 432.
[0033] For the cache replacement policies described herein, cache lines of the cache memory 406 having the second retention level 424 as the retention state 410 may be isolated from data writes by other cache replacement policies (such as the LRU or MRU policies mentioned herein). If, for example, additional cache memory space is requested to satisfy a data write operation of another replacement policy, the data stored in the cache line having the second retention level 424 may be overwritten, evicted, or otherwise displaced.
[0034] The cache lines of the cache memory 406 having the first retention level 412 as the retention state 410 may be isolated from data writes on the cache lines having the second retention level 424. Therefore, if additional cache memory space is requested to satisfy a data write operation of another replacement policy and all cache memories having the second retention level 424 are already utilized, data stored in the cache lines having the first retention level 412 may be prevented from being displaced.
[0035] The cache line of the cache memory 406 having the third retention level 434 may be included in a set of cache lines that are not isolated according to the cache replacement process described herein. Data transactions involving such cache lines are implemented according to different cache replacement processes or policies (e.g., LRU, MRU, LIFO). As data is generated to the cache line, the retention state 410 of such cache line may be updated to the first retention level 412.
[0036] In some embodiments, there may be more than three retention levels. The controller 414 may update the retention state 410 of the cache line to the highest retention level (e.g., the first retention level 412) in response to detecting data generation of the cache line. For certain consumption operations (e.g., read operations) of the cache line, the controller 414 may lower or reduce the retention state 410 until the retention state 410 reaches the lowest retention level (e.g., the third retention level 434).
[0037] Figure 5 A method 500 for reducing the probability that data stored in a cache memory of a processor system is replaced prematurely is illustrated in accordance with one or more embodiments. The method 500 may be performed by one or more suitable entities described herein, such as a controller 108 of a computer system 100. The method 500 includes, at 502, detecting a first data generation operation for storing first data to a first cache line of a plurality of cache lines. In 502, the controller 108 may detect, for example, a write operation 402 performed by a data source 404 to a first cache line of a cache memory 406.
[0038] Method 500 also includes, at 504, updating the retention state of the first cache line to a first retention level as a result of the first data generation operation detected in 502. Updating the retention state of the first cache line to the first retention level in 504 may include setting a register of controller 414 to a defined value. For example, updating the retention state in 504 may include setting, by controller 414, a set of bits assigned to retention state 410 to a defined value, such as Figure 4 4. Indicated in FIG. 5 as a binary value "11" corresponding to the first retention level 412. The first retention level 412 is a high retention level in which the data generated in 502 and stored in the first cache line is preserved.
[0039] At 506, method 500 includes increasing protection for displacement of first data in a first cache line based on the update of the retention state to the first retention level. Increasing protection for displacement in 506 may include increasing protection against overwriting, evicting, deleting, or otherwise changing the contents of the first cache line. In some embodiments, increasing protection for displacement of the first data in 510 may include preventing displacement of the first data in the first cache line. As an example, controller 414 may receive a request to store second data obtained by data source 402. Controller 414 may observe that the first cache line has the first retention level 412 and exclude the first cache line from consideration as a candidate for storing the second data. Controller 414 may evict data from another cache line having a lower retention level, such as with respect to FIG. Figure 2In some embodiments, increasing protection for the displacement may include modifying a value or flag associated with the first cache line.
[0040] The method 500 further includes detecting a first data consumption operation for retrieving the first data from the first cache line at 508. The detection of the first data consumption operation at 508 may be performed at a time after the detection of the first data generation operation at 502. The detection of the first data consumption operation at 508 may correspond to detecting Figure 4 The consumption operation 420 or 430 in.
[0041] As a result of the first data consumption operation detected in 508, method 500 continues at 510 by updating the retention state of the first cache line to a second retention level. The second retention level is a lower retention level than the first retention level, such as Figure 4 424 or third retention level 434. Updating the retention state to the second retention level at 510 may include adjusting the value of the retention state 410 (e.g., a register of the processing unit 408) by a defined amount. For example, the controller 414 may reduce the value of the first retention level 412 by a defined amount (such as 1) to achieve the second retention level 424 having a binary value of "01".
[0042] In some embodiments, updating the retention state in 510 may include moving the first data from the first LRU queue to the second LRU queue. For example, at a first time after detecting the first data consumption operation in 508, the first data may be moved from a dedicated LRU for data that has been written but not read to the top of another LRU queue. Then, at a second time after the first time, the retention state of the first cache line is updated to a second retention level. In such an embodiment, at 510 and during an intermediate period between the first time and the second time, the retention state of the first data in the first cache line may be temporarily different from the second protection level.
[0043] The method 500 may include, at 512, permitting displacement of the first data stored on the first cache line based on the second retention level. The permitting in 512 may include implementing a different cache replacement policy for the first cache line based on the second retention level. The different cache replacement policy may be an LRU cache replacement policy or other such policies discussed herein or known to those skilled in the art.
[0044] Figure 6A method 600 for reducing the probability that data stored in a cache memory of a processor system is replaced prematurely is illustrated according to one or more embodiments. The method 600 may be performed by one or more suitable entities described herein, such as the controller 108 of the computer system 100. The method 600 may be performed after the method 500 or as part of the method 500.
[0045] The method 600 includes, at 602, detecting a second data consumption operation for retrieving first data from a first cache line. In some embodiments, detecting the second data consumption operation in 602 is performed before permitting displacement of the first data stored on the first cache line in 512. For example, the detection for the second data consumption in 602 may be performed after updating the retention state in 510 and before permitting displacement of the first data in 512. As another example, the detection for the second data consumption in 602 may be performed after adding protection for displacement in 506 but before detecting the first data consumption operation in 508.
[0046] The method 600 also includes, at 604, updating the retention state to a third retention level that is lower than the second retention level as a result of the second data consumption operation detected in 602. Updating the retention state in 604 may include adjusting a value of the retention state 410 (e.g., a register of the processing unit 408) by a defined amount. For example, the controller 414 may reduce the value of the second retention level 424 by a defined amount (e.g., 1) to achieve a third retention level 434 having a binary value of "00".
[0047] The method 600 also includes, at 606, receiving a request to store second data. The controller 414 may receive the request by another entity in the computer system 400, such as the data source 402, an accelerator in the accelerator 422, or a core in the plurality of cores in the processing unit 408. The method 600 includes, at 608, permitting a second data generation operation for storing the received second data to the first cache line. As a result of the third retention level 434 of the first cache line of the cache memory 406, the controller 414 may permit the second data generation operation. As a result of the second data generation operation, the method 600 continues at 610 to update the retention state of the first cache line to the first retention level. More specifically, the controller 414 updates the retention state 410 of the first cache line to a defined value, such as a value corresponding to Figure 4 The first retention level 412 in is a binary value of "10".
[0048] Example Computer System
[0049] Figure 7A simplified block diagram of an example computer system 700 according to some embodiments is depicted. The computer system 700 may be used to implement any computing device, system, or server described in the foregoing disclosure. Figure 7 As shown in FIG, computer system 700 includes one or more processors 702 that communicate with a number of peripheral devices via an interconnect subsystem 704. These peripheral devices include a storage subsystem 706 (including a memory subsystem 708 and a file storage subsystem 170), a user interface input device 712, a user interface output device 714, and a network interface subsystem 716.
[0050] The interconnect subsystem 704 may provide a mechanism for the various components and subsystems of the computer system 700 to communicate with each other as intended. Although the interconnect subsystem 704 is schematically shown as a single bus, alternative embodiments of the bus subsystem may use multiple busses.
[0051] The network interface subsystem 716 may be used as an interface for transferring data between the computer system 700 and other computer systems or networks. Embodiments of the network interface subsystem 716 may include, for example, an Ethernet card, a Wi-Fi and / or cellular adapter, a modem (telephone, satellite, cable, ISDN, etc.), a digital subscriber line (DSL) unit, and the like.
[0052] The user interface input devices 712 may include keyboards, pointing devices (e.g., mice, trackballs, touch pads, etc.), touch screens incorporated into displays, audio input devices (e.g., voice recognition systems, microphones, etc.), and other types of input devices. In general, the use of the term "input device" is intended to include all possible types of devices and mechanisms for inputting information into the computer system 700.
[0053] The user interface output device 714 may include a display subsystem, a printer, or a non-visual display (such as an audio output device, etc.). The display subsystem may be, for example, a flat panel device such as a liquid crystal display (LCD) or an organic light emitting diode (OLED) display. In general, the use of the term "output device" is intended to include all possible types of devices and mechanisms for outputting information from the computer system 700.
[0054] Storage subsystem 706 includes memory subsystem 708 and file / disk storage subsystem 710. Subsystems 718 and 720 represent non-transitory computer-readable storage media that may store program code and / or data that provide the functionality of embodiments of the present disclosure.
[0055] The memory subsystem 708 includes several memories, including a primary random access memory (RAM) 718 for storing instructions and data during program execution and a read-only memory (ROM) 720 for storing fixed instructions. The file storage subsystem 710 can provide persistent (i.e., non-volatile) storage for program and data files, and can include a magnetic or solid-state hard drive, an optical drive and associated removable media (e.g., CD-ROM, DVD, Blu-ray, etc.), a removable flash drive or card, and / or other types of storage media known in the art. The processor(s) 702 include a cache memory 722 communicatively coupled to the processor core(s) 702.
[0056] It should be appreciated that computer system 700 is illustrative and that many other configurations having more or fewer components than system 700 are possible.
[0057] Other embodiments
[0058] Embodiments of the present disclosure include a processing unit including a cache memory including a plurality of cache lines. A controller also includes a controller coupled to the cache memory and configured to detect a first data generation operation for storing first data in a first cache line of the plurality of cache lines at a first time; update a retention state of the first cache line to a first retention level as a result of the first data generation operation; increase protection against displacement of the first data in the first cache line or prevent displacement of the first data in the first cache line based on the first retention level; detect a first data consumption operation for retrieving the first data from the first cache line at a second time after the first time; and update a retention state of the first cache line to a second retention level as a result of the first data consumption operation, the second retention level being a retention level lower than the first retention level.
[0059] In some embodiments, the controller is configured to permit displacement of first data stored on the first cache line based on the second retention level. In some embodiments, the controller is configured to detect a second data consumption operation to retrieve the first data from the first cache line at a third time after the second time; and as a result of the second data consumption operation, update the retention state of the first cache line to a third retention level lower than the second retention level. In some embodiments, the controller is configured to implement different cache replacement policies for the first cache line based on the second retention level.
[0060] In some embodiments, updating the retention state to a first retention level includes setting a register of the processing unit to a defined value, and updating the retention state to a second retention level includes adjusting the value in the register by a defined amount. In some embodiments, the controller is configured to detect a second data generation operation for storing second data to the first cache line at a third time after the second time; and as a result of the second data generation operation, update the retention state of the first cache line to the first retention level. In some embodiments, the controller is configured to receive a request for storing second data at a third time after the first time and before the second time; as a result of the first retention level of the first cache line, grant a second data generation operation for storing the second data to a second cache line in the plurality of cache lines; and as a result of the second data generation operation, update the retention state of the second cache line to the first retention level.
[0061] An embodiment of the present disclosure includes a method, including detecting a first data generation operation for storing first data to a first cache line of a processing unit at a first time; updating a retention state of the first cache line to a first retention level as a result of the first data generation operation; adding protection for displacement of the first data in the first cache line or preventing displacement of the first data in the first cache line based on the first retention level; detecting a first data consumption operation for retrieving the first data from the first cache line at a second time after the first time; and updating the retention state of the first cache line to a second retention level as a result of the first data consumption operation, the second retention level being a retention level lower than the first retention level.
[0062] In some embodiments, the method includes permitting displacement of first data stored on a first cache line based on a second retention level. In some embodiments, the method includes detecting a second data consumption operation to retrieve the first data from the first cache line at a third time after the second time; and updating a retention state of the first cache line to a third retention level lower than the second retention level. In some embodiments, the method includes implementing a different cache replacement strategy for the first cache line based on the second retention level. In some embodiments, updating the retention state to the first retention level includes setting a register of the processing unit to a defined value, and updating the retention state to the second retention level includes adjusting the value in the register by a defined amount.
[0063] In some embodiments, the method includes detecting a second data generation operation for storing the second data to the first cache line at a third time after the second time; and updating the retention state of the first cache line to a first retention level as a result of the second data generation operation. In some embodiments, the method includes receiving a request for storing the second data at a third time after the first time and before the second time; granting a second data generation operation for storing the second data to a second cache line among the plurality of cache lines based on the first retention level of the first cache line; and updating the retention state of the second cache line to the first retention level as a result of the second data generation operation.
[0064] An embodiment of the present disclosure includes a computer system, the computer system including a processing unit, the processing unit including a processor core, a cache memory, and a controller. The computer system also includes a data source communicatively coupled to the processing unit, the controller being configured to detect a first data generation operation for storing first data provided by the data source to a first cache line of the cache memory at a first time; as a result of the first data generation operation, update the retention state of the first cache line to a first retention level; based on the first retention level, increase protection for displacement of the first data in the first cache line or prevent displacement of the first data in the first cache line; detect a first data consumption operation to retrieve the first data from the first cache line at a second time after the first time; and as a result of the first data consumption operation, update the retention state of the first cache line to a second retention level, the second retention level being a retention level lower than the first retention level.
[0065] In some embodiments, the controller is configured to detect a second data consumption operation involving first data stored on the first cache line at a third time after the first time and before the second time; and as a result of the second data consumption operation, maintain the first retention level of the first cache line. In some embodiments, the second data consumption operation involves a read operation of metadata of the first data. In some embodiments, the controller is configured to detect a second data consumption operation of the first processor core reading the first data from the first cache line at a third time after the second time; and as a result of the second data consumption operation, update the retention state of the first cache line to a third retention level lower than the second retention level.
[0066] In some embodiments, the controller is configured to permit displacement of first data stored on the first cache line based on the second retention level. In some embodiments, the controller is configured to receive a request to store second data at a third time after the first time and before the second time; permit a second data generation operation for storing the second data in a second cache line among the plurality of cache lines as a result of the first retention level of the first cache line; and update a retention state of the second cache line to the first retention level as a result of the second data generation operation.
[0067] The above description illustrates various embodiments of the present disclosure and examples of how aspects of these embodiments are implemented. The above examples and embodiments should not be considered to be the only embodiments, and are presented to illustrate the flexibility and advantages of the present disclosure, as defined by the following claims. For example, although certain embodiments have been described with respect to specific processes and steps, it should be understood by those skilled in the art that the scope of the present disclosure is not strictly limited to the described processes and steps. Steps described sequentially may be performed in parallel, the order of the steps may be changed, and the steps may be modified, combined, added, or omitted. As another example, although certain embodiments have been described using a specific combination of hardware and software, it should be recognized that other combinations of hardware and software are possible, and specific operations described as being implemented in software may also be implemented in hardware, and vice versa.
[0068] Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense.Other arrangements, embodiments, implementations and equivalents will be apparent to those skilled in the art and may be employed without departing from the spirit and scope of the present disclosure as set forth in the following claims.
Claims
1. A processing unit, comprising: a cache memory, the cache memory comprising a plurality of cache lines; as well as a controller coupled to the cache memory and configured to: detecting, at a first time, a first data generation operation for storing first data in a first cache line of the plurality of cache lines; updating a retention state of the first cache line to a first retention level as a result of the first data generation operation; adding protection for displacement of the first data in the first cache line based on the first retention level; At a second time after the first time, detecting a first data consuming operation to retrieve the first data from the first cache line; and As a result of the first data consumption operation, the retention state of the first cache line is updated to a second retention level, the second retention level being a lower retention level than the first retention level, thereby increasing protection against premature displacement of data stored in the cache memory.
2. The processing unit according to claim 1, wherein the controller is configured to: Based on the second retention level, displacement of the first data stored on the first cache line is permitted.
3. The processing unit according to claim 1, wherein the controller is configured to: At a third time after the second time, detecting a second data consuming operation to retrieve the first data from the first cache line; and As a result of the second data consumption operation, the retention state of the first cache line is updated to a third retention level different from the second retention level.
4. The processing unit according to claim 1, wherein the controller is configured to: A different cache replacement policy is implemented for the first cache line based on the second retention level.
5. The processing unit of claim 1 , wherein updating the retention state to the first retention level comprises setting a register of the processing unit to a defined value, and updating the retention state to the second retention level comprises adjusting the value in the register by a defined amount.
6. The processing unit according to claim 5, wherein the controller is configured to: detecting, at a third time after the second time, a second data generation operation for storing second data in the first cache line; and As a result of the second data generation operation, the retention state of the first cache line is updated to the first retention level.
7. The processing unit according to claim 1, wherein the controller is configured to: receiving a request to store second data at a third time after the first time and before the second time; granting a second data generation operation for storing the second data in a second cache line of the plurality of cache lines as a result of the first retention level of the first cache line; as well as As a result of the second data generation operation, the retention state of the second cache line is updated to the first retention level.
8. A method comprising: detecting, at a first time, a first data generation operation for storing first data to a first cache line of a processing unit; updating a retention state of the first cache line to a first retention level as a result of the first data generation operation; adding protection for displacement of the first data in the first cache line based on the first retention level; At a second time after the first time, detecting a first data consuming operation to retrieve the first data from the first cache line; and As a result of the first data consumption operation, the retention state of the first cache line is updated to a second retention level, the second retention level being a lower retention level than the first retention level, thereby increasing protection against premature displacement of data stored in the cache memory.
9. The method according to claim 8, comprising: Based on the second retention level, displacement of the first data stored on the first cache line is permitted.
10. The method according to claim 8, comprising: detecting, at a third time after the second time, a second data consumption operation of retrieving the first data from the first cache line; as well as The retention state of the first cache line is updated to a third retention level different from the second retention level. The method of claim 10 , wherein the third retention level is lower than the second retention level.
12. The method of claim 8, wherein updating the retention state to the first retention level comprises setting a register of the processing unit to a defined value, and updating the retention state to the second retention level comprises adjusting the value in the register by a defined amount.
13. The method according to claim 8, comprising: detecting, at a third time after the second time, a second data generation operation for storing second data in the first cache line; as well as As a result of the second data generation operation, the retention state of the first cache line is updated to the first retention level.
14. The method according to claim 8, comprising: receiving, at a third time after the first time and before the second time, a request to store second data; granting, based on the first retention level of the first cache line, a second data generation operation for storing the second data in a second cache line of the plurality of cache lines; as well as As a result of the second data generation operation, the retention state of the second cache line is updated to the first retention level.
15. A computer system comprising: a processing unit, the processing unit comprising a processor core, a cache memory and a controller; as well as a data source communicatively coupled to the processing unit, the controller being configured to: detecting, at a first time, a first data generation operation for storing first data provided by the data source in a first cache line of the cache memory; updating a retention state of the first cache line to a first retention level as a result of the first data generation operation; adding protection for displacement of the first data in the first cache line based on the first retention level; At a second time after the first time, detecting a first data consuming operation to retrieve the first data from the first cache line; and As a result of the first data consumption operation, the retention state of the first cache line is updated to a second retention level, the second retention level being a lower retention level than the first retention level.
