# US 2010/0169579 A1 · Read and write monitoring attributes in transactional memory (tm) systems

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2010/0169579 A1
- Document ID: US20100169579A1
- Status: Published application
- Kind: A1
- Application number: 12/346,530
- Filed: 2008-12-30
- Published: 2010-07-01
- Earliest claimed: 2008-12-30
- Assignees: Intel Corporation
- Inventors: Gad Sheaffer; Shlomo Raikin; Vadim Bassin; Raanan Sade; Ehud Cohen; Oleg Margulis
- Web page: https://patentgrep.com/patent/US20100169579A1

## CPC

- G06F 12/0831: using a bus scheme, e.g. with bus monitoring or watching means
- G06F 12/084: with a shared cache
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and apparatus for monitoring memory accesses in hardware to support transactional execution is herein described. Attributes are monitor accesses to data items without regard for detection at physical storage structure granularity, but rather ensuring monitoring at least at data items granularity. As an example, attributes are added to state bits of a cache to enable new cache coherency states. Upon a monitored memory access to a data item, which may be selectively determined, coherency states associated with the data item are updated to a monitored state. As a result, invalidating requests to the data item are detected through combination of the request type and the monitored coherency state of the data item.

## Claims

### Claim 1

An apparatus comprising:
execution logic to execute a transactional memory access operation referencing a memory address associated with a data item;
a memory coupled to the processing logic to hold the data item in response to the execution logic to execute the transactional memory access operation; and
hardware monitors associated with the memory to perform bounded access monitoring of the data item despite a granularity of the memory in response to the execution logic executing the transactional memory access operation.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein hardware monitors are to be readable and modifiable in response to the execution logic executing user-level instructions.

### Claim 3 (depends on 1)

The apparatus of claim 1, wherein the memory includes a data cache, and wherein hardware monitors associated with the data cache include a plurality of read monitors and a plurality of write monitors corresponding to a plurality of cache lines of the data cache.

### Claim 4 (depends on 3)

The apparatus of claim 3, wherein a number of cache lines of the plurality of cache lines of the data cache are to hold the data item unaligned with boundaries of the plurality of cache lines.

### Claim 5 (depends on 4)

The apparatus of claim 4, wherein the transactional memory access operation includes a transactional load, and wherein the hardware monitors associated with the data cache to perform bounded access monitoring of the data item despite a granularity of the memory in response to the execution logic executing the transactional load comprises a number of read monitors of the plurality of read monitors, which correspond to the number of cache lines of the plurality of cache lines holding at least a portion of the data item, to be updated to a monitored read state in response to the execution logic executing the transactional load.

### Claim 6 (depends on 5)

The apparatus of claim 5, wherein the transactional memory access operation includes a transactional store, and wherein the hardware monitors associated with the data cache to perform bounded access monitoring of the data item despite a granularity of the memory in response to the execution logic executing the transactional store comprises a number of write monitors of the plurality of write monitors, which correspond to the number of cache lines of the plurality of cache lines holding at least a portion of the data item, to be updated to a monitored write state in response to the execution logic executing the transactional write.

### Claim 7 (depends on 6)

The apparatus of claim 6, wherein control logic is to detect a transactional conflict in response to the control logic detecting an external write request to a cache line of the number of cache lines when a read monitor of the number of read monitors corresponding to the cache line is updated to the monitored read state.

### Claim 8 (depends on 6)

The apparatus of claim 6, wherein the control logic is to detect a transactional conflict in response to the control logic detecting an external read request from a cache line of the number of cache lines when a write monitor of the number of write monitors corresponding to the cache line is updated to the monitored write state.

### Claim 9 (depends on 6)

The apparatus of claim 6, wherein the number of read monitors and the number of write monitors are to be reset to an unmonitored state in response to the execution logic executing a user-level clear operation.

### Claim 10 (depends on 6)

The apparatus of claim 6, wherein the number includes an integer greater than one.

### Claim 11 (depends on 1)

The apparatus of claim 1, wherein the hardware monitors are to be associated with the memory dynamically based on a size of the data item.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein the hardware monitors are to be associated with the memory dynamically based on a size of the data item comprises logic to dynamically assign a read monitor and a write monitor from a pool of read monitors and write monitors to a plurality of lines of the memory, which are to hold at least a portion of the data item, responsive to the size of the data item being greater than a line of the memory and the execution logic executing the transactional memory access operation.

### Claim 13 (depends on 12)

The apparatus of claim 12, wherein hardware monitors associated with the memory to perform bounded access monitoring of the data item despite a granularity of the memory in response to the execution logic executing the transactional memory access operation comprises the read monitor assigned to the plurality of lines being set to a read monitored state in response to the execution logic executing the a transactional load operation and the write monitor assigned to the plurality of liens being set to a write monitored state in response to the execution logic executing a transactional store operation.

### Claim 14

A processor comprising:
a user-accessible register to hold a non-selective value to indicate a non-selective mode of operation of the processor and a selective value to indicate a selective mode of operation of the processor;
control logic coupled to the user-accessible register to determine if a memory access operation is to be monitored based on a selection criteria in response to the user-accessible register holding the selective value; and
a hardware attribute to track the memory access operation to memory in response to the user-accessible register holding the non-selective value or the control logic determining the memory access operation is to be monitored based on the selection criteria.

### Claim 15 (depends on 14)

The apparatus of claim 14, wherein the hardware attribute is to be associated with a cache memory to hold a data element associated with a memory address referenced by the memory access operation, and wherein the hardware attribute to track the memory access operation to memory comprises the hardware attribute to be updated to an accessed state to indicate the data element has been accessed in response to the processor performing the memory access operation.

### Claim 16 (depends on 14)

The apparatus of claim 14, wherein the non-selective value includes a first logical value and the selective value includes a second logical value.

### Claim 17 (depends on 14)

The apparatus of claim 14, wherein the selection criteria includes an opcode recognizable by decode logic to indicate an operation is to be monitored, and wherein the control logic to determine if a memory access operation is to be monitored based on the opcode comprises the decode logic detecting the opcode being associated with the memory access operation.

### Claim 18 (depends on 14)

The apparatus of claim 14, wherein the selection criteria includes a criteria selected from a group consisting of a range of virtual addresses, a range of physical addresses, a memory type, an input/output (I/O) address space, a protected domain address space, an opcode, a prefix, and a data type. to be specified by user-level software in a second user-accessible register

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein the control logic to determine if a memory access operation is to be monitored based on a selection criteria comprises comparing a criteria associated with the memory access operation with the selection criteria and determining the memory access operation is to be monitored based on the comparison of the criteria to the selection criteria.

### Claim 20 (depends on 18)

The apparatus of claim 18, wherein the selection criteria is to be specified by user-level software in a second user-accessible register.

### Claim 21

An apparatus comprising:
logic to encounter a memory access operation referencing a memory address associated with a data item that is to be monitored;
a data array of a cache memory including a plurality of lines, wherein a number of lines of the plurality of lines is to hold the data item responsive to the logic encountering the memory access operation; and
a coherency state array of the cache memory including a state entry corresponding to each of the plurality of lines, wherein each of the state entries, which correspond to the number of lines to hold the data item, are to be updated to represent a monitored coherency state in response to the first number of lines to holding the data item.

### Claim 22 (depends on 21)

The apparatus of claim 21, wherein the monitored coherency state includes a coherency state selected from a group consisting of a modified read (MR) state, a modified write (MW) state, a modified read write (MRW) state, an exclusive read (ER) state, and a shared read (SR) state.

### Claim 23 (depends on 22)

The apparatus of claim 22, wherein a state entry associated with a line that is not one of the number of lines to represent an unmonitored state, and wherein the unmonitored state includes a Modified Exclusive Shared and Invalid (MESI) state.

### Claim 24 (depends on 21)

The apparatus of claim 21, control logic associated with the cache memory to detect a conflict in response to receiving an external access request that conflicts with the monitored coherency state.

### Claim 25 (depends on 24)

The apparatus of claim 24, wherein an external access request that conflicts with the monitored coherency state comprises the external access request including an external write request and the monitored coherency state including a read version of a Modified Exclusive Shared Invalid (MESI) state.

### Claim 26 (depends on 24)

The apparatus of claim 24, further comprising a status register to be updated to a conflict value by the control logic in response to the control logic detecting the conflict.

### Claim 27 (depends on 21)

The apparatus of claim 21, wherein a memory access operation referencing a memory address associated with a data item that is to be monitored is to be identified in user-level software as a memory access operation to be monitored.

### Claim 28 (depends on 27)

The apparatus of claim 27, wherein the logic to encounter the memory access operation includes decoder logic.

### Claim 29 (depends on 21)

The apparatus of claim 21, wherein the number of lines includes a number of lines greater than one.

### Claim 30

A system comprising:
a processor including
a cache memory to hold a data item referenced by a transactional memory access operation to be executed by the processor;
hardware attributes associated with the cache memory to represent an access state of the data item at a granularity of the data item unaligned from lines of the cache memory in response to the processor executing the memory access operation, wherein the access state is to be associated with a type of the transactional memory access operation; and
a system memory to be coupled to the processor to hold an un-cached copy of the data item.

### Claim 31 (depends on 30)

The system of claim 30, wherein the access state to be associated with the type of the transactional memory access operation includes a transactionally read state in response to the type of the transactional memory access being a load type and a transactionally written state in response to the type of the transactional memory access being a store type.

### Claim 32 (depends on 30)

The system of claim 30, wherein the hardware attributes associated with the cache memory to represent an access state are selected from a group consisting of a bit vector, an encoded value, and a state value.

### Claim 33 (depends on 30)

The system of claim 30, wherein the hardware attributes include hardware attributes to be associated with a first thread to represent the access state of the data item for the first thread at the granularity of the data item unaligned from lines of the cache memory in response to the first thread of the processor executing the memory access operation, and wherein the hardware attributes are replicated to be associated with a second thread that shares access to the cache memory to represent a second access state of the data item for the second thread at the granularity of the data item unaligned from lines of the cache memory in response to the first thread of the processor executing a second memory access operation referencing the data item.

### Claim 34

A method comprising:
determining if a memory access operation referencing a data item is to be monitored;
caching the data item in a number of lines of a cache; and
in response to determining the memory access operation is to be monitored,
determining hardware attributes associated with the cache to bound the data item; and
updating the hardware attributes to represent an access state associated with a type of the memory access operation.

### Claim 35 (depends on 34)

The method of claim 34, wherein determining if a memory access operation referencing a data item is to be monitored is based on an operating mode of a processor to execute the memory access operation.

### Claim 36 (depends on 34)

The method of claim 34, wherein determining if a memory access operation referencing a data item is to be monitored is based on an identification by user-level software of the memory access operation as an operation to be monitored.

### Claim 37 (depends on 34)

The method of claim 34, wherein determining hardware attributes associated with the cache to bound the data item comprises dynamically assigning the hardware attributes to be associated with the data item unaligned with the number of lines.

### Claim 38 (depends on 34)

The method of claim 34, wherein determining hardware attributes associated with the cache to bound the data item comprises determining hardware attribute bits within coherency state entries associated with the number of lines, and wherein updating the hardware attributes to represent an access state associated with a type of the memory access operation comprises updating the hardware attribute bits within coherency state entries associated with number of lines to represent a monitored coherency state associated with the type of the memory access operation.

### Claim 39 (depends on 34)

The method of claim 34, wherein the access state associated with the type of the memory access operation includes a monitored read state in response to the type of the memory access operation including a read type and a monitored write state in response to the type of the memory access operation including a write type.

### Claim 40 (depends on 34)

The method of claim 34, further comprising:
detecting a conflict in response to an external access request subsequent to execution of the memory access operation based on a type of the external access and the access state associated with a type of the memory access operation;
reporting the conflict utilizing a status register in the processor to software in response to detecting the conflict; and
executing a software handler to handle the conflict in response to reporting the conflict utilizing a status register in the processor to software
