# US 12,118,230 B2 · Method for providing logging for persistent memory

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

- Number: US 12,118,230 B2
- Document ID: US12118230B2
- Status: Granted
- Kind: B2
- Application number: 18/107,694
- Filed: 2023-02-09
- Published: 2023-08-17
- Granted: 2024-10-15
- Earliest claimed: 2022-02-11
- Assignees: Micron Technology, Inc.
- Applicants: Micron Technology, Inc.
- Inventors: Bryan Hornung; Tony M. Brewer
- Web page: https://patentgrep.com/patent/US12118230B2

## CPC

- G06F 3/0653: {Monitoring storage devices or systems}
- G06F 11/3476: {Data logging (G06F11/14, G06F11/2205 take precedence)}
- G06F 3/0607: {by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device}
- G06F 11/3037: {where the computing system component is a memory, e.g. virtual memory, cache (accessing, addressing or allocating within memory systems or architectures G06F12/00; checking stores for correct operation G11C29/00)}
- G06F 3/0679: {Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed in some examples are methods, systems, memory devices, and machine-readable mediums that allows an application of a computer system to create a series of one or more logs of writes to one or more memory locations of a memory device. The logs may comprise the values at the end of the log interval of the one or more memory locations that were written to during a log interval. In some examples, the logs do not include intermediate writes to the one or more memory locations (only the final value) and do not include values of memory locations that were not written to during the interval. After an event, software can apply these logs to a copy of the original memory region state to recover the contents of the locations at any of the logged points. These logs may be useful to recreate the state of the memory at various points during the application's execution.

## Claims

### Claim 1

A method comprising:
receiving, from an application, an indication of a start of a logging interval corresponding to a set of one or more memory locations of a memory device;
responsive to receiving the indication of the start of the logging interval:
receiving a write request for a first memory location in the set of one or more memory locations of the memory device, the write request including a first value to write at the first memory location;
responsive to the write request:
determining that a second value was written to the first memory location in a previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval;
responsive to determining that a second value was written to the first memory location in a previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval:
allocating a second memory location of the memory device;
processing the write request to write the first value into the first or the second memory location;
storing the second value in the other of the first or second memory location; and
updating metadata corresponding to the first memory location to indicate that a write operation was performed in the logging interval; and
during the logging interval and while the memory device is handling memory device commands, logging values of a set of one or more modified memory locations of the memory device in a log structure, the set of one or more modified memory locations being memory locations where data changed during the previous logging interval, the set of one or more modified memory locations comprising the first memory location, the logging of the first memory location comprising saving the value stored in the first or second locations that was not used to process a write request in the logging interval.

### Claim 2 (depends on 1)

The method of claim 1, wherein the memory device supports a persistent memory model and is connected to a host across link that supports coherency.

### Claim 3 (depends on 1)

The method of claim 1, further comprising receiving a memory location of the log from a host device.

### Claim 4 (depends on 1)

The method of claim 1, further comprising responsive to determining that the second value was written to the first memory location in the previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval:
storing a pointer to the second memory location in the metadata.

### Claim 5 (depends on 1)

The method of claim 1, wherein the metadata includes two flags, a first flag for an even numbered interval and a second flag for an odd numbered interval and wherein updating the metadata corresponding to the first memory location to indicate that the write operation was performed in the logging interval comprises updating the corresponding first or second flag depending on whether the logging interval is even or odd.

### Claim 6 (depends on 5)

The method of claim 5, wherein determining that the second value was written to the first memory location in the previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval comprises:
identifying that the first flag is set when a current interval is odd or that the second flag is set when the current interval is even.

### Claim 7 (depends on 1)

The method of claim 1, further comprising deallocating the first or second memory location upon logging the value in the first or second memory location.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
receiving an indication that the logging interval has ended;
prior to a second indication that a second logging interval has begun, logging values of a second set of one or more modified memory locations of the memory device in a second log structure, the second set of one or more modified memory locations being memory locations where data changed during the logging interval.

### Claim 9

A memory device comprising:
a memory controller, configured to perform operations comprising:
receiving, from an application, an indication of a start of a logging interval corresponding to a set of one or more memory locations of the memory device;
responsive to receiving the indication of the start of the logging interval:
receiving a write request for a first memory location in the set of one or more memory locations of the memory device, the write request including a first value to write at the first memory location;
responsive to the write request:
determining that a second value was written to the first memory location in a previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval;
responsive to determining that a second value was written to the first memory location in the previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval:
allocating a second memory location of the memory device;
processing the write request to write the first value into the first or the second memory location;
storing the second value in the other of the first or second memory location; and
updating metadata corresponding to the first memory location to indicate that a write operation was performed in the logging interval; and
during the logging interval and while the memory device is handling memory device commands, logging values of a set of one or more modified memory locations of the memory device in a log structure, the set of one or more modified memory locations being memory locations where data changed during the previous logging interval, the set of one or more modified memory locations comprising the first memory location, the logging of the first memory location comprising saving the value stored in the first or second locations that was not used to process a write request in the logging interval.

### Claim 10 (depends on 9)

The memory device of claim 9, wherein the memory device supports a persistent memory model and is connected to a host across link that supports coherency.

### Claim 11 (depends on 9)

The memory device of claim 9, wherein the operations further comprise receiving a memory location of the log from a host device.

### Claim 12 (depends on 9)

The memory device of claim 9, wherein the operations further comprise responsive to determining that the second value was written to the first memory location in the previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval:
storing a pointer to the second memory location in the metadata.

### Claim 13 (depends on 9)

The memory device of claim 9, wherein the metadata includes two flags, a first flag for an even numbered interval and a second flag for an odd numbered interval and wherein the operations of updating the metadata corresponding to the first memory location to indicate that the write operation was performed in the logging interval comprises updating the corresponding first or second flag depending on whether the logging interval is even or odd.

### Claim 14 (depends on 13)

The memory device of claim 13, wherein the operations of determining that the second value was written to the first memory location in the previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval comprises:
identifying that the first flag is set when a current interval is odd or that the second flag is set when the current interval is even.

### Claim 15 (depends on 9)

The memory device of claim 9, wherein the operations further comprise deallocating the first or second memory location upon logging the value in the first or second memory location.

### Claim 16 (depends on 9)

The memory device of claim 9, wherein the operations further comprise:
receiving an indication that the logging interval has ended;
prior to a second indication that a second logging interval has begun, logging values of a second set of one or more modified memory locations of the memory device in a second log structure, the second set of one or more modified memory locations being memory locations where data changed during the logging interval.

### Claim 17

A non-transitory machine-readable medium, storing instructions, which when executed by a memory controller of a memory device, performs operations comprising:
receiving, from an application, an indication of a start of a logging interval corresponding to a set of one or more memory locations of the memory device;
responsive to receiving the indication of the start of the logging interval:
receiving a write request for a first memory location in the set of one or more memory locations of the memory device, the write request including a first value to write at the first memory location;
responsive to the write request:
determining that a second value was written to the first memory location in a previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval;
responsive to determining that the second value was written to the first memory location in the previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval:
allocating a second memory location of the memory device;
processing the write request to write the first value into the first or the second memory location;
storing the second value in the other of the first or second memory location; and
updating metadata corresponding to the first memory location to indicate that a write operation was performed in the logging interval; and
during the logging interval and while the memory device is handling memory device commands, logging values of a set of one or more modified memory locations of the memory device in a log structure, the set of one or more modified memory locations being memory locations where data changed during the previous logging interval, the set of one or more modified memory locations comprising the first memory location, the logging of the first memory location comprising saving the value stored in the first or second locations that was not used to process a write request in the logging interval.

### Claim 18 (depends on 17)

The non-transitory machine-readable medium of claim 17, wherein the memory device supports a persistent memory model and is connected to a host across link that supports coherency.

### Claim 19 (depends on 17)

The non-transitory machine-readable medium of claim 17, wherein the operations further comprise receiving a memory location of the log from a host device.

### Claim 20 (depends on 17)

The non-transitory machine-readable medium of claim 17, wherein the operations further comprise responsive to determining that the second value was written to the first memory location in the previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval:
storing a pointer to the second memory location in the metadata.

### Claim 21 (depends on 17)

The non-transitory machine-readable medium of claim 17, wherein the metadata includes two flags, a first flag for an even numbered interval and a second flag for an odd numbered interval and wherein the operations of updating the metadata corresponding to the first memory location to indicate that the write operation was performed in the logging interval comprises updating the corresponding first or second flag depending on whether the logging interval is even or odd.

### Claim 22 (depends on 21)

The non-transitory machine-readable medium of claim 21, wherein the operations of determining that the second value was written to the first memory location in the previous logging interval and the second value has not yet been recorded to a log corresponding to the previous logging interval comprises:
identifying that the first flag is set when a current interval is odd or that the second flag is set when the current interval is even.

### Claim 23 (depends on 17)

The non-transitory machine-readable medium of claim 17, wherein the operations further comprise deallocating the first or second memory location upon logging the value in the first or second memory location.

### Claim 24 (depends on 17)

The non-transitory machine-readable medium of claim 17, wherein the operations further comprise:
receiving an indication that the logging interval has ended;
prior to a second indication that a second logging interval has begun, logging values of a second set of one or more modified memory locations of the memory device in a second log structure, the second set of one or more modified memory locations being memory locations where data changed during the logging interval.
