# US 2013/0254488 A1 · System and method for simplifying cache coherence using multiple write policies

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

- Number: US 2013/0254488 A1
- Document ID: US20130254488A1
- Status: Published application
- Kind: A1
- Application number: 13/793,521
- Filed: 2013-03-11
- Published: 2013-09-26
- Earliest claimed: 2012-03-20
- Inventors: Stefanos Kaxiras; Alberto Ros
- Web page: https://patentgrep.com/patent/US20130254488A1

## CPC

- G06F 12/0815: Cache consistency protocols
- G06F 9/3004: {to perform operations on memory}
- G06F 12/0897: with two or more cache hierarchy levels (with multilevel cache hierarchies G06F12/0811)
- G06F 12/0811: with multilevel cache hierarchies
- G06F 12/0837: with software control, e.g. non-cacheable data
- G06F 12/084: with a shared cache
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

System and methods for cache coherence in a multi-core processing environment having a local/shared cache hierarchy. The system includes multiple processor cores, a main memory, and a local cache memory associated with each core for storing cache lines accessible only by the associated core. Cache lines are classified as either private or shared. A shared cache memory is coupled to the local cache memories and main memory for storing cache lines. The cores follow a write-back to the local memory for private cache lines, and a write-through to the shared memory for shared cache lines. Shared cache lines in local cache memory enter a transient dirty state when written by the core. Shared cache lines transition from a transient dirty to a valid state with a self-initiated write-through to the shared memory. The write-through to shared memory can include only data that was modified in the transient dirty state.

## Claims

### Claim 1

A computer system comprising:
multiple processor cores;
a main memory;
at least one local cache memory associated with and operatively coupled to each core for storing cache lines accessible only by the associated core, each of the cache lines being classified as either a shared cache line or a private cache line; and
a global cache memory, the global cache memory being operatively coupled to the local cache memories and main memory and accessible by the cores, the global cache memory being capable of storing a plurality of cache lines, and wherein when a core writes a cache line, the core performs a write-back to the associated local cache memory if the cache line is a private cache line and a write-through to the global cache memory if the cache line is a shared cache line.

### Claim 2 (depends on 1)

The computer system of claim 1, wherein individual shared cache lines are in a valid state, an invalid state, or a transient dirty state, and wherein a shared cache line in a local cache memory transitions to the transient dirty state from the valid state or the invalid state when the cache line is written by the associated core, and wherein a shared cache line in the transient dirty state transitions to the valid state with a self-initiated write-through to the global cache memory.

### Claim 3 (depends on 2)

The computer system of claim 2, wherein the self-initiated write-through to the global cache memory is arranged to occur at a period of time after the shared cache line transitions to the transient dirty state.

### Claim 4 (depends on 2)

The computer system of claim 2, wherein a shared cache line which is in the valid state in a local cache memory associated with a first core transitions to the invalid state when a second core writes the shared cache line.

### Claim 5 (depends on 2)

The computer system of claim 2, wherein each core transitions a subset of the shared cache lines in the associated local cache memories which are in the valid state to the invalid state before the core encounters a processing event.

### Claim 6 (depends on 5)

The computer system of claim 5, wherein every shared cache line in the local cache memory which is in the transient dirty state is transitioned to either the invalid state or the valid state before the associated core encounters a processing event.

### Claim 7 (depends on 6)

The computer system of claim 6, wherein the self-initiated write-through of a shared cache line in a local cache memory which is in the transient dirty state updates the global cache memory with only the data in the shared cache line that has been written by the associated core while the shared cache line is in the transient dirty state.

### Claim 8 (depends on 6)

The computer system of claim 6, wherein the shared cache lines in the local cache memories are further classified as read-only cache lines and read-write cache lines, and wherein the shared read-only cache lines in a local cache memory which are in the valid state remain in the valid state when the associated core encounters a processing event.

### Claim 9 (depends on 7)

The computer system of claim 7, wherein the shared cache lines in the local cache memories are further classified into read-only cache lines and read-write cache lines, and wherein the shared read-only cache lines in a local cache memory which are in the valid state remain in the valid state when the associated core encounters a processing event.

### Claim 10 (depends on 8)

The computer system of claim 8, wherein the processing event is a synchronization event.

### Claim 11 (depends on 9)

The computer system of claim 9, wherein the processing event is a synchronization event.

### Claim 12 (depends on 2)

The computer system according to claim 2, wherein for a subset of core accesses to a shared cache line, the core bypasses the local cache memory and reads the shared cache line directly from the global cache memory.

### Claim 13 (depends on 12)

The computer system of claim 12, wherein the shared cache line is blocked in the global cache memory while the core reads the shared cache line, and no request from another core can be processed by the global cache memory for the shared cache line until the shared cache line is unblocked by a write-through from the core.

### Claim 14 (depends on 13)

The computer system according to claim 13, wherein the subset of the accesses of a core to a shared cache line are atomic instructions.

### Claim 15

A method of implementing cache coherency in a computer system having multiple processor cores, the method comprising:
associating at least one local cache memory with each core for storing data accessible only by the associated core, the data being allocated to one or more cache lines acted upon by the associated core;
providing a global cache memory, the global cache memory being associated with each of the local cache memories for storing cache lines accessible by all of the cores;
classifying each of the cache lines in each local cache memory as a private cache line or a shared cache line;
performing a write-back operation to the associated local cache memory when a core writes a private cache line; and
performing a write-through operation to the global cache memory when a core writes a shared cache line.

### Claim 16 (depends on 15)

The method of claim 15, further comprising the steps of:
classifying each shared cache line to either an invalid state or a valid state;
changing the state of a shared cache line in a local cache memory to a transient dirty state, from either the valid or invalid state, when the shared cache line is written by the associated core; and
performing a self-initiated write-through of the shared cache line from the local cache memory to the global cache memory at a period of time after the shared cache line changes to the transient dirty state.

### Claim 17 (depends on 15)

The method of claim 15, further comprising the steps of:
classifying each shared cache line to either an invalid state or a valid state; and
changing the state of any shared cache line in a local cache memory associated with a first core from the valid state to the invalid state when a second core writes the shared cache line to a local cache memory associated with the second core.

### Claim 18 (depends on 16)

The method of claim 16, further comprising the steps of selecting one or more of the shared cache lines in a local cache memory which are in the valid state, and transitioning the selected shared cache lines to an invalid state before the core associated with the local cache memory encounters a processing event.

### Claim 19 (depends on 18)

The method of claim 18, wherein the transitioning step further comprises selecting every shared cache line in the local cache memory in the transient dirty state and transitioning the selected shared cache lines from the transient dirty state to either the invalid state or the valid state before the core associated with the local cache memory encounters a processing event.

### Claim 20 (depends on 16)

The method of claim 16, wherein the step of performing a self-initiated write-through of the shared cache line from the local cache memory to the global cache memory further comprises determining the data in the shared cache line modified by the associated core while the shared cache line is in the transient dirty state, and writing only the modified data in the shared cache line to the global cache memory.

### Claim 21 (depends on 18)

The method of claim 18, further comprising the steps of classifying the shared cache lines in each local cache memory as read-only cache lines or read-write cache lines, identifying a set of the shared read-only cache lines in each local cache memory which are in the valid state, and retaining the set of valid shared read-only cache lines in the valid state when the associated core encounters a processing event.

### Claim 22 (depends on 20)

The method of claim 20, further comprising the steps of classifying the shared cache lines in each local cache memory as read-only cache lines or read-write cache lines, identifying a set of the shared read-only cache lines in each local cache memory which are in the valid state, and retaining the set of valid shared read-only cache lines in the valid state when the associated core encounters a processing event.

### Claim 23 (depends on 16)

The method of claim 16, wherein for a subset of core accesses to a shared cache line the core bypasses the local cache memory and reads the shared cache line directly from the global cache memory.

### Claim 24 (depends on 23)

The computer system of claim 23, wherein the shared cache line is blocked in the global cache memory while the core reads the shared cache line, and no request from another core can be processed by the global cache memory for the shared cache line until the shared cache line is unblocked by a write-through.

### Claim 25 (depends on 24)

The computer system according to claim 24, wherein the subset of core accesses to a shared cache line are atomic instructions.

### Claim 26

A method of implementing cache coherency in a computer system having multiple processor cores, the method comprising:
associating at least one local cache memory with each core for storing data accessible by the associated core, the data being allocated to one or more cache lines acted upon by the associated core, each cache line having either a valid state or an invalid state;
providing a global cache memory, the global cache memory being associated with each of the local cache memories, the global cache memory storing data accessible by all of the cores, the data being allocated to one or more cache lines;
classifying each of the cache lines as a private cache line or a shared cache line; and
selecting between different write operations when a core writes a cache line, the selection including performing a write-back to the associated local cache memory when a core writes a private cache line and performing a write-through to the shared cache memory when a processor writes a shared cache line, and wherein the write-through operation can be delayed up to a synchronization event.

### Claim 27 (depends on 26)

The method of claim 26, wherein the shared cache line is blocked at the global cache memory during the write-through delay, allowing the core to repetitively write to the shared cache line during the delay, and wherein the shared cache line including all core writes is written through to the global cache memory at the end of the delay.

### Claim 28 (depends on 27)

The method of claim 27, further comprising the steps of determining the data modified in the shared cache line by the core during the write-through delay, and writing-through to the global cache memory only the modified data in the shared cache line.

### Claim 29 (depends on 26)

The method of claim 26, where the step of classifying the individual cache lines is performed by an operating system and includes designating the individual cache lines as private or shared at a page level using observed data accesses.

### Claim 30 (depends on 26)

The method of claim 26, wherein the write-through of the shared cache line to the global cache memory occurs after a period of time starting after the first write by the core to the shared cache line.
