# US 2012/0084514 A1 · Locking a cache line for write operations on a bus

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

- Number: US 2012/0084514 A1
- Document ID: US20120084514A1
- Status: Published application
- Kind: A1
- Application number: 12/897,555
- Filed: 2010-10-04
- Published: 2012-04-05
- Earliest claimed: 2010-10-04
- Assignees: International Business Machines Corporation
- Inventors: Stephen L. Blinick; Charles S. Cardinell; Roger G. Hathorn; Bernhard Laubli; Miguel A. Montoya; Timothy J. Van Patten
- Web page: https://patentgrep.com/patent/US20120084514A1

## CPC

- G06F 12/0879: Burst mode
- G06F 12/0802: Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F 12/0804: with main memory updating (G06F12/0806 takes precedence)
- G06F 12/0833: {in combination with broadcast means (e.g. for invalidation or updating)}
- G06F 12/0891: using clearing, invalidating or resetting means
- G06F 12/1009: using page tables, e.g. page table structures
- G06F 12/127: using additional replacement algorithms
- G06F 12/1475: {in a virtual system, e.g. with translation means}
- G06F 2212/1052: Security improvement
- G06F 2212/303: In peripheral interface, e.g. I/O adapter or channel
- G06F 2212/604: Details relating to cache allocation
- G06F 2212/62: Details of cache specific to multiprocessor cache arrangements
- G06F 2212/657: Virtual address space management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided are a computer program product, system, and method for locking a cache line for a burst write operations on a bus. A cache line is allocated in a cache for a target address. A lock is set for the cache line, wherein setting the lock prevents the data in the cache line from being cast out. Data is written to the cache line. All the data in the cache line is flushed to the target address over a bus in response to completing writing to the cache line.

## Claims

### Claim 1

A computer program product for bursting writes in a cache, the computer program product comprising a computer readable storage medium having computer readable program code embodied therein that executes to perform operations, the operations comprising:
allocating a cache line in cache for a target address;
setting a lock for the cache line, wherein setting the lock prevents the data in the cache line from being cast out;
writing data to the cache line; and
flushing all the data in the cache line to the target address over a bus in response to completing writing to the cache line.

### Claim 2 (depends on 1)

The computer program product of claim 1, wherein the data in the cache line is flushed as part of a burst write to the target address.

### Claim 3 (depends on 1)

The computer program product of claim 1, wherein the operations further comprise:
removing the lock on the cache line in response to flushing the data in the cache line.

### Claim 4 (depends on 1)

The computer program product of claim 1, wherein the operations further comprise:
saving data in the cache line to a buffer before writing to the cache line; and
copying the data from the buffer to the cache line after flushing all the data in the cache line to the target address.

### Claim 5 (depends on 1)

The computer program product of claim 1, wherein the operations further comprise:
removing the lock on the cache line in response to flushing the data in the cache line;
allocating the cache line in the cache for the target address in response to removing the lock on the cache line; and
setting a lock for the cache line, wherein setting the lock prevents the data in the cache line from being cast out.

### Claim 6 (depends on 5)

The computer program product of claim 5, wherein a process performs the operations of allocating the cache line, setting the lock, and writing the data to the cache line, wherein the operations further comprise:
receiving, by a process, an interrupt to write to the target address while writing the data to the cache line;
halting, by the process, the writing of the data to the cache line in response to the interrupt;
performing, by an interrupt handler, the operations of allocating the cache line, setting the lock, writing the data to the cache line, and flushing all the data in the cache line, removing the lock, allocating the cache line in response to removing the lock, and locking the cache line;
continuing, by the process, the writing of the data for the target address to the cache line in response to the interrupt handler performing the operations; and
flushing, by the process, all the data in the cache line in response to completing the writing of the data to the cache line.

### Claim 7 (depends on 6)

The computer program product of claim 6, wherein the operations further comprise:
saving, by the interrupt handler, data in the cache line, written by the process, to a buffer before writing the data to the cache line; and
copying, by the interrupt handler, the data in the buffer to the cache line, wherein the process continues the writing of the data for the target address after the interrupt handler copies the data in the buffer to the cache line and removes the lock.

### Claim 8 (depends on 1)

The computer program product of claim 1, wherein the operations further comprise:
recording the target address;
performing error handling;
executing a command to invalidate the data in the cache line allocated to the recorded target address in response to the performing of the error handling.

### Claim 9

A method, comprising:
allocating a cache line in a cache for a target address;
setting a lock for the cache line, wherein setting the lock prevents the data in the cache line from being cast out;
writing data to the cache line; and
flushing all the data in the cache line to the target address over a bus in response to completing writing to the cache line.

### Claim 10 (depends on 9)

The method of claim 9, further comprising:
removing the lock on the cache line in response to flushing the data in the cache line.

### Claim 11 (depends on 9)

The method of claim 9, further comprising:
saving data in the cache line to a buffer before writing to the cache line; and
copying the data from the buffer to the cache line after flushing all the data in the cache line to the target address.

### Claim 12 (depends on 9)

The method of claim 9, further comprising:
removing the lock on the cache line in response to flushing the data in the cache line;
allocating the cache line in the cache for the target address in response to removing the lock on the cache line; and
setting a lock for the cache line, wherein setting the lock prevents the data in the cache line from being cast out.

### Claim 13 (depends on 12)

The method of claim 12, wherein a process performs the operations of allocating the cache line, setting the lock, and writing the data to the cache line, further comprising:
receiving, by a process, an interrupt to write to the target address while writing the data to the cache line;
halting, by the process, the writing of the data to the cache line in response to the interrupt;
performing, by an interrupt handler, the operations of allocating the cache line, setting the lock, writing the data to the cache line, and flushing all the data in the cache line, removing the lock, allocating the cache line in response to removing the lock, and locking the cache line;
continuing, by the process, the writing of the data for the target address to the cache line in response to the interrupt handler performing the operations; and
flushing, by the process, all the data in the cache line in response to completing the writing of the data to the cache line.

### Claim 14 (depends on 9)

The method of claim 9, further comprising:
recording the target address;
performing error handling;
executing a command to invalidate the data in the cache line allocated to the recorded target address in response to the performing of the error handling.

### Claim 15

A system in communication with an external device over a bus, comprising:
a processor;
a cache;
a computer readable storage medium having instructions executed by the processor to perform operations, the operations comprising:
allocating a cache line in the cache for a target address at the external device;
setting a lock for the cache line, wherein setting the lock prevents the data in the cache line from being cast out;
writing data to the cache line; and
flushing all the data in the cache line to the target address over the bus to the external device in response to completing writing to the cache line.

### Claim 16 (depends on 15)

The system of claim 15, wherein the operations further comprise:
removing the lock on the cache line in response to flushing the data in the cache line.

### Claim 17 (depends on 15)

The system of claim 15, wherein the operations further comprise:
saving data in the cache line to a buffer before writing to the cache line; and
copying the data from the buffer to the cache line after flushing all the data in the cache line to the target address.

### Claim 18 (depends on 15)

The system of claim 15, wherein the operations further comprise:
removing the lock on the cache line in response to flushing the data in the cache line;
allocating the cache line in the cache for the target address in response to removing the lock on the cache line; and
setting a lock for the cache line, wherein setting the lock prevents the data in the cache line from being cast out.

### Claim 19 (depends on 18)

The system of claim 18, wherein a process performs the operations of allocating the cache line, setting the lock, and writing the data to the cache line, wherein the operations further comprise:
receiving, by a process, an interrupt to write to the target address while writing the data to the cache line;
halting, by the process, the writing of the data to the cache line in response to the interrupt;
performing, by an interrupt handler, the operations of allocating the cache line, setting the lock, writing the data to the cache line, and flushing all the data in the cache line, removing the lock, allocating the cache line in response to removing the lock, and locking the cache line;
continuing, by the process, the writing of the data for the target address to the cache line in response to the interrupt handler performing the operations; and
flushing, by the process, all the data in the cache line in response to completing the writing of the data to the cache line.

### Claim 20 (depends on 15)

The system of claim 15, wherein the operations further comprise:
recording the target address;
performing error handling;
executing a command to invalidate the data in the cache line allocated to the recorded target address in response to the performing of the error handling.

### Claim 21 (depends on 15)

The system of claim 15, wherein the cache, the processor, and the computer readable storage medium are in an Input/Output (I/O) device wherein the I/O device connects on the bus to the external device, and wherein the data in the cache line is flushed in a burst write over the bus to the external device.

### Claim 22 (depends on 15)

The system of claim 15, wherein the cache, the processor, and the bus are in an Input/Output (I/O) device, wherein the external device comprises a hardware component in the I/O device, and wherein the data in the cache line is flushed in a burst write to the hardware component in the I/O device.
