# US 2021/0081202 A1 · Persistent transactional memory metadata-based buffer caches

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

- Number: US 2021/0081202 A1
- Document ID: US20210081202A1
- Status: Published application
- Kind: A1
- Application number: 17/108,258
- Filed: 2020-12-01
- Published: 2021-03-18
- Earliest claimed: 2017-08-15
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Unmesh Rathi; Arjun Sharma; Suresh Kumar Neelakanda Iyer; Vijayan Satyamoorthy Srinivasa
- Web page: https://patentgrep.com/patent/US20210081202A1

## CPC

- G06F 9/30047: {Prefetch instructions; cache control instructions}
- G06F 9/467: {Transactional memory (G06F9/528 takes precedence)}
- G06F 9/526: {Mutual exclusion algorithms}
- G06F 11/1446: Point-in-time backing up or restoration of persistent data
- G06F 11/1474: in transactions (updating of structured data in databases G06F16/23)
- G06F 2201/84: Using snapshots, i.e. a logical point-in-time copy of the data
- G06F 2201/87: Monitoring of transactions
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques for providing high-performance buffer caches for transactional input/output (I/O) systems are disclosed. The techniques include obtaining a first logical creation time of a resource to be acquired by the first transaction during a pre-commit phase of a first transaction with an I/O system. When the first logical creation time exceeds a latest logical creation time from a set of resources previously acquired by the first transaction, the first logical creation time of the resource is compared with an earliest logical termination time from the set of resources. When the first logical creation time of the resource exceeds the earliest logical termination time from the set of resources, a conflict between the resource and the set of resources is detected, and a restart of the first transaction is triggered.

## Claims

### Claim 1

A non-transitory computer readable medium comprising instructions which, when executed by one or more hardware processors, causes performance of operations comprising:
processing a set of transactions that read and write to an input/output (I/O) system by caching data from a set of blocks on a storage device in a set of buffers;
storing a set of logical creation times and a set of logical termination times for the data in a set of buffer headers for the set of buffers;
during execution of a transaction in the set of transactions, tracking a latest logical creation time and an earliest logical termination time for a first subset of the buffers acquired by the transaction based on a subset of the logical creation times and a subset of the logical termination times in a subset of the buffer headers for the first subset of buffers; and
performing one or more conflict checks using the latest logical creation time and the earliest logical termination time prior to completing the transaction.

### Claim 2 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
maintaining a first set of mappings between read-only virtual addresses and physical addresses for a second subset of the buffers; and
during execution of a read transaction with the I/O system, generating a read result by accessing one or more buffers in the second subset of buffers based on the first set of mappings.

### Claim 3 (depends on 2)

The medium of claim 2, wherein the operations further comprise:
maintaining a second set of mappings between writable virtual addresses and physical addresses for a third subset of the buffers; and
updating the second set of mappings to include a virtual address and a physical address of a private buffer used by a write transaction.

### Claim 4 (depends on 3)

The medium of claim 3, wherein the operations further comprise:
copying a resource from a first public buffer to the private buffer; and
invalidating the first public buffer by setting a logical termination time of the first public buffer to a current state of the I/O system.

### Claim 5 (depends on 4)

The medium of claim 4, wherein the operations further comprise:
after the private buffer is modified by the write transaction, converting the private buffer into a second public buffer by changing the virtual address from writable to read-only; and
setting a logical creation time of the second public buffer to a logical time that is after a time at which the write transaction was initiated.

### Claim 6 (depends on 5)

The medium of claim 5, wherein the operations further comprise:
updating the current state of the I/O system to the logical creation time of the second public buffer.

### Claim 7 (depends on 1)

The medium of claim 1, wherein performing the one or more conflict checks comprises:
when a first logical creation time of a first buffer to be acquired by the transaction exceeds the latest logical creation time of the first subset of buffers, comparing the first logical creation time of the first buffer with the earliest logical termination time for the first subset of buffers; and
when the first logical creation time does not exceed the earliest logical termination time for the first subset of buffers, adding the first buffer to the first subset of buffers and updating the latest logical creation time of the first subset of buffers to the first logical creation time of the first buffer.

### Claim 8 (depends on 7)

The medium of claim 7, wherein performing the one or more conflict checks further comprises:
after acquisition of the first subset of buffers is complete, verifying that a first logical termination time of the first buffer does not precede a current state of the I/O system.

### Claim 9 (depends on 8)

The medium of claim 8, wherein performing the one or more conflict checks further comprises:
after the transaction acquires a lock on the I/O system, verifying that the first logical termination time of the first buffer does not precede the current state of the I/O system.

### Claim 10 (depends on 1)

The medium of claim 1, wherein performing the one or more conflict checks comprises:
when a conflict is detected during a conflict check, triggering a restart of the transaction.

### Claim 11 (depends on 10)

The medium of claim 10, wherein performing the one or more conflict checks further comprises:
tracking a number of restarts of the transaction; and
when the number of restarts exceeds a threshold, holding a lock on the I/O system for a duration of the transaction.

### Claim 12 (depends on 11)

The medium of claim 11, wherein performing the one or more conflict checks further comprises:
adjusting the threshold based on at least one of an average number of transaction restarts, a priority of the transaction, and a policy associated with concurrency control in the I/O system.

### Claim 13 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
during generation of a snapshot of the I/O system, incrementing a logical time representing the current state of the I/O system; and
setting a creation time of the snapshot to the incremented logical time.

### Claim 14 (depends on 13)

The medium of claim 13, wherein the operations further comprise:
after the snapshot is created, performing a copy-on-write (COW) of a resource with a creation time that is less than the creation time of the snapshot prior to modifying the resource.

### Claim 15

A method, comprising:
processing a set of transactions that read and write to an input/output (I/O) system by caching data from a set of blocks on a storage device in a set of buffers;
storing a set of logical creation times and a set of logical termination times for the data in a set of buffer headers for the set of buffers;
during execution of a transaction in the set of transactions, tracking a latest logical creation time and an earliest logical termination time for a first subset of the buffers acquired by the transaction based on a subset of the logical creation times and a subset of the logical termination times in a subset of the buffer headers for the first subset of buffers; and
performing one or more conflict checks using the latest logical creation time and the earliest logical termination time prior to completing the transaction.

### Claim 16 (depends on 15)

The method of claim 15, wherein performing the one or more conflict checks comprises:
when a first logical creation time of a first buffer to be acquired by the transaction exceeds the latest logical creation time of the first subset of buffers, comparing the first logical creation time of the first buffer with the earliest logical termination time for the first subset of buffers; and
when the first logical creation time does not exceed the earliest logical termination time for the first subset of buffers, adding the first buffer to the first subset of buffers and updating the latest logical creation time of the first subset of buffers to the first logical creation time of the first buffer.

### Claim 17 (depends on 16)

The method of claim 16, wherein performing the one or more conflict checks further comprises:
after acquisition of the first subset of buffers is complete, verifying that a first logical termination time of the first buffer does not precede a current state of the I/O system; and
after the transaction acquires a lock on the I/O system, verifying that the first logical termination time of the first buffer does not precede the current state of the I/O system.

### Claim 18 (depends on 15)

The method of claim 15, wherein performing the one or more conflict checks comprises:
when a conflict is detected during a conflict check, triggering a restart of the transaction.

### Claim 19 (depends on 18)

The method of claim 18, wherein performing the one or more conflict checks further comprises:
tracking a number of restarts of the transaction;
when the number of restarts exceeds a threshold, holding a lock on the I/O system for a duration of the transaction; and
adjusting the threshold based on at least one of an average number of transaction restarts, a priority of the transaction, and a policy associated with concurrency control in the I/O system.

### Claim 20

An apparatus, comprising:
one or more processors; and
memory storing instructions that, when executed by the one or more processors, cause the apparatus to:
process a set of transactions that read and write to an input/output (I/O) system by caching data from a set of blocks on a storage device in a set of buffers;
store a set of logical creation times and a set of logical termination times for the data in a set of buffer headers for the set of buffers;
during execution of a transaction in the set of transactions, track a latest logical creation time and an earliest logical termination time for a first subset of the buffers acquired by the transaction based on a subset of the logical creation times and a subset of the logical termination times in a subset of the buffer headers for the first subset of buffers; and
perform one or more conflict checks using the latest logical creation time and the earliest logical termination time prior to completing the transaction.
