History-based selective cache line invalidation requests - Patents.com

A metadata-based approach tracks speculative store instructions as 'problematic' to prevent wasteful cache line invalidations, enhancing microprocessor efficiency by ensuring valid cache line access requests are only made when execution is confirmed.

JP2024541869APending Publication Date: 2024-11-13ADVANCED MICRO DEVICES INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024523441
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-10-29
Filing Date
2022-10-17
Publication Date
2024-11-13

AI Technical Summary

Technical Problem

Speculative execution of store instructions in microprocessors leads to wasteful cache line invalidations due to premature requests for exclusive access, which can result in inefficiencies when the execution path is later determined to be incorrect.

Method used

Implement a metadata-based approach to track cache lines as 'problematic' during speculative execution, avoiding unnecessary invalidations by recording indications in metadata memory and only issuing invalidation requests when the execution becomes non-speculative.

Benefits of technology

Reduces wasteful cache line invalidations by ensuring that invalidations are only performed when the store instruction is confirmed to be on the correct execution path, thereby improving performance and reducing unnecessary memory operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024541869000001_ABST
    Figure 2024541869000001_ABST
Patent Text Reader

Abstract

Techniques are provided for performing cache operations that include recording an indication that providing exclusive access of a first cache line to a first processor is deemed problematic, detecting speculative execution of a store instruction to the first cache line by the first processor, and in response to detecting, denying exclusive access of the first cache line to the first processor based on the indication.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] (CROSS REFERENCE TO RELATED APPLICATIONS) This application claims the benefit of U.S. Patent Application No. 17 / 514,811, filed October 29, 2021, the contents of which are incorporated herein by reference. [Background technology]

[0002] Modern microprocessors implement a wide range of features for high throughput. Some such features include having a highly parallel architecture and performing speculative execution. Improvements to such technology are constantly being made.

[0003] A more detailed understanding may be had from the following description, given by way of example in conjunction with the accompanying drawings, in which: [Brief description of the drawings]

[0004] [Figure 1] FIG. 1 is a block diagram of an example device capable of implementing one or more features of the present disclosure. [Diagram 2] FIG. 2 is a block diagram of an instruction execution pipeline disposed within the processor of FIG. 1. [Diagram 3] FIG. 1 is a block diagram of a computer system, according to an example. [Figure 4A] FIG. 2 illustrates cache behavior associated with a cache line that is deemed “problematic,” according to one example. [Figure 4B] FIG. 2 illustrates cache behavior associated with a cache line that is deemed “problematic,” according to one example. [Figure 4C] FIG. 2 illustrates cache behavior associated with a cache line that is deemed “problematic,” according to one example. [Figure 4D] FIG. 2 illustrates cache behavior associated with a cache line that is deemed “problematic,” according to one example. [Diagram 5]1 is a flow diagram of a method for speculatively executing store instructions, according to an example. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0005] Techniques are provided for performing cache operations that include recording an indication that providing exclusive access of a first cache line to a first processor is deemed problematic, detecting speculative execution of a store instruction to the first cache line by the first processor, and in response to detecting, refusing to provide exclusive access of the first cache line to the first processor based on the indication.

[0006] 1 is a block diagram of an example device 100 in which aspects of the disclosure may be implemented. Device 100 may include, for example, a computer, a gaming device, a handheld device, a set-top box, a television, a mobile phone, or a tablet computer. Device 100 includes one or more processors 102, a memory hierarchy 104, a storage device 106, one or more input devices 108, and one or more output devices 110. Device 100 may also include optional input drivers 112 and output drivers 114. It should be understood that device 100 may include additional components not shown in FIG. 1.

[0007] The one or more processors 102 may include a central processing unit (CPU), a graphics processing unit (GPU), a CPU and a GPU located on the same die, or one or more processor cores, each processor core being a CPU or a GPU. In some examples, the one or more processors 102 may include any number of processors. In some examples, the one or more processors 102 may include one or more processor chips. In some examples, each processor chip may include one or more processor cores.

[0008] Some or all of memory hierarchy 104 may be located on the same die as one or more of the one or more processors 102, or may be partially or completely separate from the one or more processors 102. Memory hierarchy 104 may include, for example, one or more caches, one or more volatile memories, one or more non-volatile memories, and / or other memories, including one or more random access memories (RAMs) of various types.

[0009] In some examples, elements of memory hierarchy 104 are arranged in a hierarchy that includes elements of one or more processors 102. Examples of such arrangements are provided in Figures 3 and 4A-4D.

[0010] Storage devices 106 include fixed or removable storage devices (e.g., hard disk drives, solid state drives, optical disks, flash drives). Input devices 108 include keyboards, keypads, touch screens, touch pads, detectors, microphones, accelerometers, gyroscopes, biometric scanners, or network connections (e.g., wireless local area network cards for transmitting and / or receiving wireless IEEE 802 signals). Output devices 110 include displays, speakers, printers, haptic feedback devices, one or more optics, antennas, or network connections (e.g., wireless local area network cards for transmitting and / or receiving wireless IEEE 802 signals).

[0011] The input driver 112 communicates with the processor 102 and the input device 108, allowing the processor 102 to receive input from the input device 108. The output driver 114 communicates with the processor 102 and the output device 110, allowing the processor 102 to send output to the output device 110. It should be noted that the input driver 112 and the output driver 114 are optional components and that the device 100 operates in the same manner when the input driver 112 and the output driver 114 are not present.

[0012] Figure 2 is a block diagram of an instruction execution pipeline 200 disposed within one or more of the processors 102 of Figure 1. In various examples, any processor core of one or more of the processors 102 of Figure 1 may be implemented as shown in Figure 2.

[0013] Instruction execution pipeline 200 retrieves instructions from memory, executes the instructions, outputs data to memory, and changes the state of elements in instruction execution pipeline 200 , such as registers in register file 218 .

[0014] The instruction execution pipeline 200 includes an instruction fetch unit 204 configured to fetch instructions from a system memory (such as memory 104) via an instruction cache 202, a decoder 208 configured to decode the fetched instructions, functional units 216 configured to perform calculations to process the instructions, a load store unit 214 configured to load data from or store data to the system memory via a data cache 220, and a register file 218 including registers that store operational data of the instructions. A reorder buffer 210 tracks instructions that are currently in-flight and ensures in-order retirement of instructions while allowing out-of-order execution while in-flight. The term "in-flight" instructions refers to instructions that have been received by the reorder buffer 210 but that have not yet had their results committed to the processor's architectural state (e.g., results written to a register file, etc.). A reservation station 212 maintains the in-flight instructions and tracks the instruction operands. When all operands are ready for execution of a particular instruction, reservation stations 212 send the instruction to functional units 216 or load / store units 214 for execution. Completed instructions are marked for retirement in reorder buffer 210 and are retired when they are at the head of reorder buffer queue 210. Retirement refers to the act of committing the result of an instruction to the architectural state of the processor. For example, writing an addition result to a register via an add instruction, writing a loaded value to a register via a load instruction, or causing instruction flow to jump to a new location via a branch instruction are all examples of retiring an instruction.

[0015] The various elements of instruction execution pipeline 200 communicate via a common data bus 222. For example, functional units 216 and load / store unit 214 write results to common data bus 222, which may be read by reservation stations 212 for execution of dependent instructions and by reorder buffer 210 as final processing results for in-flight instructions that have finished executing. Load / store unit 214 also reads data from common data bus 222. For example, load / store unit 214 reads results from completed instructions from common data bus 222 and writes the results to memory via data cache 220 for store instructions.

[0016] Instruction execution pipeline 200 executes some instructions speculatively, meaning that instruction execution pipeline 200 performs at least some actions in order to execute an instruction, but maintains the ability to reverse the effects of such execution if the instruction is incorrectly executed.

[0017] In one example, the instruction execution pipeline 200 may perform branch prediction. Branch prediction is the act of the instruction fetch unit 204 predicting a control flow path along which execution will flow and fetching instructions from that path. There are many ways to perform prediction, some involving maintaining a global or address-specific branch path history (e.g., a history of whether a branch is taken and / or the target of such a branch) and performing various operations using such history. The execution pipeline (e.g., functional units 216) actually executes the branch to determine the correct outcome of such a branch. Although instructions from a predicted execution path are executed, such instructions are considered to be speculatively executed before the functional units 216 actually determine the correct execution path because such instructions may not actually be executed. There are many other reasons why instructions may be executed speculatively.

[0018] A store instruction may be executed speculatively. Speculative execution is done by performing various operations for an instruction but not committing such operations until the instruction becomes non-speculative. In one example, speculatively executing a store instruction includes placing the instruction in load / store unit 214, determining the data to store, and determining the address to store the data to (which may involve address calculation and address translation). During the time that such an instruction is being speculatively executed, reorder buffer 210 holds the store instruction and does not allow the instruction to be retired (committed to a result) until the store instruction becomes non-speculative. In the branch prediction example, the store instruction becomes non-speculative when execution pipeline 200 determines that the predicted control flow path that includes the store instruction is the correct control flow path (e.g., by functional unit 216 executing a branch instruction and determining that the control flow path predicted by instruction fetch unit 204 is the actual control flow path indicated by the currently executed branch instruction).

[0019] An instruction may be speculatively executed for a variety of reasons, such as being executed on a predicted branch control flow path, or for a variety of other reasons. Part of the execution of a store instruction involves writing the data to be stored to a cache. To do this, the cache controller acquires exclusive access to the appropriate cache line and then writes the specified data to that cache line. Acquiring exclusive access to the appropriate cache line involves causing other caches (e.g., all other caches that are not hierarchically above that cache) to invalidate their copies of the cache line. Doing this prevents conflicting versions of the data in that cache line from existing in different cache memories. In the modified, exclusive, shared, invalid (MESI) protocol, the instruction execution pipeline 200 performing the store acquires exclusive access to the cache line, and other units are configured to invalidate their cache line copies.

[0020] The instruction execution pipeline 200 is an out-of-order execution pipeline that attempts to execute various operations of an instruction early. One example of such an operation is the invalidation described above. Specifically, for execution of a store instruction, the instruction execution pipeline 200 is permitted to, and often does, request invalidation of other memory copies of a cache line early in the execution of the store instruction, so that when the store instruction is ready to write the associated data, the instruction execution pipeline 200 does not have to wait as long as if the invalidation were performed later. However, a problem arises when speculative execution of a store instruction is performed. Specifically, as described above, it is possible for the instruction execution pipeline 200 to request invalidation of a cache line for a speculatively executed store instruction, and to make such a request substantially before the store instruction is ready to write the data. However, speculative execution of a store instruction may be inappropriate. For example, the store instruction may have been executed on an incorrectly predicted control flow path (such as past a branch not taken point where the branch is actually taken). In this case, invalidating various copies of the involved cache lines to various memories may be futile, as those various memories may need to reacquire those cache lines in a shared or exclusive state.

[0021] For at least this reason, an operation called "usage-based fill request weakening" is presented herein. According to this operation, in the event that a cache line is stored in a cache as a result of a speculative store, a controller, such as a cache controller, or other entity records in a metadata memory that the cache line was stored in the cache as a result of a speculative store. In the event that the cache line is converted to an invalid or shared state due to a probe from a different core, the controller records that the cache line is "problematic". If the core subsequently executes a speculative store instruction that stores into the cache line deemed problematic, the core does not invalidate the cache line in other caches (e.g., caches for parallel processing cores) for the speculative store instruction. The cache line is later invalidated in other caches in the event that execution of the store instruction becomes non-speculative. Additional details are provided herein.

[0022] Figure 3 is a block diagram of a computer system 300, according to one example. In some examples, computer system 300 is computer system 100 of Figure 1. Computer system 300 includes a processor set 302, one or more system level memories 304, a system memory controller 306, and other system elements 308.

[0023] Processor set 302 includes one or more processor chips 310. Each processor chip 310 includes a processor chip level cache 312 and one or more processor cores 314. Each processor core 314 has an associated core level cache 316. Each of the processor cores 314 includes one or more execution pipelines, such as instruction execution pipeline 200 of FIG. 2.

[0024] The caches and memories shown in FIG. 3 operate in parallel and therefore use coherence protocols to ensure data consistency. One example of such a protocol is the Modified-Exclusive-Shared-Invalid (MESI) protocol. Each cache line contains an indication of one of these four states. The Modified state indicates that the copy of the cache line stored in the particular cache has been modified relative to the copy stored in the backing memory, and therefore the cache line must be written to the backing memory if the cache line is evicted. The Exclusive state indicates that the cache line is stored in the particular cache and not in any other cache at the same level of the hierarchy. Note that a cache line marked as exclusive may be stored at a higher level of the hierarchy. For example, a cache line stored in a level 0 cache in the Exclusive state may also be stored in the level 1 cache immediately above the level 0 cache. The Shared state indicates that the cache line is stored in multiple caches at the same level of the hierarchy. The invalid state indicates that the cacheline is not valid in the particular cache in which it is marked invalid (although another cache may store a valid copy of the cacheline).

[0025] Each processor core 314 has an associated core level cache 316. When a processor core 314 executes a memory operation, such as a load or store operation, the processor core 314 determines whether a cache line that stores data for the memory operation is located in the core level cache 316 associated with the processor core 314. If such a cache line is not located in the core level cache 316, the core level cache 316 attempts to fetch the cache line into the core level cache 316 from a higher level cache, such as the processor chip level cache 312. The processor chip level cache 312 acts as both a higher level cache memory and a controller that manages a coherence protocol for the processor chip level cache 312 and all core level caches 316 in the same processor chip 310. Thus, the processor chip level cache 312 checks itself to determine whether the requested cache line is stored in the processor chip level cache 312 in order to provide the cache line to the requesting processor core 314. The processor chip-level cache 312 provides cache lines to a requesting core 314 either from its own contents or once fetched from a higher-level memory.

[0026] The processor chip level cache 312 manages a coherence protocol for the core level cache 316. In general, the processor chip level cache 312 manages the protocol state of cachelines in the core level cache 316 such that when any cacheline is in an exclusive state in a particular core level cache 316, no other core level cache 316 has that cacheline in any state except an invalid state. Multiple core level caches 316 are permitted to put a cacheline in a shared state.

[0027] The protocol works on a level-by-level basis. More specifically, at each level of the memory hierarchy, each element within that level is permitted to have cache lines in some subset of the protocol's states. In one example, at the processor set 302 level, each chip 310 (and therefore each processor chip level cache 312) is permitted to have cache lines in either a state, such as a shared state or an exclusive state. A controller at a particular level of the hierarchy manages the protocol at that level. Thus, the processor set memory 320 manages the state of the processor chip level cache 312. The processor chip level cache 312 of any particular processor chip 310 manages the state of the core level cache 316, and the system memory controller 306 manages the state of the processor set 302 and other system elements 308 that may store a particular cache line.

[0028] When a processor core 314 executes a store instruction, the processor core 314 requests that the cache line containing the data to be written be placed in an exclusive state in the associated core level cache 316. If the cache line is already in the cache and not in an exclusive state, the request is a request to convert the cache line to an exclusive state. If the cache line is not in the cache, the request is a request to load the cache line into the cache and place the cache line in an exclusive state in the cache. Part of satisfying this request includes requesting that all other caches (other than caches "hierarchically above" the core level cache 316) that store copies of the cache line invalidate their copies of the cache line. A first cache is "hierarchically above" a second cache if a miss in the second cache is serviced from the first cache or from a cache hierarchically above the first cache.

[0029] In the event that a store instruction is executed speculatively, a controller (e.g., a cache controller of core level cache 316) checks a metadata memory (e.g., metadata memory 317) to determine whether the cache line requested to be stored is marked as "questionable." If the cache line is not marked as "questionable," the controller issues a request to the rest of the hierarchy to invalidate the cache line. The "rest of the hierarchy" may include, for example, each of core level caches 316, each processor chip level cache 312, system level memory 304, and other system elements 308, although memories and caches "hierarchically above" the core level cache 316 making the request do not necessarily invalidate their copies since those memories and caches act as backing memories for core level cache 316. The elements receiving the request invalidate their copies of the cache line in response to receiving the request. If the cache line is marked "questionable," the controller does not issue such an invalidation request while the store instruction is being executed speculatively, and issues such an invalidation request in response to the store instruction becoming non-speculatively executed. If a store instruction targeting the "problematic" cache line never becomes non-speculatively executed (e.g., due to incorrect execution of the store instruction), the controller will not issue such an invalidation request for the store instruction.

[0030] The cache controller does not use metadata memory 317 to determine whether to perform such invalidations for store instructions that are not speculatively executed: the controller issues requests to the rest of the hierarchy to invalidate the cache lines of such store instructions, regardless of the contents of metadata memory 317.

[0031] When a cacheline is placed in a cache (e.g., core level cache 316) or when the coherence state of a cacheline already in the cache is changed to be exclusive, the cache controller determines whether this action occurs as a result of speculatively executing a store instruction. In the event that this action occurs as a result of speculatively executing a store instruction, the cache controller puts information (an entry) into metadata memory 317 that includes an index of the cacheline. The cache controller tracks the cacheline to determine whether it ceases to be exclusive before the cacheline is written (e.g., in the MESI protocol, whether the cacheline becomes "invalid" or "shared" before the cacheline's coherence state becomes "changed"). In the event that a cacheline is placed in a cache as a result of non-speculatively executing a store instruction, the cache controller does not update metadata memory 317 for the cacheline (an entry is not created if no entry exists for the cacheline, or an entry is not updated if an entry exists for the cacheline).

[0032] In the event that a cache line is in an exclusive state in the cache and is tracked by the metadata memory 317, the cache controller marks the cache line as "questionable" when the cache line is invalidated or converted to a shared state. In the event that the cache line is converted to a modified state or converted to a shared state before being invalidated, the cache controller marks the cache line as not questionable. The cache controller maintains the metadata information for a cache line even after it has been invalidated or evicted or removed from the cache for some other reason. As described elsewhere herein, in the event that a store instruction is being speculatively executed, the cache controller uses the "questionable" or "not questionable" indication to determine whether to issue an invalidation request to other caches.

[0033] The operations described above with respect to Figure 3 include placing the cache line into a cache. In some examples, this cache is the core level cache 316 of Figure 3. In other examples, any technologically feasible cache is the cache that stores the cache line.

[0034] In various implementations, a "store instruction" is any instruction that writes to memory and therefore requires exclusive access to a cache line.

[0035] 4A-4D show cache operations related to a cache line that is deemed "problematic." In various examples, metadata memory 404 is metadata memory 317 shown in FIG. 3. In various examples, processor core 314 is processor core 314 shown in FIG. 3. In various examples, cache 406 is core level cache 316 of FIG. 3. In various examples, controller 402 is a cache controller for core level cache 316.

[0036] 4A illustrates operations for placing a metadata entry in metadata memory 404, according to one example. According to this operation, processor core 314 speculatively executes store instruction 403. During the course of this execution, processor core 314 requests access to the cache line in exclusive mode from cache controller 402. Cache controller 402 places the cache line in cache 406 in exclusive mode if the cache line is not already in cache 406, otherwise changes the coherence state of the cache line to exclusive if the cache line is already in cache 406. Additionally, metadata memory 404 records that the cache line was brought in as a result of the speculative store.

[0037] It was noted above that speculative execution of a store instruction may result in a cache line being in the cache 406 in an exclusive state. It should be understood that an instruction often includes multiple operations, and that to execute a store instruction, a cache line containing the data to be written by the store instruction is brought into the cache 406, and that the store instruction may, in some cases, convert such a cache line to an exclusive state as necessary. It should be further understood that even a speculatively executed store instruction may result in such a cache line being in the cache 406 in an exclusive state. Thus, FIG. 4A illustrates how speculative execution of a store instruction may result in the metadata memory 404 indicating that the cache line was brought in as a result of speculative execution of a store instruction by placing the cache line in the cache 406 in an exclusive state.

[0038] 4B illustrates operations for updating the metadata memory 404 based on operations on the cache line. Specifically, in the event that the cache controller 402 detects a request to access the cache line by a processor core 314 other than the processor local to the cache controller 402, the cache controller 402 updates the metadata memory 404 to indicate that the cache line is considered "problematic." Note that the request is by a processor core other than the processor core local to the cache controller 402. In other words, the processor core 314 (first processor core 314) whose store instruction caused the generation of the entry in the metadata memory 317 is not the processor core 314 (second processor core 314) requesting access to the cache line. That processor, the second processor core 314, is requesting access to the cache line before the cache line is modified by the first processor core. Thus, fetching the cache line into the cache 316 by the first processor core 314 may be considered overly aggressive. More specifically, the cache line was made exclusive as a result of the store instruction. The "purpose" of a store instruction is to write to its cache line, which is why the cache line is made exclusive. However, if the cache line is made non-exclusive before it is modified, this means that the store instruction could never have written to the cache line that was brought in, and that the original conversion of the cache line to an exclusive state was overly aggressive.

[0039] The second processor requesting access to the cache line is described above. In some examples, the request includes a request to convert the cache line from a shared state to an invalid state or a shared state. In some examples, the invalid state occurs in the event that another processor requests (e.g., to write) the cache line in an exclusive state, and the shared state occurs in the event that another processor requests (e.g., to read) the cache line in a shared state.

[0040] FIG. 4C illustrates an operation in which a store instruction has been speculatively executed and a cache line identified as “problematic” is written to. As described elsewhere herein, the processor core 314, in the course of speculatively executing a store instruction, may cause the cache line to have an exclusive state in which it should be written by the store instruction. This operation provides some performance advantages in the event that execution of the store instruction is determined to be correct and therefore the store instruction becomes non-speculatively executed, since the cache line has been put into an exclusive state sooner than if the processor core 314 had waited for the store instruction to become non-speculative. However, if the cache line is deemed problematic, the processor core 314 does not issue a request to put the cache line into an exclusive state by requesting that other caches invalidate their copies of the cache line. This is because the indication that the cache line is problematic is an indication that in the past, the cache line was converted to an exclusive state in the cache 406 by a speculatively executed store instruction, but was converted to a different state before being written by the store instruction.

[0041] 4D illustrates a store instruction being speculatively executed and writing to a cache line that has not been identified as "suspected." Not being suspected means that either metadata memory 404 does not contain an entry for the cache line, or that metadata memory 404 contains an entry for the cache line that indicates that the cache line is not susceptible. In the event that the cache line is not identified as suspect, cache controller 402 requests other caches 408 to invalidate the cache line, and cache controller 402 places the cache line in cache 406 in an exclusive state, or converts the cache line to an exclusive state if the cache line is already in cache 406.

[0042] The "other caches 408" shown in Figures 4C and 4D include caches other than the cache 406 local to the processor executing the store instruction and caches other than those hierarchically above cache 406. Cache controller 402 requests invalidation of cache line copies in those other caches 408 to gain exclusive access to the cache line being written. Thus, the other caches 408 are caches for processors executing in parallel with processor core 314 shown in Figures 4A-4D.

[0043] 5 is a flow diagram of a method 500 for speculatively executing store instructions, according to one example. Although described with respect to the systems of FIGS. 1-4D, one skilled in the art will understand that any system configured to perform the steps of method 500 in any technically feasible order is within the scope of the present disclosure.

[0044] In step 502, cache controller 402 acquires a cache line that is in an exclusive state as a result of speculative execution of a first store instruction by a first processor. More specifically, a first processor (such as processor core 314) speculatively executes a store instruction and, during such execution, acquires a cache line that is the target of the store instruction. The first processor places the cache line in a local cache, such as core-level cache 316, and records an indication that the cache line was brought in as a result of the speculative store instruction.

[0045] In step 504, in response to an access to the cache line by the second processor, before the cache line is written by the first processor, the first processor records an indication that speculative execution of a store instruction targeting the cache line should not result in invalidation of the cache line in caches associated with processors other than the first processor, such as the second processor. In other words, the first processor 314 records an indication that the first processor should not request invalidation of the cache line in caches other than the cache associated with the first processor when the first processor speculatively executes a store instruction to the cache line because the cache line is considered "problematic." The "other caches" include caches parallel to the cache that is local to the first processor and any caches hierarchically above it. In some examples, the indication is recorded in a metadata memory.

[0046] In step 506, for speculative execution of a second store instruction targeting the cache line, the first processor does not request invalidation of the cache line in the "other cache" in response to the indication recorded in step 504. In step 508, for speculative execution by the first processor of a third store instruction targeting a cache line that does not have the indication (indication) that the cache line is "questionable"), the first processor requests invalidation of the cache line in the other cache.

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

[0048] The various elements illustrated in the figure can be implemented as hardware (e.g., circuitry), software running on a processor, or a combination of hardware and software. In various examples, blocks such as processor memory element 410, processor chip 310, system element 308, system level memory 304, system memory controller 306, processor chip level cache 312, processor set memory 320, processor core 314, core level cache 316, and metadata memory 317, as well as the illustrated units of instruction execution pipeline 200 and computer system 100, can be implemented as hardware (e.g., hardware processors and / or circuitry), software, or a combination thereof. The methods provided can be implemented in a general purpose computer, processor, or processor core. Suitable processors include, by way of example, general purpose processors, special purpose processors, conventional processors, digital signal processors (DSPs), multiple microprocessors, one or more microprocessors associated with a DSP core, controllers, microcontrollers, Application Specific Integrated Circuits (ASICs), Field Programmable Gate Array (FPGA) circuits, any other type of integrated circuit (IC), and / or state machines. Such processors may be manufactured by configuring a manufacturing process using the results of processed hardware description language (HDL) instructions and other intermediate data such as netlists (such instructions may be stored on a computer readable medium). The result of such processing may be a mask work that is used in a subsequent semiconductor manufacturing process to manufacture a processor embodying aspects of the embodiments.

[0049] The methods or flow diagrams provided herein may be implemented in a computer program, software, or firmware embodied in a non-transitory computer-readable storage medium for execution by a general purpose computer or processor. Examples of non-transitory computer-readable storage media include read only memory (ROM), random access memory (RAM), registers, cache memory, semiconductor memory devices, magnetic media such as internal hard disks and removable disks, magneto-optical media, and optical media such as CD-ROM disks and digital versatile disks (DVDs).

Claims

1. 1. A method comprising: recording an indication that providing exclusive access of the first cache line to the first processor is deemed problematic; detecting speculative execution of a store instruction to the first cache line by the first processor; in response to said detecting, denying exclusive access of said first cache line to said first processor based on said indication. method.

2. providing exclusive access of the first cache line to the first processor in response to speculative execution of a second store instruction prior to the store instruction; detecting a request to access the first cache line by a second processor before the first processor writes to the first cache line; recording the indication is in response to detecting a request by the second processor to access the first cache line before the first processor writes to the first cache line.

2. The method of claim 1.

3. providing exclusive access of the first cache line to the first processor includes storing the first cache line in an exclusive state in a first cache associated with the first processor; The method of claim 2.

4. providing exclusive access of the first cache line to the first processor includes changing a coherence state of the first cache line in a first cache associated with the first processor to exclusive; The method of claim 2.

5. providing exclusive access of the first cache line to the first processor includes invalidating a copy of the first cache line in a second cache associated with the second processor. The method of claim 2.

6. the access by the second processor is a read or write to the first cache line, or a request to change the first cache line to a shared state or an invalid state; The method of claim 2.

7. providing exclusive access of the first cache line to the first processor in response to the store instruction becoming non-speculatively executed.

2. The method of claim 1.

8. providing exclusive access of the first cache line to the first processor includes invalidating a copy of the first cache line in a second cache associated with a second processor. The method of claim 7.

9. an access to the first cache line by the second processor before the first processor writes to the first cache line occurs when the coherence state of the first cache line becomes invalid or is shared before the coherence state of the first cache line is changed; The method of claim 2.

10. 1. A system comprising: A first cache; A cache controller, The cache controller recording an indication that providing exclusive access of the first cache line to the first processor is deemed problematic; detecting speculative execution of a store instruction to the first cache line by the first processor; in response to said detecting, denying exclusive access of said first cache line to said first processor based on said indication; 4. The method of claim 3, system.

11. The cache controller providing exclusive access of the first cache line to the first processor in response to speculative execution of a second store instruction prior to the store instruction; detecting a request to access the first cache line by a second processor before the first processor writes to the first cache line; The device is configured to: recording the indication is in response to detecting a request by the second processor to access the first cache line before the first processor writes to the first cache line. The system of claim 10.

12. providing exclusive access of the first cache line to the first processor includes storing the first cache line in the first cache in an exclusive state; The system of claim 11.

13. providing exclusive access of the first cache line to the first processor includes changing a coherence state of the first cache line in the first cache to exclusive. The system of claim 11.

14. providing exclusive access of the first cache line to the first processor includes invalidating a copy of the first cache line in a second cache associated with the second processor. The system of claim 11.

15. the access by the second processor is a read or write to the first cache line, or a request to change the first cache line to a shared state or an invalid state; The system of claim 11.

16. The cache controller and configured to provide exclusive access of the first cache line to the first processor in response to the store instruction becoming non-speculatively executed. The system of claim 10.

17. providing exclusive access of the first cache line to the first processor includes invalidating a copy of the first cache line in a second cache associated with a second processor.

17. The system of claim 16.

18. an access to the first cache line by the second processor before the first processor writes to the first cache line occurs when the coherence state of the first cache line becomes invalid or is shared before the coherence state of the first cache line is changed; The system of claim 11.

19. 1. A system comprising: a first cache associated with the first processor; a second cache associated with the second processor; A cache controller, The cache controller recording an indication that providing exclusive access of the first cache line to the first processor is deemed problematic; detecting speculative execution of a store instruction to the first cache line by the first processor; in response to said detecting, denying exclusive access of said first cache line to said first processor based on said indication; 4. The method of claim 3, system.

20. The cache controller providing exclusive access of the first cache line to the first processor in response to speculative execution of a second store instruction prior to the store instruction; detecting a request to access the first cache line by a second processor before the first processor writes to the first cache line; The device is configured to: recording the indication is in response to detecting a request by the second processor to access the first cache line before the first processor writes to the first cache line.

20. The system of claim 19.

Citation Information

Patent Citations

  • Method and Apparatus for Implementing Virtual Transactional Memory Using Cache Line Marking

    US20090019231A1