# US 2022/0283954 A1 · Maintaining contiguity of virtual to physical address mappings to exploit contiguity-aware translation look-aside buffer hardware

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

- Number: US 2022/0283954 A1
- Document ID: US20220283954A1
- Status: Published application
- Kind: A1
- Application number: 17/825,977
- Filed: 2022-05-26
- Published: 2022-09-08
- Earliest claimed: 2022-05-26
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Aravinda Prasad; Sreenivas Subramoney
- Web page: https://patentgrep.com/patent/US20220283954A1

## CPC

- G06F 12/1036: for multiple virtual address spaces, e.g. segmentation (G06F12/1045 takes precedence)
- G06F 9/5016: {the resource being the memory}
- G06F 9/5022: {Mechanisms to release resources}
- G06F 12/1072: Decentralised address translation, e.g. in distributed shared memory systems
- G06F 12/123: with age lists, e.g. queue, most recently used [MRU] list or least recently used [LRU] list
- G06F 12/08: in hierarchically structured memory systems, e.g. virtual memory systems
- G06F 12/0813: with a network or matrix configuration
- G06F 2212/1024: Latency reduction
- G06F 2212/2542: Non-uniform memory access [NUMA] architecture
- G06F 2212/502: using adaptive policy
- G06F 2212/657: Virtual address space management
- G06F 2212/68: Details of translation look-aside buffer [TLB]
- G06F 2212/684: TLB miss handling
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments described herein are generally directed to maintaining contiguity of virtual to physical address mappings to exploit a contiguity-aware TLB. In an example, information regarding a migration set of one or more pages within a physical address space that have been identified for migration from a source tier of memory to a target tier of memory is received in which the physical address space comprises a first contiguous region of physical memory addresses and a VMA includes a second contiguous region of virtual memory addresses corresponding to the first contiguous region. It is determined whether the migration would break contiguity of a mapping maintained by a contiguity-aware TLB between pages of the first contiguous region and pages of the second contiguous region. Responsive an affirmative determination, discontinuities within the mapping resulting from the migration are minimized by intelligently increasing or decreasing the migration set.

## Claims

### Claim 1

A non-transitory machine-readable medium storing instructions, which when executed by a processing resource of a monitor node of a shared memory system cause the shared memory system to:
determine whether migration of a set of one or more pages within a first continuous region of physical memory addresses of a physical address space from a source tier of memory to a target tier of memory, would break contiguity of a mapping maintained by a contiguity-aware translation lookaside buffer (TLB) between pages of the first contiguous region and a second contiguous region of a virtual memory area (VMA) corresponding to the first contiguous region; and
responsive an affirmative determination, minimize a number of discontinuities within the mapping resulting from the migration by (i) increasing the set by adding up to N pages of the first contiguous region to the set, or (ii) decreasing the set by removing up to M pages of the set from the set.

### Claim 2 (depends on 1)

The non-transitory machine-readable medium of claim 1, wherein the instructions further cause the shared memory system to select between said increasing and decreasing based on the target tier of memory.

### Claim 3 (depends on 2)

The non-transitory machine-readable medium of claim 2, wherein the source tier of memory comprises a non-volatile memory in which cold data is stored, wherein the target tier of memory comprises a volatile memory in which hot data is stored, and wherein the migration represents a promotion of hot pages.

### Claim 4 (depends on 2)

The non-transitory machine-readable medium of claim 2, wherein the shared memory system comprises a non-uniform memory access (NUMA) system, wherein the source tier of memory is associated with a remote node of the NUMA system, wherein the target tier of memory is associated with a local node of the NUMA system, and wherein the migration is part of a balancing of pages within the NUMA system.

### Claim 5 (depends on 1)

The non-transitory machine-readable medium of claim 1, wherein N represents a dynamically configurable or predetermined aggression factor and M represents a dynamically configurable or predetermined defensive factor.

### Claim 6

A non-transitory machine-readable medium storing instructions, which when executed by a processing resource of a monitor node of a shared memory system cause the shared memory system to:
receive an indication of a total number of pages desired to be reclaimed from a plurality of virtual memory areas (VMAs) of the shared memory system, wherein a contiguity-aware translation lookaside buffer (TLB) maintains respective sets of TLB entries mapping contiguous regions of virtual memory pages of the plurality of VMAs to corresponding contiguous regions of physical memory pages;
perform a first stage of page reclamation identification by creating a reclamation set of pages based on a set of least-recently used (LRU) VMAs in which all physical memory pages associated with a given VMA of the set of LRU VMAs are within a list of LRU physical memory pages maintained by the shared memory system; and
responsive to the first stage failing to satisfy the total number of pages, perform a second stage of page reclamation identification by adding pages to the reclamation set from a remaining set of VMAs of the plurality of VMAs that exclude the LRU VMAs, wherein the remaining set of VMAs are prioritized based on their respective relative percentage of virtual memory pages corresponding to physical memory pages in the list.

### Claim 7 (depends on 6)

The non-transitory machine-readable medium of claim 6, wherein the first stage of page reclamation identification comprises while a size of the reclamation set is less than the total number of pages, for each VMA of the set of LRU VMAs:
selecting a page for inclusion within the reclamation set by sequentially traversing physical memory pages associated with the VMA; and
adding the selected page to the reclamation set.

### Claim 8 (depends on 6)

The non-transitory machine-readable medium of claim 6, wherein the second stage of page reclamation identification comprises while the size of the reclamation set is less than the total number of pages, for each VMA of the remaining set of VMAs:
identifying a maximum set of physical memory pages associated with the VMA that may be reclaimed without increasing a number of TLB entries of the set of TLB entries maintained for the VMA beyond a threshold; and
adding the identified maximum set of physical memory pages to the reclamation set.

### Claim 9 (depends on 6)

The non-transitory machine-readable medium of claim 6, wherein the indication of the total number of pages is received responsive to memory pressure associated with the shared memory system.

### Claim 10 (depends on 6)

The non-transitory machine-readable medium of claim 6, wherein the indication of the total number of pages is received during a defragmentation process performed by the shared memory system.

### Claim 11

A method comprising:
receiving information regarding a set of one or more pages within a physical address space that have been identified for migration from a source tier of memory to a target tier of memory, wherein the physical address space comprises a first contiguous region of physical memory addresses, and wherein a virtual memory area (VMA) includes a second contiguous region of virtual memory addresses corresponding to the first contiguous region;
determining whether the migration would break contiguity of a mapping maintained by a contiguity-aware translation lookaside buffer (TLB) between pages of the first contiguous region and pages of the second contiguous region; and
responsive an affirmative determination, minimizing a number of discontinuities within the mapping resulting from the migration by (i) increasing the set by adding up to N pages of the first contiguous region to the set, or (ii) decreasing the set by removing up to M pages of the set from the set.

### Claim 12 (depends on 11)

The method of claim 11, further comprising selecting between said increasing and decreasing based on the target tier of memory.

### Claim 13 (depends on 2)

The method of claim 2, wherein the source tier of memory comprises a non-volatile memory in which cold data is stored, wherein the target tier of memory comprises a volatile memory in which hot data is stored, and wherein the migration represents a promotion of hot pages.

### Claim 14 (depends on 12)

The method of claim 12, wherein the source tier of memory is associated with a remote node of a non-uniform memory access (NUMA) system, wherein the target tier of memory is associated with a local node of the NUMA system, and wherein the migration is part of a balancing of pages within the NUMA system.

### Claim 15 (depends on 1)

The method of claim 1, wherein N represents a dynamically configurable or predetermined aggression factor and M represents a dynamically configurable or predetermined defensive factor.

### Claim 16

A shared memory system comprising:
a processing resource; and
a machine-readable medium, coupled to the processing resource, having stored therein instructions, which when executed by the processing resource the shared memory system to:
receive an indication of a total number of pages desired to be reclaimed from a plurality of virtual memory areas (VMAs) of a shared memory system, wherein a contiguity-aware translation lookaside buffer (TLB) maintains respective sets of TLB entries mapping contiguous regions of virtual memory pages of the plurality of VMAs to corresponding contiguous regions of physical memory pages;
perform a first stage of page reclamation identification by creating a reclamation set of pages based on a set of least-recently used (LRU) VMAs in which all physical memory pages associated with a given VMA of the set of LRU VMAs are within a list of LRU physical memory pages maintained by the shared memory system; and
responsive to the first stage failing to satisfy the total number of pages, perform a second stage of page reclamation identification by adding pages to the reclamation set from a remaining set of VMAs of the plurality of VMAs that exclude the LRU VMAs, wherein the remaining set of VMAs are prioritized based on their respective relative percentage of virtual memory pages corresponding to physical memory pages in the list.

### Claim 17 (depends on 16)

The shared memory system of claim 16, wherein the first stage of page reclamation identification comprises while a size of the reclamation set is less than the total number of pages, for each VMA of the set of LRU VMAs:
selecting a page for inclusion within the reclamation set by sequentially traversing physical memory pages associated with the VMA; and
adding the selected page to the reclamation set.

### Claim 18 (depends on 16)

The shared memory system of claim 16, wherein the second stage of page reclamation identification comprises while the size of the reclamation set is less than the total number of pages, for each VMA of the remaining set of VMAs:
identifying a maximum set of physical memory pages associated with the VMA that may be reclaimed without increasing a number of TLB entries of the set of TLB entries maintained for the VMA beyond a threshold; and
adding the identified maximum set of physical memory pages to the reclamation set.

### Claim 19 (depends on 16)

The shared memory system of claim 16, wherein the indication of the total number of pages is received responsive to memory pressure associated with the shared memory system.

### Claim 20 (depends on 16)

The shared memory system of claim 16, wherein the indication of the total number of pages is received during a defragmentation process performed by the shared memory system.
