Marshaled Data Coherency
Patent Information
- Application Number
- JP2024529818
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-11-30
- Filing Date
- 2022-11-07
- Publication Date
- 2025-10-16
AI Technical Summary
Existing cache coherency techniques fail to synchronize the updating of data and associated metadata in computing devices, leading to potential cache coherency issues when multiple clients attempt to operate on the same region of interest simultaneously.
A method and system for cache coherency that involves a first client cache system detecting metadata elements, writing cache lines containing metadata and associated data elements, invalidating these elements, and completing read requests by ensuring the second client cache system receives the metadata and data elements, thereby synchronizing their updates.
This approach ensures efficient and synchronized updating of data and metadata across client cache systems, preventing cache coherency issues and optimizing processing by anticipating associated data needs.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] 2. Description of Related Art
[0001] A computing device may include multiple subsystems, cores, or other components. Such a computing device may be, for example, a portable computing device ("PCD") such as a laptop or palmtop computer, a cellular telephone or smartphone, a portable digital assistant, a portable game console, etc.
[0002]
[0002] Multiple subsystems, cores, or other components of a computing device may be included within the same integrated circuit chip or on different chips. A "system on a chip" or "SoC" is an example of one such chip that integrates multiple components to provide system-level functionality. For example, an SoC may include one or more types of processors, such as central processing units ("CPUs"), graphics processing units ("GPUs"), digital signal processors ("DSPs"), and neural processing units ("NPUs"). An SoC may include other processing subsystems, such as a transceiver or "modem" subsystem that provides wireless connectivity.
[0003]
[0003] A computing device may include resources that are shared among SoC processors or other processing subsystems. For example, the processors may share access to a main memory or system memory of the computing device. The processors may also be associated with a local cache memory.
[0004]
[0004] "Cache coherency" is the property that copies of the same (or "shared") data in local cache memories associated with various processors have the same value, i.e., are identical. Techniques and protocols may be provided to promote or enforce cache coherency. In a cache coherency technique called snooping, a snoop controller or cache coherency controller monitors bus transactions initiated by the processors and updates the local cache memories accordingly.
[0005]
[0005] Some types of data have associated metadata. For example, metadata associated with compressed data may include information about the compression ratio, the location of the data, etc. To decompress the data, the processor may first need to obtain the associated metadata. Conventional cache coherency techniques may treat data and metadata as disjoint. That is, whether a cache line in a local cache memory contains data or metadata may be irrelevant or transparent to conventional cache coherency techniques. Improved cache coherency techniques may be needed to help ensure that data and associated metadata continue to be updated in sync with each other. Summary of the Invention
[0006]
[0006] Systems, methods, computer-readable media, and other examples are disclosed for providing cache coherency in a computing device.
[0007]
[0007] An exemplary method for providing cache coherency may include requesting that a second client cache system read a data element having an associated metadata element. The exemplary method may also include locating the metadata element in the first client cache system in response to the read request. The exemplary method may further include the first client cache system writing one or more cache lines including the metadata element and all data elements associated with the metadata element. The exemplary method may further include the first client cache system invalidating the metadata element in the first client cache system. The exemplary method may further include the second client cache system completing or fulfilling the read request, which may include receiving the metadata element and all data elements associated with the metadata element.
[0008]
[0008] An exemplary system for providing cache coherency may include a first client cache system and a second client cache system. The second client cache system may be configured to provide a read request to read a data element having an associated metadata element. The second client cache system may be further configured to detect the metadata element in the first client cache system in response to the read request. The first client cache system may be configured to write one or more cache lines including the metadata element and all data elements associated with the metadata element. The first client cache system may be further configured to invalidate the metadata element in the first client cache system. The second client cache system may be further configured to complete or fulfill the read request by being configured to receive the metadata element and all data elements associated with the metadata element.
[0009] Another exemplary system for providing cache coherency may include a means for requesting to read a data element having an associated metadata element. The exemplary system may also include a means for locating the metadata element in a first client cache system in response to the read request. The exemplary system may further include a means for writing one or more cache lines including the metadata element and all data elements associated with the metadata element. The exemplary system may still further include a means for invalidating the metadata element in the first client cache system. The exemplary system may still further include a means for completing or fulfilling the read request including a means for receiving the metadata element and all data elements associated with the metadata element in a second client cache system.
[0010]
[0010] An exemplary computer-readable medium for providing cache coherency may comprise a non-transitory computer-readable medium having instructions stored thereon in a computer-executable form. The instructions, when executed by a processing system of a computing device, may configure the processing system to: control a request to read a data element having an associated metadata element by a second client cache system; The instructions may also configure the processing system to find the metadata element in the first client cache system in response to a read request; The instructions may further configure the processing system to control a write by the first client cache system of one or more cache lines including the metadata element and all data elements associated with the metadata element; The instructions may still further configure the processing system to control an invalidation of the metadata element in the first client cache system by the first client cache system; The instructions may still further configure the processing system to control completion or fulfillment of a read request, which may include the second client cache system receiving the metadata element and all data elements associated with the metadata element. [Brief description of the drawings]
[0011]
[0011] In the figures, similar reference numbers refer to similar parts throughout the various figures unless otherwise indicated. In the case of a reference number accompanied by a letter designation such as "102A" or "102B", the letter designation may distinguish between two similar parts or elements present in the same figure. When the reference number is intended to encompass all parts having the same reference number in all figures, the letter designation for the reference number may be omitted. [Figure 1]
[0012] 1 is a block diagram illustrating a system for providing cache coherency in accordance with an illustrative embodiment. [Diagram 2]
[0013] FIG. 2 illustrates an example of a region of interest in compressed image data, including data and associated metadata, according to an example embodiment. [Diagram 3]
[0014] FIG. 2 is a functional block diagram illustrating an example of the operation of a system for providing cache coherency in accordance with an illustrative embodiment. [Figure 4]
[0015] 4 is a diagram similar to FIG. 3 and showing actions in an example of operation of the system of FIG. 3. [Diagram 5]
[0016] 5 is similar to FIGS. 3-4 and shows a further action in the example operation of the system of FIGS. 3-4. FIG. [Figure 6]
[0017] 6 is similar to FIGS. 3-5 and illustrates yet a further action in the exemplary operation of the system of FIGS. 3-5. FIG. [Figure 7]
[0018] 1 is a flow diagram illustrating a method for providing cache coherency in accordance with an example embodiment. [Figure 8]
[0019] FIG. 4 is a functional block diagram illustrating another example of the operation of a system for providing cache coherency in accordance with an illustrative embodiment. [Figure 9]
[0020] 8 and shows actions in an example of operation of the system of FIG. [Figure 10]
[0021] 8-9 and shows further actions in the example operation of the system of FIGS. 8-9. FIG. [Figure 11]
[0022] 4 is a flow diagram illustrating another method for providing cache coherency in accordance with an example embodiment. [Figure 12]
[0023] FIG. 4 is a functional block diagram illustrating another example of the operation of a system for providing cache coherency in accordance with an illustrative embodiment. [Figure 13]
[0024] 13 is a diagram similar to FIG. 12 and showing actions in an example of operation of the system of FIG. 8. [Figure 14]
[0025] 14 is similar to FIGS. 12-13 and shows a further action in the example operation of the system of FIGS. 12-13. FIG. [Figure 15]
[0026] FIG. 4 is a flow diagram illustrating yet another method for providing cache coherency in accordance with an illustrative embodiment. [Figure 16]
[0027] FIG. 4 is a functional block diagram illustrating yet another example of the operation of a system for providing cache coherency in accordance with an illustrative embodiment. [Figure 17]
[0028] 16, and is a diagram showing actions in an example of operation of the system of FIG. 16. FIG. [Figure 18]
[0029] 16-17, but showing further actions in the operational example of the system of FIGS. 16-17. FIG. [Figure 19]
[0030] 16-18, and shows further actions in the operational example of the system of FIGS. 16-18. FIG. [Figure 20]
[0031] 16 to 19, and shows further actions in the operational example of the system of FIGS. 16 to 19. FIG. [Figure 21]
[0032] 16-20 and shows further actions in the operational example of the system of FIGS. 16-20. FIG. [Figure 22]
[0033] 16 to 21 and shows further actions in the operational example of the system of FIGS. 16 to 21. FIG. [Diagram 23]
[0034] 16-22 and shows further actions in the operational example of the system of FIGS. 16-22. FIG. [Figure 24]
[0035] FIG. 4 is a flow diagram illustrating yet another method for providing cache coherency in accordance with an illustrative embodiment. [Diagram 25]
[0036] 15 is a functional block diagram similar to FIGS. 12-14 illustrating operation in a system for providing cache coherency according to an exemplary embodiment. FIG. [Figure 26]
[0037] FIG. 1 is a block diagram of a computing device in accordance with an exemplary embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0012]
[0038] The word "exemplary" is used herein to mean "serving as an example, instance, or illustration." The word "illustrative" may be used herein as a synonym for "exemplary." Any aspect described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other aspects.
[0013]
[0039] The term "marshaled data" may refer to a type of data where there is an association between data elements that does not change based on processing. One example of marshaled data is data with metadata. Each data element is associated with a metadata element. One example of metadata is information associated with compressed data about compression ratio, location of data, etc. To decompress a data element, a decompression algorithm may require a metadata element associated with the data element. For example, to decompress data element "A", the decompression algorithm may use the value of data element A and the value of metadata element "X" as its inputs. The values of A and X may change as a result of processing, but A and X remain associated with each other as data and metadata elements, regardless of such changes in their values. Another example of metadata is error correction information associated with error protected data. Yet other examples of data that may have associated metadata are encrypted data and tagged data. Although the exemplary embodiment for providing cache coherency described below uses compressed data as an example of data with associated metadata, the solutions described herein may provide cache coherency using any other type of data with associated metadata.
[0014]
[0040] 1, the system 100 may include a first client 102 and a second client 104. Although two clients 102 and 104 are shown in the exemplary system 100, in other examples, there may be more than two clients, and the solutions described herein may be applied to such additional clients in the manner described with respect to the exemplary clients 102 and 104. Each client 102 and 104 may comprise a processor, processing system, or portion thereof, such as a core (not shown in FIG. 1), as configured by, for example, executing software or firmware.
[0015]
[0041] A first client cache system 106 may be coupled to or otherwise associated with the first client 102. The first client cache system 106 may include a first cache controller 108 and a first cache storage 110 (i.e., memory). The first client cache system 106 may be configured to operate as a local cache for the first client 102. Similarly, a second client cache system 112 may be coupled to or otherwise associated with the second client 104. The second client cache system 112 may include a second cache controller 114 and a second cache storage 116 (i.e., memory). The second client cache system 112 may be configured to operate as a local cache for the second client 104. The first cache storage 110 and the second cache storage 116 may comprise any type of memory, such as, for example, static random access memory ("SRAM"), flash memory, etc. While some operations performed by the first client cache system 106 and the second client cache system 112 may be autonomous, more typically the first client cache system 106 and the second client cache system 112 operate under the control of the respective clients 102 and 104. Nevertheless, for simplicity, the operation of the system 100 may be described below with respect to actions performed by the first client cache system 106 and the second client cache system 112.
[0016]
[0042] In the illustrated example, the first client 102 and the second client 104 are clients of the system memory 118. That is, the first client 102 and the second client 104 are configured to access the system memory 118. The system memory controller 120 may control access to (i.e., reading from and writing to) the system memory 118 in response to memory access requests, such as read requests and write requests. The system memory 118 may comprise any type of memory, such as, for example, dynamic random access memory ("DRAM"). The DRAM may be, for example, double data rate synchronous DRAM or "DDR-SDRAM" (sometimes simply referred to as "DDR"). Although such read and write requests may occur through operation of the first client 102 and the second client 104, for simplicity in the following operational description, the read and write requests may be described as being provided by the first client cache system 106 and the second client cache system 112.
[0017]
[0043] The data interconnect 122 may be configured to provide data communication between the first client 102, the second client 104, and the system memory 118 (through the system memory controller 120). The data interconnect 122 may be configured to route signals representing bus transactions, such as read and write requests, between the aforementioned elements. In the examples described herein, a system memory, such as DDR, may serve as intermediate storage shared by the first and second clients, although in other examples, such intermediate or shared storage may be a system level cache or any other type of storage shared by the clients. For purposes of this disclosure, the term "system memory" includes within its meaning all such shared storage.
[0018]
[0044] The system 100 may also include a cache coherency controller 124, which may also be referred to as a snoop controller or snoop filter. As will be appreciated by those skilled in the art, snooping is a technique in which a controller monitors bus transactions for addresses representing data cached or stored in a local cache memory and updates information in the local cache memory to provide coherency between the local cache memories. When a value of a shared data element is changed (e.g., by a processor), the snoop controller may propagate the change to other local cache memories that have (or "share") a copy of the data element. In the example shown in FIG. 1, the cache coherency controller 124 may be configured to perform such snooping on the interconnect 122 and to update information in the first cache storage 110 and the second cache storage 116. Except as described below, the cache coherency controller 124 may be configured to perform such snooping and updating in a conventional manner. For example, except as described below, the cache coherency controller 124 may be configured to implement a conventional cache coherency protocol, as will be appreciated by those skilled in the art. One example of such a cache coherency protocol is known as MESI, with respect to tagging cache lines with tags that indicate one of four states: Modified, Exclusive, Shared, and Invalid. Other cache coherency protocols are also known, such as MSI (Modified, Shared, Invalid) and MOESI (Modified, Owned, Exclusive, Shared, Invalid). The manner in which a snoop controller or cache coherency controller may be configured to implement such cache coherency protocols is well understood by those skilled in the art, and therefore such aspects of the cache coherency controller 124 will not be described herein.
[0019]
[0045] The first cache controller 108 and the second cache controller 114 may also include some cache coherency or snooping logic. Some cache coherency functions described below may be controlled in part by such logic in the first cache controller 108 and the second cache controller 114, rather than by the cache coherency controller 124 alone. For example, the first cache controller 108, with the assistance of the cache coherency controller 124, may be configured to determine whether a data or metadata element is present in the second cache storage 116. Similarly, the second cache controller 114, with the assistance of the cache coherency controller 124, may be configured to determine whether a data or metadata element is present in the first cache storage 110.
[0020]
[0046] As shown in FIG. 2, an image (e.g., an array of pixels stored in a compressed format) 200 may include compressed image data 202 and associated metadata 204 related to the compression. Either the first client 102 or the second client 104 (FIG. 1) may operate on (e.g., read data from, process data, and write resulting data back to) a region of the image, which may be referred to as a region of interest ("ROI"). The ROI may be represented by an ROI data portion 206 or data element of the compressed image data 202 and an associated ROI metadata portion 208 or metadata element of the metadata 204. In the examples described below, the ROI data portions 206 or data elements may be referred to as A, B, C, D, etc. Similarly, the ROI metadata portions 208 or metadata elements may be referred to as X, Y, etc. The term "tile" may be used to refer to a group of one or more ROIs. A single metadata element may be associated with any number of data elements. For example, in a tile consisting of data elements A and B, metadata element X may be associated with data element A and associated with data element B. Similarly, in another tile consisting of data elements C and D, metadata element Y may be associated with data elements A and B.
[0021]
[0047] To act on a tile, and in particular to decompress the tile, a client 102 or 104 (FIG. 1) may first need to read one or more associated metadata elements. The client 102 or 104 can then read the tile's data elements and use the obtained metadata elements to decompress the tile. In general, it is not possible to simultaneously read a tile's data elements and its associated metadata elements, or to simultaneously write a tile's data elements and its associated metadata elements. As a result of this asynchronicity, various operational scenarios in which a first client 102 and a second client 104 attempt to act on the same ROI simultaneously may cause potential cache coherency problems. Exemplary methods, systems, computer-readable media, and other embodiments for providing cache coherency described below can address such potential cache coherency problems.
[0022]
[0048] In FIG. 3, a system 300 similar to the system 100 (FIG. 1) described above is shown in more conceptual or functional block diagram form for clarity. Some elements of the system 300 similar to those described above with respect to the system 100 (FIG. 1) are not shown in FIG. 3 for clarity in describing the operation of the system 300. The first client cache system 302 and the second client cache system 304 can operate in the manner described above with respect to the first client cache system 102 and the second client cache system 104 (FIG. 1). Under control of corresponding first and second clients (not shown in FIG. 3), each of the first and second client cache systems 302 and 304 can issue read requests to read data elements and metadata elements from the system memory 306 and write requests to write data elements and metadata elements to the system memory 306. Although not shown in FIG. 3 for clarity, a system memory controller can be coupled to the system memory 306 and provide control functions as described above with respect to the system memory controller 120 (FIG. 1). Also, although not shown in FIG. 3 for clarity, a snoop controller or cache coherency controller may be included and configured to monitor bus transactions and function in other manners as described above with respect to cache coherency controller 124 (FIG. 1).
[0023]
[0049] The first client cache system 302 may include a first cache storage 312. The data elements may be conceptually illustrated as being stored in a data area 308 of the first cache storage 312, and the metadata elements may be conceptually illustrated as being stored in a metadata area 310 of the first cache storage 312. Nevertheless, it should be understood that the data area 308 and the metadata area 310 may not be physically separate, i.e., they may be the same physical cache memory. For example, the data and metadata elements may be stored in various locations within the first cache storage 312, and whether they are data or metadata may be tracked or indicated by the storage location address, by a tag or other stored indicator (not shown), or in any other manner. For example, a particular address range may indicate data, while a different address range may indicate metadata. Similarly, the second client cache system 304 may include a second cache storage 318. The data elements may be conceptually shown as being stored in a data area 314 of the second cache storage 318, and the metadata elements may be conceptually shown as being stored in a metadata area 317 of the second cache storage 318.
[0024]
[0050] The first cache storage 312 and the second cache storage 318 may be organized into cachelines. Cache coherency logic (not shown separately) of the first client cache system 302 and the second client cache system 304 may track which cachelines contain data and which contain metadata, and the associations between data elements and metadata elements.
[0025]
[0051] An example of the operation of the system 300 will be described with reference to Figures 3-6. As shown in Figure 3, data elements A, B, C, and D, and metadata elements X and Y may be stored or reside in the first client cache system 302 as a result of various processes occurring under the control of a first client (not shown). That is, in this example, the state in which data elements A, B, C, and D, and metadata elements X and Y reside in the first client cache system 302 represents an initial state. The processes may be of any type, such as, for example, processing an image in the form of compressed pixel data as described above with respect to Figure 2. Such processes may also be referred to herein for convenience as "acting on" the ROI. For example, under the control of the first client (not shown), the first client cache system 302 may read data elements A, B, C, and D, and metadata elements X and Y from the system memory 306. Note that in the illustrated example (FIG. 3), data elements A, B, C, and D are each stored in a separate cache line, while metadata elements X and Y are stored in the same cache line as one another. In the illustrated example, metadata element X is associated with data elements A and B, which may form tile 320. Similarly, metadata element Y is associated with data elements C and D, which may form tile 322. In the examples shown herein, the associations between data elements and metadata elements are indicated by dashed or broken lines between the associated elements.
[0026]
[0052] In the illustrated example (FIGS. 3-6), a second client (not shown) may attempt to act on an ROI on which a first client (not shown) is acting. The solution described throughout this example addresses potential coherency issues that may otherwise result from two clients attempting to act on the same ROI simultaneously. For brevity in the following examples, actions performed by the first client cache system 302 or the second client cache system 304 under control of the respective or corresponding client may be described without reference to the underlying client. Thus, the first action in the illustrated example may be the second client cache system 304 providing or issuing a read request for data element A.
[0027]
[0053] Although not shown for clarity, a read request for data element A may include a prior request for associated metadata element X (or for a cache line containing metadata element X) that the second client may need to perform decompression. The data elements may be stored or reside in the system memory 306 in compressed form, or in uncompressed form in the first client cache system 302 and the second client cache system 304. Memory controllers (not shown separately in FIG. 3) may be configured to work together to fulfill read requests from the second client cache system 304. Such memory controllers may be similar to the system memory controller 120, the first cache controller 108, and the second cache controller 114 described above (FIG. 1). The read request is completed or fulfilled when the requested data is returned to the requesting client cache system.
[0028]
[0054] Cache coherency logic, some of which may be within the first client cache system 302, the second client cache system 304, and / or a separate cache coherency or snoop controller (not shown in FIG. 3), may respond to a read request for metadata element X. For example, the cache coherency or snoop controller may detect a bus transaction related to the read request for metadata element X. In response to the read request for metadata element X, the cache coherency logic may determine that metadata element X is within the first client cache system 302 and has a valid state.
[0029]
[0055] As shown in FIG. 4, in response to determining that metadata element X is in the first client cache system 302 and has a valid state, the first client cache system 302 may invalidate a cache line that includes metadata element X. Throughout the examples herein, invalidation of data or metadata elements is illustrated by a horizontal bar or line through the data or metadata element. Because the first client cache system 302 invalidates a cache line that includes metadata element X, the first client cache system 302 may also invalidate all cache lines that include data elements associated with metadata element X (data elements A and B in this example). Because the cache line that includes metadata element X also includes metadata element Y, the first client cache system 302 may also invalidate all cache lines that include data elements associated with metadata element Y (data elements C and D in this example). In other words, the requested metadata element is invalidated, as well as all other metadata elements in the same cache line as the requested metadata element, and all data elements associated with those metadata elements.
[0030]
[0056] 5, and in response to determining that metadata element X is in the first client cache system 302 and has a valid state, the first client cache system 302 may flush or write to the system memory 306 the cache line that includes the requested metadata element X, the cache line that includes data elements A and B because they are associated with metadata element X, and the cache line that includes data elements C and D because they are associated with metadata element Y (which is in the same cache line as metadata element X). This writing or flushing of the cache lines may occur simultaneously with their invalidation.
[0031]
[0057] As shown in Figure 6, the above-referenced read request for data element A (including a prior request for metadata element X) may be completed or fulfilled by the second client cache system 302 reading from system memory 306 at least the cache line containing the requested metadata element X and the cache lines containing data elements A and B because they are associated with metadata element X. In an alternative example (not shown), these data and metadata elements may be written directly from the first client cache system 302 to the second client cache system 304 to complete or fulfill the read request, effectively bypassing system memory 306. Note that in this example (Figures 3-6), fulfillment of the read request by the second client cache system 304 for data element A is postponed until all of the metadata and data has been invalidated and flushed (e.g., written to system memory 306 or the second client cache system 304) in the first client cache system 302.
[0032]
[0058] Also note that in this example, not only the requested metadata element X, but all data associated with metadata element X, i.e., A and B, are returned to the second client cache system 304 in fulfilling the request, even though the second client cache system 304 may not follow the prior request for metadata element X with an explicit request for data element A, which is the data of interest. This feature proactively returns data that the requesting client may expect to act on based on the pre-requested metadata. In the illustrated example, the second client cache system 304 may be expected to follow up the prior request for metadata element X with requests for both associated data elements A and B. Completing requests for data elements by anticipating requests for additional data elements associated with the same metadata element may save a step (i.e., a round trip communication) and therefore speed up the processing of the second client's ROI.
[0033]
[0059] As shown in FIG. 7, a method 700 for providing cache coherency may include the following. As indicated by block 702, the method 700 may include requesting that a second client cache system read a data element associated with a metadata element. As indicated by block 704, the method 700 may also include detecting that the requested metadata element is stored in the first client cache system. In other words, the metadata element that the second client cache system is attempting to read is already stored in the first client cache system at the time of the request. Cache coherency or snooping techniques known to those skilled in the art may be used for this detection. This detection may occur in response to a read request of the second client cache system for the metadata element.
[0034]
[0060] As indicated by block 706, method 700 may further include the first client cache system writing one or more cache lines including the metadata element and all data elements associated with the metadata element. This write operation may occur in response to detection of the metadata element in the first client cache system. In some examples of method 700, the first client cache system may write these cache lines to system memory, while in other examples, the first client cache system may write these cache lines directly to the storage of the second client cache system (or conversely, the second client cache system may read these cache lines directly from the storage of the first client cache system). In still other examples (not shown), the cache lines may be written to a last level cache (i.e., a system cache shared between clients), or any other type of shared storage. Whether the requested data and metadata elements are obtained from system memory or directly from another client cache system may depend on the details of the cache coherency logic implementation, as will be appreciated by those skilled in the art. Also, in some examples, the first client may transform the data element before the first client cache system writes the (transformed) data element. For example, the first client may compress the data element before writing. Note that such compression may change not only the value of the data element, but also the value of the associated metadata element.
[0035]
[0061] As indicated by block 708, the method 700 may still further include the first client cache system invalidating one or more cache lines. Similar to the write operation, this invalidation may occur in response to detection of the metadata element in the first client cache system.
[0036]
[0062] As indicated by block 710, method 700 may still further include completing or fulfilling the read request. Completing the read request may include the second client cache system receiving the metadata element and all data elements associated with the metadata element. In an example where the first client cache system writes the cache line referenced above to the system memory, the second client cache system may complete the read request by reading the cache line from the system memory. In some examples, the second client may transform the data element as it is received. For example, the second client may decompress the data element using the associated metadata element.
[0037]
[0063] 8-10, an example of the operation of a system 800 similar to systems 100 (FIG. 1) and 300 (FIGS. 3-6) described above is illustrated. Except as described below, structural aspects of system 800 may be similar to those described above with respect to system 300 of FIGS. 3-6. Similarly, aspects of the exemplary operation described above with respect to FIGS. 3-6 may be applied to the example in FIGS. 8-10 unless otherwise indicated. For the sake of brevity, such aspects are not repeated with respect to FIGS. 8-10. Nevertheless, it should be noted that in the first client cache system 802, the first cache storage area 812 may be configured as a data area 808 configured to store data elements in data cache lines, a metadata area 810 configured to store metadata elements in metadata cache lines, and a tag area 813 configured to store metadata status indicators corresponding to the metadata cache lines. Similarly, in the second client cache system 804, a second cache storage area 818 may be configured as a data area 814 configured to store data elements in data cache lines, a metadata area 816 configured to store metadata elements in metadata cache lines, and a tag area 819 configured to store metadata state indicators corresponding to the metadata cache lines.
[0038]
[0064] As shown in FIG. 8, in an initial state of operation in this example, data elements A, B, C, and D, and metadata elements X and Y may be stored in the first client cache system 802. In the illustrated example, metadata element X is associated with data elements A and B, which may form a tile 820. Similarly, metadata element Y is associated with data elements C and D, which may form a tile 822. In tag area 813, a metadata status indicator having an initial value of "11" (i.e., 2 bits) is stored. This metadata status indicator corresponds to the metadata cache line that includes metadata elements X and Y. The bit position of the metadata status indicator corresponds to the position of the metadata element in the metadata cache line. In this example, referring to the positions of the metadata elements from left to right, metadata element X is in the first or left position and metadata element Y is in the second or right position. Note that in other examples, there may be more than two positions in a cache line. Each position in a cache line may be configured to store an amount of data, such as, for example, one byte. A "1" bit in the metadata status indicator may represent an assertion of a property, referred to herein as "ownership," and a "0" bit in the metadata status indicator may represent a non-assertion of such ownership. In this example, referring to the metadata status indicator bit positions from left to right, the first "1" of the "11" value of the metadata status indicator indicates that the first client cache system 802 owns metadata element X, and the second "1" of the "11" value of the metadata status indicator indicates that the first client cache system 802 also owns metadata element Y. "Owning" a metadata element means that the metadata element is not shared (e.g., with the second client cache system 804). The use of corresponding bits in the metadata status indicator to indicate ownership of a metadata element is intended only as an example. In other examples, the metadata status indicator may encode or represent ownership of a metadata element in any other manner.For example, a metadata state indicator may be encoded in a metadata element. Also, note that the metadata state indicator may be similar to a traditional coherency state of owned, but may apply specifically to metadata (as distinguished from data). Other traditional coherency states may also be applied to metadata. For example, a shared state for metadata may be provided in connection with sharing of clean tiles by two or more client cache systems.
[0039]
[0065] As shown in FIG. 9, the first action in this example may be for the second client cache system 804 to issue a read request for data element A. The read request may include a “metadata hint”, which in the illustrated example is a value of “10” (i.e., 2 bits). The metadata hint identifies or indicates a metadata element among two or more metadata elements in a cache line. In the illustrated example, the bit position of the metadata hint corresponds to the position of the metadata element in the metadata cache line. A “1” bit in the metadata hint may represent an assertion of such an identification, and a “0” bit in the metadata hint may represent a non-assertion of such an identification. In the illustrated example, the metadata hint has a value of “10” to identify or indicate metadata element X and does not identify or indicate metadata element Y. Identifying the metadata elements using corresponding bits of the metadata hint is intended as an example only. In other examples, the metadata hint may encode or represent the identification of the metadata element in any other manner. Also, in some examples (not shown), the metadata hint may identify multiple metadata elements. Similarly, the metadata hint may identify a subset of the metadata elements.
[0040]
[0066] 9, in response to a read request for data element A, which includes a metadata hint having a value of “10,” the first client cache system 802 may change the value of the metadata status indicator to “01” to indicate that the first client cache system 802 no longer owns metadata element X, but continues to own metadata element Y, rather than invalidating the entire cache line that includes metadata element X. This use of the metadata status indicator may, in effect, selectively invalidate some, but not necessarily all, metadata elements in a cache line.
[0041]
[0067] Concurrent with the invalidation of one or more metadata elements, the first client cache system 802 may flush or write to system memory 806 the cache line containing metadata element X associated with the requested data element A, as well as the cache lines containing data elements A and B (because they are associated with metadata element X). Note that in this example, the cache lines containing data elements C and D were not flushed because they were not identified by the metadata hint. Selectively invalidating and flushing less than all of the associated data elements (e.g., in contrast to the example discussed above with respect to Figures 3-6) may provide a more efficient use of system memory bandwidth. For purposes of illustration in this example, there are only two metadata elements associated with only four data elements, but in examples where the associated metadata is associated with a much larger amount of data, flushing all of the data may require a large amount of bandwidth.
[0042]
[0068] 10, a read request for data element A may be completed, for example, by the second client cache system 804 reading from system memory 806 the cache line containing the requested metadata element X, as well as the cache line containing data elements A and B (because they are associated with metadata element X). The second client cache system 804 may then set the value of the metadata status indicator corresponding to the cache line containing X and Y to "10" to indicate that the second client cache system 804 currently owns metadata element X in that cache line, but does not own metadata element Y in that cache line.
[0043]
[0069] 11, a method 1100 for providing cache coherency is shown. The method 1100 may be an example of the method 700 (FIG. 7) described above, where the method 1100 includes some features in addition to and / or different from some features of the method 700. For brevity, features of the method 1100 that are similar to the above-described features of the method 700 are not repeated. The method 1100 may include the following:
[0044]
[0070] As indicated by block 1102, the method 1100 may include a request by the second client cache system to read a data element associated with the metadata element. The read request may include a metadata hint that identifies the metadata element among the metadata elements in the cache line.
[0045]
[0071] As indicated by block 1104, the method 1100 may also include detecting that the metadata element is stored in the first client cache system. As indicated by block 1106, the method 1100 may further include the first client cache system writing a cache line that includes the metadata element and writing one or more other cache lines that include only data elements associated with the metadata element identified by the metadata hint. The first client cache system may write the cache line, for example, to a system memory.
[0046]
[0072] As indicated by block 1108, method 1100 may still further include the first client cache system invalidating the one or more other cache lines referenced above. As indicated by block 1110, method 1100 may still further include completing the read request. Completing the read request may include the second client cache system receiving a cache line that includes the metadata element identified by the metadata hint and one or more other cache lines that include a data element associated with the metadata element. For example, the first client cache system may read the cache line from system memory.
[0047]
[0073] In an alternative method similar to method 1100 described above, the metadata hint function may be omitted, and instead, a metadata element may be identified among multiple metadata elements in a cache line based on a predetermined order or position of the metadata elements in the cache line, or other criteria or rules. For example, in response to a first request from a second client cache system for a metadata cache line that includes both X and Y, the first client cache system may write to system memory only the metadata element (e.g., X) located at a first position in the cache line and its associated data elements (e.g., A and B), without writing any other metadata elements that may be included in the cache line. Then, in response to a second request from the second client cache system for the same metadata cache line, the first client cache system may write to system memory only the metadata element (e.g., Y) at a second position in the cache line and its associated data elements (e.g., C and D), without further writing any other metadata elements that may be included in the cache line. In this manner, the second client cache system may continue to retry accessing the same cache line until it receives the metadata element (and associated data elements) it is looking for. In yet other approaches, the rules for distinguishing a metadata element among multiple metadata elements in a cache line associated with a request may be based on criteria other than the order or position of the metadata elements in the cache line. For example, if a condition prevents a first client cache system from immediately writing X in response to a request for X, such as if A was dirty or X was pending, then the first client cache system may respond to the request for X without delay by writing Y, thereby delaying the response for the requested metadata X until such time that the first client cache system can process the eviction of A or resolve the pending state of X.
[0048]
[0074] 12-14, an example of the operation of a system 1200 similar to systems 100 (FIG. 1), 300 (FIGS. 3-6), and 800 (FIGS. 8-10) described above is illustrated. Except as described below, structural aspects of system 1200 may be similar to those described above with respect to systems 100, 300, or 800. Similarly, aspects of the exemplary operation described above with respect to FIGS. 3-6 may be applied to the example in FIGS. 12-14 unless otherwise indicated. For the sake of brevity, such aspects have not been repeated with respect to FIGS. 12-14. Nevertheless, it should be noted that in the first client cache system 1202, the first cache storage area 1212 may be configured as a data area 1208 configured to store data elements in data cache lines, a metadata area 1210 configured to store metadata elements in metadata cache lines, and a tag area 1213 configured to store data status indicators corresponding to the data cache lines. Similarly, in the second client cache system 1204, a second cache storage area 1218 may be configured as a data area 1214 configured to store data elements in data cache lines, a metadata area 1216 configured to store metadata elements in metadata cache lines, and a tag area 1219 configured to store metadata and data state indicators corresponding to the data cache lines.
[0049]
[0075] As shown in FIG. 12, in an initial state of operation in this example, data elements A, B, C, and D and metadata elements X and Y may be stored in the first client cache system 1202. In the illustrated example, metadata element X is associated with data elements A and B, which may form a tile 1220. Similarly, metadata element Y is associated with data elements C and D, which may form a tile 1222. In the tag area 1213, a data status indicator having an initial value of "11 11" (i.e., 4 bits) is stored. Thus, the data status indicator bits indicate that the first client cache system 1202 owns the four corresponding data elements A, B, C, and D and their associated metadata elements. The first two data status indicator bits "11" may correspond to data elements A and B (i.e., corresponding to metadata element X), and the second two data status indicator bits "11" may correspond to data elements C and D (i.e., corresponding to metadata element Y). The use of corresponding bits in the data state indicator to indicate ownership of a data element is intended as an example only. In other examples, the data state indicator may encode or represent ownership of a data element in any other manner. It should be noted that the data state indicator also serves as a metadata state indicator, since the data state indicator indicates ownership metadata by association with the owned data.
[0050]
[0076] As shown in FIG. 13, the first action in this example may be for the second client cache system 1204 to issue a read request for data element A. The read request may include a “data hint”, which in the illustrated example is a value “10 00” (i.e., 4 bits). The data hint identifies or points to one or more data elements or cache lines that contain the data elements. In the illustrated example, the bit positions of the data hint correspond to the data cache lines. A “1” in the leftmost bit position of the data hint “10 00” in this example may indicate that only data element A is the hint (i.e., is being requested). A “0” in each of the other three bit positions of the data hint “10 00” in this example may indicate that the hint or request does not include data elements B, C, or D. Using corresponding bits of the data hint to identify the data elements is intended as an example only. In other examples, the data hint may encode or represent the identification of the data element in any other manner.
[0051]
[0077] 13, in response to a read request for data element A that includes a data hint having a value of "10 00," the first client cache system 1202 may invalidate only one or more cache lines that include the requested data element or elements. Thus, the first client cache system 1202 may change the value of the metadata status indicator to "01 11" to indicate that the first client cache system 1202 no longer owns data element A (and by association no longer owns associated metadata element X), but continues to own data elements B, C, and D (and by association with data elements C and D, continues to own metadata element Y). This use of the data status indicator may, in effect, selectively invalidate some, but not necessarily all, data and metadata elements within a cache line.
[0052]
[0078] Concurrent with the invalidation of one or more data elements and metadata elements, the first client cache system 1202 may flush or write the cache line containing data element A and the cache line containing data element A's associated metadata element X to system memory 1206. Note that in this example, none of the cache lines containing data elements B, C, or D have been flushed because they were not identified by the data hints. Selectively invalidating and flushing potentially fewer data elements (i.e., more selectively or with finer granularity) than the examples discussed above with respect to Figures 8-10 may provide opportunities for finer granular sharing of data, may provide more efficient use of system memory bandwidth, or other benefits.
[0053]
[0079] As shown in FIG. 14, a read request for data element A may be completed by the second client cache system 1204 reading from the system memory 1206 a cache line that includes data element A because data element A was identified by the data hint, and a cache line that includes metadata element X because metadata element X is associated with data element A. In this example, even if data element B is associated with metadata element X, data element B is not returned to the second client cache system 1204 because data element B is not identified by the data hint. The second client cache system 1204 may then set the value of the data status indicator to “10 00” to indicate that the second client cache system 1204 currently owns data element A, but does not own data elements B, C, or D. The data status indicator value of “10 00” also indicates that the second client cache system 1204 owns metadata element X because metadata element X is associated with owned data element A, but does not own metadata element Y because metadata element Y is not associated with the owned data element.
[0054]
[0080] As in the other examples above, the first client may transform the data element before the first client cache system 1202 writes the (transformed) data element to the system memory 1206. Nevertheless, the first client may not perform such compression in this example, since not all data elements of the same tile 1220 are written, and only data element A is written, but not data element B, which is part of the same tile 1220. In an alternative example, the first client may perform such compression (using data elements A and B, or A alone), and the second client cache system 1204 may read only the (compressed) data element A from the system memory 1206, but not the (compressed) data element B, if present. Yet another solution is described below with respect to FIG. 25.
[0055]
[0081] 15, a method 1500 for providing cache coherency is shown. The method 1500 may be an example of the method 1100 (FIG. 11) described above, where the method 1500 includes some features in addition to and / or different from some features of the method 1100. For brevity, features of the method 1500 that are similar to the above-described features of the method 1100 are not repeated. The method 1500 may include the following:
[0056]
[0082] As indicated by block 1502, method 1500 may include a request by the second client cache system to read a data element associated with the metadata element. The read request may include a data hint that identifies the data element or a cache line that includes the data element. Because each data element has an associated metadata element, the data hint also identifies the associated metadata element.
[0057]
[0083] As indicated by block 1504, the method 1500 may also include detecting that the data element indicated by the data hint is stored in the first client cache system. As indicated by block 1506, the method 1100 may further include the first client cache system writing a cache line including the associated metadata element and writing one or more other cache lines including only the one or more data elements identified by the data hint. The first client cache system may write the cache line, for example, to a system memory.
[0058]
[0084] As indicated by block 1508, method 1500 may still further include the first client cache system invalidating the one or more other cache lines referenced above. As indicated by block 1510, method 1500 may still further include completing the read request. Completing the read request may include the second client cache system receiving the cache line including the metadata element and one or more other cache lines including only data elements associated with the metadata element identified by the data hint. For example, the first client cache system may read the cache line from system memory.
[0059]
[0085] 16-23 illustrate an example of the operation of system 1200, similar to systems 100 (FIG. 1), 300 (FIG. 3-6), 800 (FIG. 8-10), and 1200 (FIG. 12-14) described above. Except as described below, structural aspects of system 1600 may be similar to those described above with respect to systems 100, 300, 800, or 1200. Similarly, aspects of the exemplary operation described above with respect to FIGS. 3-6 may be applied to the example in FIGS. 16-23, unless otherwise indicated. For the sake of brevity, such aspects have not been repeated with respect to FIGS. 16-23. Nevertheless, it should be noted that in the first client cache system 1602, the first cache storage area 1612 may be configured as a data area 1608 configured to store data elements in data cache lines, and a metadata area 1610 configured to store metadata elements in metadata cache lines. Similarly, in the second client cache system 1604, a second cache storage area 1618 may be configured as a data area 1614 configured to store data elements in data cache lines, and a metadata area 1616 configured to store metadata elements in metadata cache lines. As with the above example, the premise of this example is that the second client is attempting to operate on the same area of interest (e.g., data element A) as the first client is operating on. As noted above, the first and second clients may control their respective cache systems in the manner described above with respect to FIG. 3, although this is not shown in the example for clarity.
[0060]
[0086] As shown in FIG. 16, initially in the operation of this example, data elements A, B, C, and D, and metadata elements X and Y may be stored in the first client cache system 1602. In the illustrated example, metadata element X is associated with data elements A and B, which may form a tile 1620. Similarly, metadata element Y is associated with data elements C and D, which may form a tile 1622. The first action in this example may be for the second client cache system 1604 to issue a read request for data element A. Although not shown for clarity, the read request for data element A may include a prior request for the associated metadata element X (or for a cache line that includes metadata element X). In this example (FIGS. 16-23), the first client (not shown) may not have acted on the tile 1620 at the time the second client cache system 1604 requests data element A. If the first client cache system 1602 was operating on the tile 1620 at the time the second client cache system 1604 requests data element A, the first client cache system 1602 may respond by immediately invalidating and flushing the associated cache lines to system memory 1606, and may then complete the read request for A as described above with respect to Figures 3-6. However, in this example, the first client cache system 1602 may not be operating on the tile 1620 at the time of the read request for data element A, and therefore does not yet invalidate and flush the cache lines.
[0061]
[0087] 17, in response to a read request for data element A (which may include a prior request for associated metadata element X), a cache line that includes metadata element X (and also includes metadata element Y) may be returned to the second client cache system 1604. Whether the requested metadata element is read from system memory 1606, as in the example shown in FIG. 17, or directly from the first client cache system 1602 may depend on the details of the cache coherency logic implementation, as will be appreciated by those skilled in the art.
[0062]
[0088] As shown in FIG. 18, and in response to a read request for data element A, a cache line including data element A may be returned to the second client cache system 1604. Whether the requested data element is read from the system memory 1606 as in the example shown in FIG. 18, or directly from the first client cache system 1602 to the second client cache system 1604 may depend on the details of the cache coherency logic implementation, as will be understood by those skilled in the art. Also, in an example where the requested data element is read from the system memory 1606, not only data element A, but also all other data elements of the same tile 1620 may be read and thus returned to the second client cache system 1604. Thus, as shown in FIG. 18, a cache line including data elements A and B may be returned to the second client cache system 1604. Furthermore, as described above with respect to FIGS. 3-6, in yet other examples, data elements C and D may also be (actively) provided to the second client cache system 1604.
[0063]
[0089] As shown in FIG. 19, data element A may be written from the first client cache system 1602 to the system memory 1606 while a first client (not shown) continues to operate, i.e., process, the tile 1620. For example, the first client may compress data element A from the first client cache system 1602 and write the compressed data element A to the system memory 1606. The compression may generate an updated value of metadata element X along with the compressed data element A, and the value of metadata element X may be updated in the first client cache system 1602. In the example shown in FIG. 19, data element B in the tile 1620 may have a “dirty” status because the first client may still be operating on the tile 1620 and data element B has not yet been written to the system memory 1606. The first client may, for example, have compressed data element B, but have not yet written the compressed data element B to the system memory 1606.
[0064]
[0090] As shown in FIG. 20, simultaneously with writing data element A to system memory 1606, updating the status of data element B to dirty, and updating the value of metadata X, the first client cache system may tag metadata element X with an indication of a status referred to herein as “pending” (“P”). The term “pending” is used herein for convenience, and use of the term should not be construed as limiting in itself. The P tag or status is detectable by snooping and indicates to a snooping entity, such as another cache system, that the cache system is not acting on the data element associated with the P-tagged metadata element. Thus, in the illustrated example (FIGS. 16-23), the second client cache system 1604 may detect a bus transaction involving the first client cache system 1602 writing data element A, and further detect that metadata element X shared between the first client cache system 1602 and the second client cache system 1604 is tagged with a P status. In response to detecting that shared metadata element X has a P state, the second client cache system 1604 may invalidate the cache line that includes the shared metadata element X and all cache lines that include data elements associated with the invalidated metadata element.
[0065]
[0091] In the illustrated example, the P state of the shared metadata element indicates to the second client cache system 1604 that it should invalidate its copies of these data and metadata cache lines and defer acting on the area of interest (e.g., data element A) until the first client cache system 1602 has invalidated and written all of the cache lines containing the shared metadata and associated data elements to system memory 1606. Note that this invalidation and writing of the cache lines containing the shared metadata and associated data elements may be similar to the invalidation and writing described above with respect to Figures 3-7, except that the invalidation and writing are deferred until the first client has finished acting on the area of interest.
[0066]
[0092] 21, as the second client cache system 1604 continues to attempt to operate on its region of interest, the second client cache system 1604 may again issue a read request for data element A (which may again include a prior request for metadata element X). Nevertheless, this read request will not complete, i.e., will remain pending, until such time as the first client cache system 1602 invalidates and writes the cache line for the P-tagged metadata element.
[0067]
[0093] As shown in FIG. 22, the first client cache system 1602 may invalidate and write the above-referenced cache line including data elements A, B, C, and D, and metadata elements X and Y, which may occur when the first client finishes working with those data elements. In response to or triggered by this writing or flushing of the above-referenced cache line to system memory 1606, a read request for data element A may then be completed or fulfilled, as shown in FIG. 23. For example, the second client cache system 1604 may read or otherwise obtain data element A and associated metadata element X from system memory 1604. The cache line provided to the second client cache system 1604 may include metadata element Y along with metadata element X. Also, as described above with respect to other examples, data element B may be proactively provided to the second client cache system 1604.
[0068]
[0094] 24, a method 2400 for providing cache coherency is shown. The method 2400 may be one example of the method 700 (FIG. 7) described above, where the method 2400 includes features in addition to and / or different from the features of the method 700. The method 2400 may include the following.
[0069]
[0095] As indicated by block 2401, the method 2400 may include the first client cache system tagging the stored metadata element with a tag or indication indicating a "pending" or "P" state. That is, the first client cache system may store a pending state indication in association with the stored metadata element. The first client cache system may tag the stored metadata element with a P state simultaneously with writing (e.g., to system memory) the associated data element, as in the example described above (FIG. 20), or at another (e.g., later) time, such as in response to a read request for the data element (FIG. 21). As indicated by block 2402, the method 700 may further include requesting that the second client cache system read the data element and the associated metadata element. As indicated by block 2404, the method 2400 may include detecting that the metadata element is stored at the first client cache system and has a pending state tag or indication.
[0070]
[0096] As indicated by block 2406, the method 700 may further include the first client cache system writing one or more cache lines including the metadata element and all data elements associated with the metadata element. This write operation may occur in response to detection of the metadata element in the first client cache system. In some examples of the method 2400, the first client cache system may write these cache lines to system memory, while in other examples, the first client cache system may write these cache lines directly to the storage of the second client cache system (or conversely, the second client cache system may read these cache lines directly from the storage of the first client cache system). Also, in some examples, the first client may transform (e.g., compress) the data elements before the first client cache system writes the data elements.
[0071]
[0097] As indicated by block 2408, method 2400 may still further include the first client cache system invalidating one or more cache lines. As indicated by block 2410, method 2400 may still further include completing the read request. Nevertheless, as indicated by block 2410, completion of the read request is postponed or does not occur until after the write and invalidation operations described above (blocks 2406-2408). It should be understood that the order in which blocks 2401-2410 in FIG. 24 are presented is intended to help guide the reader through the example, and is not intended to limit the order in which various actions may occur in other examples of method 2400. The same understanding applies to the order in which blocks of other methods 700 (FIG. 7), 1100 (FIG. 11), and 1500 (FIG. 15) are presented.
[0072]
[0098] As with the other methods described above, completing the read request (block 2410) may include the second client cache system receiving the metadata element and all data elements associated with the metadata element. For example, the first client cache system may read a cache line from system memory.
[0073]
[0099] In some embodiments of methods for providing cache coherency, some features of example methods 700, 1100, 1500, and 2400 may be provided in combination with features of others of methods 700, 1100, 1500, and 2400. For example, features of method 2400 relating to pending state indications may be included in any of methods 700, 1100, and 1500. Correspondingly, in some embodiments of systems for providing cache coherency, some of example systems 300, 800, 1200, and 1600 may be configured to include features of others of systems 300, 800, 1200, and 1600.
[0074]
[0100] In FIG. 25, an example is shown in which the system 2500 is in a state in which metadata is generated in connection with writing back data. In each of the other examples described above, it is contemplated that the client may transform data elements and generate metadata associated with the transformed data, and then the transformed data elements and generated metadata may be written back to system memory. Nevertheless, in the above examples, the metadata is generated on a tile basis. Thus, to generate metadata for a tile, the client may need to have access to all data elements of the tile, not just the data elements that are written back to system memory. The following features may address how a client may be provided with such access to other (i.e., non-owned) data elements of the tile that the client may need to generate metadata for the tile.
[0075]
[0101] System 2500 is similar to system 1200 described above with respect to Figures 12-14. Thus, in a first client cache system 2502, a first cache storage area 2512 may be configured as a data area 2508 configured to store data elements in data cache lines, a metadata area 2510 configured to store metadata elements in metadata cache lines, and a tag area 2513 configured to store data state indicators corresponding to the data cache lines. Similarly, in a second client cache system 2504, a second cache storage area 2518 may be configured as a data area 2514 configured to store data elements in data cache lines, a metadata area 2516 configured to store metadata elements in metadata cache lines, and a tag area 2519 configured to store metadata and data state indicators corresponding to the data cache lines. In the illustrated example, metadata element X is associated with data elements A and B, which may form tile 2520, and metadata element Y is associated with data elements C and D, which may form tile 2522. In the tag field 2513, a data status indicator having a value of "10 11" indicates that the first client cache system 2502 owns data elements A, C, and D and their associated metadata elements, but does not own data element B. Similarly, in the tag field 2519, a data status indicator having a value of "01 00" indicates that the second client cache system 2504 owns data element B and its associated metadata element Y, but does not own other data elements (not shown in the data field 2514 for clarity).
[0076]
[0102] Features may be included to address examples or instances of operations where either a first client cache system 2502 writes data element A to system memory 2506 or a second client cache system 2504 writes data element B to system memory 2506. If the first client cache system 2502 writes data element A to system memory 2506, the first client may need to be able to request access to data element B in order to generate metadata for the tile 2520. Similarly, if the second client cache system 2504 writes data element B to system memory 2506, the second client may need to access data element A in order to generate metadata.
[0077]
[0103] To address the case where the first client cache system 2502 writes data element A to the system memory 2506, the following features may be included: The first client cache system 2502 may send data element A to the second client cache system 2504, in effect relinquishing ownership of data element A from the first client cache system 2052 and transferring to the second client cache system 2504 the responsibility of transforming data element A and writing the transformed data element A and the generated metadata associated with the transformation back to the system memory 2506. For example, the first client cache system 2502 may send an "intent to relinquish ownership" message to the second client cache system 2504, to which the second client cache system 2504 may respond with a message accepting the transfer or relinquishment and then receiving data element A from the first client cache system 2502. Alternatively, the first client cache system 2502 can push data element A onto a system bus (not shown in FIG. 25), from which the second client cache system 2504 can intercept data element A. Alternatively, the first client cache system 2502 can push data element A into the network, and a central system (such as a snoop filter) can direct data element A to the second client cache system 2504. As an alternative to providing the aforementioned feature of causing the first client cache system 2502 to relinquish ownership of data element A, a feature may be provided in which the first client cache system 2502 acquires ownership of the required data element B. For example, the first client cache system 2502 may snoop the second client cache system 2504 for the required data element B, to which the second client cache system can respond by transferring data element B and its ownership to the first client cache system 2502.Variations or extensions of the above scheme may include selecting between relinquishing or acquiring ownership based on criteria such as the number of lines in a tile, the age of the data element, etc. For example, the client cache system that owns the most lines of the tile may acquire ownership, and the client cache system that owns fewer lines of the tile may relinquish ownership. Alternatively, or as an additional criterion in selecting between relinquishing or acquiring ownership, the client cache system that owns the youngest (i.e., most recently acted upon) tile may be given more weight in the decision for that client cache system to acquire ownership.
[0078]
[0104] Figure 26 illustrates an example of a PCD 2600, such as a mobile phone or smartphone, in which exemplary embodiments of systems, methods, computer readable media, and other examples of providing cache coherency may be provided. For clarity, some interconnects, signals, etc. are not shown in Figure 26. Although PCD 2600 is illustrated as an example, other embodiments of systems, methods, computer readable media, and other examples of providing cache coherency may be provided in other types of computing devices or systems.
[0079]
[0105] The PCD 2600 may include a SoC 2602. The SoC 2602 may include a CPU 2604, an NPU 2605, a GPU 2606, a DSP 2607, an analog signal processor 2608, a modem / modem subsystem 2654, or other processors. The CPU 2604 may include one or more CPU cores, such as a first CPU core 2604A, a second CPU core 2604B, etc., up to an Nth CPU core 2604N.
[0080]
[0106] Cores 2604A-2604N can act as memory clients, for example, in the manner described above with respect to Figure 1. Although not shown for clarity, CPU 2604 may include a client cache system controlled by each of cores 2604A-2604N. Alternatively, or in addition, any of the processors, such as NPU 2605, GPU 2606, DSP 2607, etc., may act as clients and include a client cache system.
[0081]
[0107] A display controller 2610 and a touchscreen controller 2612 may be coupled to the CPU 2604. A touchscreen display 2614 external to the SoC 2602 may be coupled to the display controller 2610 and the touchscreen controller 2612. The PCD 2600 may further include a video decoder 2616 coupled to the CPU 2604. A video amplifier 2618 may be coupled to the video decoder 2616 and the touchscreen display 2614. A video port 2620 may be coupled to the video amplifier 2618. A universal serial bus ("USB") controller 2622 may also be coupled to the CPU 2604, and a USB port 2624 may be coupled to the USB controller 2622. A subscriber identity module ("SIM") card 2626 may also be coupled to the CPU 2604.
[0082]
[0108] One or more memories may be coupled to the CPU 2604. The one or more memories may include both volatile and non-volatile memory. Examples of volatile memory include static random access memory ("SRAM") 2628 and dynamic random access memory ("DRAM") 2630 and 2631. Such memories may be external to the SoC 2602, such as DRAM 2630, or internal to the SoC 2602, such as DRAM 2631. A DRAM controller 2632 coupled to the CPU 2604 may control writing of data to and reading of data from the DRAMs 2630 and 2631. The DRAMs 2630 and 2631 may be examples of any of the system memories described above. The SRAM 2628 may be an example of a local cache memory or a system level cache memory, as described above.
[0083]
[0109] A stereo audio codec 2634 may be coupled to the analog signal processor 2608. Additionally, an audio amplifier 2636 may be coupled to the stereo audio codec 2634. A first stereo speaker 2638 and a second stereo speaker 2640 may each be coupled to the audio amplifier 2636. Additionally, a microphone amplifier 2642 may be coupled to the stereo audio codec 2634, and a microphone 2644 may be coupled to the microphone amplifier 2642. A frequency modulation ("FM") radio tuner 2646 may be coupled to the stereo audio codec 2634. An FM antenna 2648 may be coupled to the FM radio tuner 2646. Additionally, a stereo headphone 2650 may be coupled to the stereo audio codec 2634. Other devices that may be coupled to the CPU 2604 include one or more digital (e.g., CCD or CMOS) cameras 2652.
[0084]
[0110] A modem or RF transceiver 2654 may be coupled to the analog signal processor 2608 and to the CPU 2604. An RF switch 2656 may be coupled to the RF transceiver 2654 and to an RF antenna 2658. Additionally, a keypad 2660, a mono headset with microphone 2662, and a vibration device 2664 may be coupled to the analog signal processor 2608.
[0085]
[0111] The SoC 2602 may have one or more internal or on-chip thermal sensors 2670A and may be coupled to one or more external or off-chip thermal sensors 2670B. An analog-to-digital converter controller 2672 may convert the voltage drops generated by the thermal sensors 2670A and 2670B into digital signals. A power supply 2674 and a PMIC 2676 may provide power to the SoC 2602.
[0086]
[0112] The firmware or software may be stored in any of the memories described above, such as DRAM 2630 or 2631, SRAM 2628, or in local memory directly accessible by the processor hardware on which the software or firmware executes. Execution of such firmware or software may control aspects of any of the methods described above or may constitute aspects of any of the systems described above. Any such memory or other temporary storage medium having firmware or software stored therein in computer readable form for execution by the processor hardware may be an example of a "computer readable medium" as that term is understood in patent vocabulary.
[0087]
[0113] The following numbered clauses describe example implementations.
[0114] 1. A method for providing cache coherency, comprising:
[0115] requesting, by a second client cache system, to read a data element having an associated metadata element;
[0116] locating the metadata element in the first client cache system in response to a read request to read the metadata element by the second client cache system;
[0117] writing, by a first client cache system, in response to detecting the metadata element in the first client cache system, one or more cache lines including the metadata element and all data elements associated with the metadata element;
[0118] invalidating, by the first client cache system, the metadata element in the first client cache system in response to detecting the metadata element in the first client cache system;
[0119] completing the read request, the second client cache system receiving the metadata element and all data elements associated with the metadata element.
[0120] 2. The method of claim 1, wherein writing one or more cache lines includes writing at least one data element transformed using a metadata element.
[0121] 3.
[0122] writing the one or more cache lines includes writing the one or more cache lines to a system memory;
[0123] 3. The method of claim 1 or 2, wherein completing the read request includes reading, by the second client cache system, one or more cache lines from the system memory.
[0124] 4. The method of any of clauses 1-3, further comprising transforming, by the second client cache system, at least one data element read from the system memory using the metadata element.
[0125] 5.
[0126] The requesting to read the metadata element includes providing a metadata hint that identifies the metadata element among the multiple metadata elements in the cache line;
[0127] 5. The method of any of clauses 1-4, wherein writing one or more cache lines includes writing a cache line that includes the metadata element and writing one or more other cache lines that include only data elements associated with the metadata element identified by the metadata hint.
[0128] 6.
[0129] and requesting to read the metadata element further includes providing a data hint identifying one or more data elements among the plurality of data elements associated with the metadata element identified by the metadata hint;
[0130] 6. The method of any of clauses 1-5, wherein writing one or more cache lines includes writing a cache line that includes the metadata element and writing one or more other cache lines that include only the one or more data elements identified by the data hint.
[0131] 7.
[0132] storing, by the first client cache system, a pending state indication associated with the metadata element in the first client cache system prior to a read request by the second client cache system to read the metadata element;
[0133] detecting a metadata element in a second client cache system, the metadata element including detecting a pending state indication;
[0134] responsive to detecting the metadata element in the second client cache system, invalidating, by the second client cache system, one or more cache lines that include the metadata element and all data elements associated with the metadata element;
[0135] 7. The method of any of clauses 1-6, further comprising: postponing completion of the read request until after writing, by the first client cache system, one or more cache lines that include the metadata element and all data elements associated with the metadata element.
[0136] 8. The method of any of clauses 1-7, wherein writing one or more cache lines includes writing one or more cache lines to a system memory, and deferring completion of the read request includes reading one or more cache lines from the system memory by a second client cache system.
[0137] 9. A system for providing cache coherency, comprising:
[0138] a first client cache system;
[0139] a second client cache system configured to provide a read request to read a data element having an associated metadata element, and further configured to locate the metadata element in the first client cache system in response to the read request;
[0140] the first client cache system is configured to, in response to detecting the metadata element in the first client cache system, write one or more cache lines including the metadata element and all data elements associated with the metadata element; and the first client cache system is further configured, in response to detecting the metadata element in the first client cache system, to invalidate the metadata element in the first client cache system;
[0141] A system, wherein a second client cache system is configured to receive the metadata element and all data elements associated with the metadata element, thereby completing the read request.
[0142] 10. The system of claim 9, wherein the first client cache system is configured to write at least one data element transformed using the metadata element, thereby writing one or more cache lines.
[0143] 11.
[0144] a first client cache system configured to write one or more cache lines to a system memory;
[0145] The system of any one of clauses 9 to 10, wherein the second client cache system is configured to complete the read request by being configured to read one or more cache lines from the system memory.
[0146] 12. The system of any of clauses 9-11, wherein the second client cache system is further configured to transform at least one data element read from the system memory using the metadata element.
[0147] 13.
[0148] a second client cache system configured to serve the read request by including a metadata hint that identifies a metadata element among the plurality of metadata elements in the cache line;
[0149] The method of any of clauses 9-12, wherein the first client cache system is configured to write one or more cache lines by writing a cache line that includes the metadata element and writing one or more other cache lines that include only data elements associated with the metadata element identified by the metadata hint.
[0150] 14.
[0151] a second client cache system configured to serve the read request by including a data hint identifying one or more data elements among the plurality of data elements associated with the metadata element identified by the metadata hint;
[0152] The system of any of clauses 9 to 13, wherein the first client cache system is configured to write one or more cache lines by being configured to write one or more other cache lines that include only one or more data elements identified by the data hint.
[0153] 15.
[0154] the first client cache system is configured to store a pending state indication associated with the metadata element in the first client cache system before the read request is serviced;
[0155] a second client cache system configured to detect a pending state indication stored in association with the metadata element;
[0156] a second client cache system configured, in response to detecting the metadata element in the second client cache system, to invalidate one or more cache lines that include the metadata element and all data elements associated with the metadata element;
[0157] The system of any of clauses 9-14, wherein the second client cache system is configured to postpone completion of the read request until after the first client cache system has written one or more cache lines that include the metadata element and all data elements associated with the metadata element.
[0158] 16.
[0159] a first client cache system configured to write one or more cache lines to a system memory;
[0160] The system of any one of clauses 9 to 10, wherein the second client cache system is configured to complete the read request by being configured to read one or more cache lines from the system memory.
[0161] 17. A system for providing cache coherency, comprising:
[0162] means for requesting to read a data element having an associated metadata element;
[0163] means for locating a metadata element in a first client cache system in response to a read request to read the metadata element by a second client cache system;
[0164] means for, in response to detecting a metadata element in the first client cache system, writing one or more cache lines including the metadata element and all data elements associated with the metadata element;
[0165] means for invalidating the metadata element in the first client cache system in response to detecting the metadata element in the first client cache system;
[0166] and means for completing the read request, the means including means for receiving the metadata element and all data elements associated with the metadata element in a second client cache system.
[0167] 18. The system of clause 17, wherein the means for writing one or more cache lines comprises means for writing at least one data element transformed using a metadata element.
[0168] 19.
[0169] the means for writing one or more cache lines comprises means for writing one or more cache lines to a system memory;
[0170] 19. The system of claim 17 or 18, wherein the means for completing comprises means for reading one or more cache lines from the system memory.
[0171] 20. A system according to any of clauses 17 to 19, further comprising means for transforming at least one data element read from the system memory using the metadata element.
[0172] twenty one.
[0173] The means for requesting to read a metadata element comprises means for providing a metadata hint that identifies the metadata element among a plurality of metadata elements in a cache line;
[0174] 21. The system of any of clauses 17-20, wherein the means for writing one or more cache lines comprises means for writing a cache line including the metadata element and one or more other cache lines including only data elements associated with the metadata element identified by the metadata hint.
[0175] twenty two.
[0176] the means for requesting to read a metadata element comprises means for providing a data hint identifying one or more data elements among a plurality of data elements associated with the metadata element identified by the metadata hint;
[0177] 22. The system of any of clauses 17-21, wherein the means for writing one or more cache lines comprises means for writing a cache line including the metadata element and one or more other cache lines including only the one or more data elements identified by the data hint.
[0178] twenty three.
[0179] means for storing, at the first client cache system, a pending status indication associated with the metadata element prior to a read request by the second client cache system to read the metadata element;
[0180] the means for detecting a metadata element in the second client cache system comprises means for detecting a pending state indication, and the means for invalidating comprises means for invalidating one or more cache lines including the metadata element and all data elements associated with the metadata element;
[0181] means for postponing completion of the read request until the means for writing has completed writing one or more cache lines that include the metadata element and all data elements associated with the metadata element; 23. The system of any one of clauses 17 to 22, further comprising:
[0182] 24. The system of any of clauses 17-23, wherein the means for writing one or more cache lines comprises means for writing one or more cache lines to a system memory, and the means for postponing completion of a read request comprises means for reading one or more cache lines from the system memory.
[0183] 25. A computer-readable medium for providing cache coherency, comprising: a non-transitory computer-readable medium having stored thereon instructions in a computer-executable form, the instructions, when executed by a processing system of a computing device,
[0184] a request by a second client cache system to read a data element having an associated metadata element;
[0185] locating the metadata element in the first client cache system in response to a read request by the second client cache system to read the metadata element;
[0186] writing, by the first client cache system, in response to detecting the metadata element in the first client cache system, one or more cache lines including the metadata element and all data elements associated with the metadata element;
[0187] Invalidating the metadata element in the first client cache system in response to detecting, by the first client cache system, the metadata element in the first client cache system;
[0188] and a processing system configured to control completion of the read request, the second client cache system receiving the metadata element and all data elements associated with the metadata element.
[0189] 26. The computer-readable medium of clause 25, wherein the instructions configure the processing system to control writing of one or more cache lines by configuring the processing system to control writing of at least one data element transformed using a metadata element.
[0190] 27.
[0191] instructions configure a processing system to control writing of one or more cache lines to a system memory by configuring the processing system to control writing of one or more cache lines to a system memory;
[0192] 27. The computer-readable medium of claim 25 or 26, wherein the instructions configure the processing system to control completion of the read request by configuring the second client cache system to read one or more cache lines from the system memory.
[0193] 28. The computer-readable medium of any of clauses 25-27, further comprising instructions for configuring a processing system to control transformation of at least one data element read from the system memory using the metadata element.
[0194] 29.
[0195] The instructions configure a processing system to control requests to read a metadata element by configuring the processing system to provide a metadata hint that identifies the metadata element among multiple metadata elements in a cache line;
[0196] 29. The computer-readable medium of any of clauses 25-28, wherein the instructions configure a processing system to control writing of one or more cache lines by configuring the processing system to control writing of a cache line that includes the metadata element and writing of one or more other cache lines that include only data elements associated with the metadata element identified by the metadata hint.
[0197] 30.
[0198] The instructions configure the processing system to control a request to read a metadata element by configuring the processing system to provide a data hint that identifies one or more data elements among a plurality of data elements associated with the metadata element identified by the metadata hint;
[0199] 30. The computer-readable medium of any of clauses 25-29, wherein the instructions configure a processing system to control writing of one or more cache lines by configuring the processing system to control writing of a cache line that includes the metadata element and one or more other cache lines that include only one or more data elements identified by the data hint.
[0200] 31.
[0201] storing, by the first client cache system, a pending state indication associated with the metadata element in the first client cache system prior to a read request by the second client cache system to read the metadata element;
[0202] detecting a metadata element in a second client cache system, the metadata element including detecting a pending state indication;
[0203] Invalidating, by the second client cache system, one or more cache lines that include the metadata element and all data elements associated with the metadata element in response to detecting the metadata element in the second client cache system;
[0204] 31. The computer-readable medium of any of clauses 25-30, further comprising instructions for configuring a processing system to control: deferring completion of the read request by the first client cache system until after writing one or more cache lines that include the metadata element and all data elements associated with the metadata element.
[0088]
[0205] Alternative embodiments will be apparent to those skilled in the art to which the invention pertains. Thus, while selected aspects have been shown and described in detail, it will be understood that various substitutions and modifications may be made thereto.
Claims
1. 1. A method for providing cache coherency, comprising: requesting, by a second client cache system, to read a data element having an associated metadata element; locating the metadata element in a first client cache system in response to a read request to read the metadata element by the second client cache system; writing, by the first client cache system, in response to detecting the metadata element in the first client cache system, one or more cache lines including the metadata element and all data elements associated with the metadata element; invalidating, by the first client cache system, the metadata element in the first client cache system in response to the detection of the metadata element in the first client cache system; completing the read request, including a second client cache system receiving the metadata element and all data elements associated with the metadata element; storing, by the first client cache system, a pending state indication associated with the metadata element at the first client cache system prior to the read request by the second client cache system to read the metadata element; detecting the metadata element in the second client cache system, including detecting the pending state indication; invalidating, by the second client cache system, one or more cache lines containing the metadata element and all data elements associated with the metadata element in response to detecting the metadata element in the second client cache system; and postponing completion of the read request by the first client cache system until after writing the one or more cache lines containing the metadata element and all data elements associated with the metadata element.
2. 2. The method of claim 1, wherein writing the one or more cache lines comprises writing at least one data element transformed using the metadata element.
3. writing the one or more cache lines includes writing the one or more cache lines to a system memory; 2. The method of claim 1, wherein completing the read request includes reading, by the second client cache system, the one or more cache lines from the system memory.
4. 4. The method of claim 3, further comprising: transforming, by the second client cache system, at least one data element read from the system memory using the metadata element.
5. requesting to read the metadata element includes providing a metadata hint that identifies the metadata element among multiple metadata elements in a cache line; writing the one or more cache lines includes writing the cache line that includes the metadata element, and writing one or more other cache lines that include only data elements associated with the metadata element identified by the metadata hint. The method of claim 1.
6. and requesting to read the metadata element further comprises providing a data hint identifying one or more data elements among a plurality of data elements associated with the metadata element identified by the metadata hint; writing the one or more cache lines includes writing the cache line that includes the metadata element and writing one or more other cache lines that include only the one or more data elements identified by the data hint. The method of claim 5.
7. 2. The method of claim 1, wherein writing the one or more cache lines comprises writing the one or more cache lines to a system memory, and wherein deferring completion of the read request comprises reading the one or more cache lines from the system memory by the second client cache system.
8. 1. A system for providing cache coherency, comprising: a first client cache system; a second client cache system configured to provide a read request to read a data element having an associated metadata element, and further configured to locate the metadata element in the first client cache system in response to the read request; the first client cache system is configured to, in response to detecting the metadata element in the first client cache system, write one or more cache lines including the metadata element and all data elements associated with the metadata element; and the first client cache system is further configured, in response to detecting the metadata element in the first client cache system, to invalidate the metadata element in the first client cache system; the second client cache system is configured to receive the metadata element and all data elements associated with the metadata element, thereby completing the read request; the first client cache system is configured to store a pending state indication associated with the metadata element at the first client cache system before the read request is serviced; the second client cache system is configured to detect the pending status indication stored in association with the metadata element; the second client cache system is configured, in response to detecting the metadata element in the second client cache system, to invalidate one or more cache lines that include the metadata element and all data elements associated with the metadata element; the second client cache system is configured to postpone completion of the read request until after the first client cache system has written the one or more cache lines that include the metadata element and all data elements associated with the metadata element.
9. 9. The system of claim 8, wherein the first client cache system is configured to write the one or more cache lines by writing at least one data element transformed using the metadata element.
10. the first client cache system is configured to write the one or more cache lines by being configured to write the one or more cache lines to system memory; the second client cache system is configured to read the one or more cache lines from the system memory, thereby completing the read request; The system of claim 8.
11. 11. The system of claim 10, wherein the second client cache system is further configured to use the metadata element to translate at least one data element read from the system memory.
12. the second client cache system is configured to serve the read request by including a metadata hint that identifies the metadata element among a plurality of metadata elements in a cache line; the first client cache system is configured to write the one or more cache lines by writing the cache line including the metadata element and by writing one or more other cache lines including only data elements associated with the metadata element identified by the metadata hint; The system of claim 8.
13. the second client cache system is configured to serve the read request by being configured to include a data hint identifying one or more data elements among a plurality of data elements associated with the metadata element identified by the metadata hint; the first client cache system is configured to write the one or more cache lines by being configured to write one or more other cache lines that include only the one or more data elements identified by the data hint; The system of claim 12.
14. the first client cache system is configured to write the one or more cache lines by being configured to write the one or more cache lines to system memory; the second client cache system is configured to read the one or more cache lines from the system memory, thereby completing the read request; The system of claim 8.