# US 2021/0081372 A1 · Persistent memory file store for directly mapped persistent memory database

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

- Number: US 2021/0081372 A1
- Document ID: US20210081372A1
- Status: Published application
- Kind: A1
- Application number: 16/812,833
- Filed: 2020-03-09
- Published: 2021-03-18
- Earliest claimed: 2019-09-13
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: J. William Lee; William H. Bridge, JR.; Ankur Kemkar; Vipin Gokhale; Sivaram Prasad Soma; Vishvesh Mohanarangam Selvakumaar; Juan R. Loaiza; Wei-Ming Hu; Neil J.S. MacNaughton; Adam Y. Lee
- Web page: https://patentgrep.com/patent/US20210081372A1

## CPC

- G06F 16/182: Distributed file systems
- G06F 16/284: {Relational databases}
- G06F 9/4411: {Configuring for operating with peripheral devices; Loading of device drivers}
- G06F 9/5027: {the resource being a machine, e.g. CPUs, Servers, Terminals}
- G06F 9/524: {Deadlock detection or avoidance}
- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 12/123: with age lists, e.g. queue, most recently used [MRU] list or least recently used [LRU] list
- G06F 16/164: {File meta data generation}
- G06F 16/23: Updating
- G06F 16/25: Integrating or interfacing systems involving database management systems
- G06F 2212/163: Server or database system
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques herein store database blocks (DBBs) in byte-addressable persistent memory (PMEM) and prevent tearing without deadlocking or waiting. In an embodiment, a computer hosts a DBMS. A reader process of the DBMS obtains, without locking and from metadata in PMEM, a first memory address for directly accessing a current version, which is a particular version, of a DBB in PMEM. Concurrently and without locking: a) the reader process reads the particular version of the DBB in PMEM, and b) a writer process of the DBMS replaces, in the metadata in PMEM, the first memory address with a second memory address for directly accessing a new version of the DBB in PMEM. In an embodiment, a computer performs without locking: a) storing, in PMEM, a DBB, b) copying into volatile memory, or reading, an image of the DBB, and c) detecting whether the image of the DBB is torn.

## Claims

### Claim 1

A method comprising:
without locking, a reader process of a database management system (DBMS) obtaining, from metadata in persistent memory (PMEM), a first memory address for directly accessing a current version, which is a particular version, of a database block in PMEM;
concurrently without locking:
the reader process reading the particular version of the database block in the PMEM, and
a writer process of the DBMS: writing content into a new version of the database block in the PMEM or replacing, in the metadata in PMEM, the first memory address with a second memory address for directly accessing a new version of the database block in the PMEM.

### Claim 2 (depends on 1)

The method of claim 1 wherein said replacing, in the metadata in the PMEM, the first memory address with the second memory address is atomic.

### Claim 3 (depends on 1)

The method of claim 1 wherein said reading the particular version of the database block in the PMEM does not use: a block device driver nor a block-oriented input/output (I/O) system call of an operating system (OS).

### Claim 4 (depends on 1)

The method of claim 1 wherein said reading the particular version of the database block in the PMEM uses: memory mapped I/O, byte addressable direct access (DAX) to hardware, and/or a filesystem in userspace (FUSE).

### Claim 5 (depends on 1)

The method of claim 1 wherein said reading the particular version of the database block in the PMEM comprises:
copying the particular version of the database block from the PMEM to volatile memory, and
said reader process or a different reader process reading the particular version of the database block in the volatile memory.

### Claim 6 (depends on 5)

The method of claim 5 wherein said copying the particular version of the database block to the volatile memory comprises copying the particular version of the database block into a block cache.

### Claim 7 (depends on 6)

The method of claim 6 further comprising at least one of:
copying from, allocating, and/or populating said new version of the database block in the block cache before or after said replacing, in the metadata in PMEM, the first memory address with the second memory address;
simultaneously reading multiple versions of said database block in the volatile memory; and/or
said reader process or said different reader process pinning said particular version of the database block in the block cache.

### Claim 8 (depends on 6)

The method of claim 6 wherein after said replacing, in the metadata in PMEM, the first memory address with the second memory address: the block cache contains the particular version of the database block but not said new version of the database block.

### Claim 9 (depends on 5)

The method of claim 5 further comprising detecting that a previous version of the database block in the volatile memory is stale based on said obtaining, from said metadata in the PMEM, the first memory address for directly accessing the particular version of the database block in PMEM.

### Claim 10 (depends on 1)

The method of claim 1 wherein said reading the particular version of the database block in the PMEM comprises detecting that a copy of the particular version of the database block is torn or stale.

### Claim 11

One or more non-transitory computer-readable media storing instruction that, when executed by one or more processors, cause:
without locking, a reader process of a database management system (DBMS) obtaining, from metadata in persistent memory (PMEM), a first memory address for directly accessing a current version, which is a particular version, of a database block in PMEM;
concurrently without locking:
the reader process reading the particular version of the database block in the PMEM, and
a writer process of the DBMS: writing content into a new version of the database block in the PMEM or replacing, in the metadata in PMEM, the first memory address with a second memory address for directly accessing a new version of the database block in the PMEM.

### Claim 12 (depends on 11)

The one or more non-transitory computer-readable media of claim 11 wherein said replacing, in the metadata in the PMEM, the first memory address with the second memory address is atomic.

### Claim 13 (depends on 11)

The one or more non-transitory computer-readable media of claim 11 wherein said reading the particular version of the database block in the PMEM does not use: a block device driver nor a block-oriented input/output (I/O) system call of an operating system (OS).

### Claim 14 (depends on 11)

The one or more non-transitory computer-readable media of claim 11 wherein said reading the particular version of the database block in the PMEM uses: memory mapped I/O, byte addressable direct access (DAX) to hardware, and/or a filesystem in userspace (FUSE).

### Claim 15 (depends on 11)

The one or more non-transitory computer-readable media of claim 11 wherein said reading the particular version of the database block in the PMEM comprises:
copying the particular version of the database block from the PMEM to volatile memory, and said reader process or a different reader process reading the particular version of the database block in the volatile memory.

### Claim 16 (depends on 15)

The one or more non-transitory computer-readable media of claim 15 wherein said copying the particular version of the database block to the volatile memory comprises copying the particular version of the database block into a block cache.

### Claim 17 (depends on 16)

The one or more non-transitory computer-readable media of claim 16 further comprising at least one of:
copying from, allocating, and/or populating said new version of the database block in the block cache before or after said replacing, in the metadata in PMEM, the first memory address with the second memory address;
simultaneously reading multiple versions of said database block in the volatile memory; and/or
said reader process or said different reader process pinning said particular version of the database block in the block cache.

### Claim 18 (depends on 16)

The one or more non-transitory computer-readable media of claim 16 wherein after said replacing, in the metadata in PMEM, the first memory address with the second memory address: the block cache contains the particular version of the database block but not said new version of the database block.

### Claim 19 (depends on 15)

The one or more non-transitory computer-readable media of claim 15 further comprising detecting that a previous version of the database block in the volatile memory is stale based on said obtaining, from said metadata in the PMEM, the first memory address for directly accessing the particular version of the database block in PMEM.

### Claim 20 (depends on 11)

The one or more non-transitory computer-readable media of claim 11 wherein said reading the particular version of the database block in the PMEM comprises detecting that a copy of the particular version of the database block is torn or stale.
