# US 2020/0394065 A1 · Faster access of virtual machine memory backed by a host computing device's virtual memory

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

- Number: US 2020/0394065 A1
- Document ID: US20200394065A1
- Status: Published application
- Kind: A1
- Application number: 17/006,858
- Filed: 2020-08-30
- Published: 2020-12-17
- Earliest claimed: 2018-11-21
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Yevgeniy BAK; Mehmet IYIGUN; Arun U. KISHAN
- Web page: https://patentgrep.com/patent/US20200394065A1

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/5077: {Logical partitioning of resources; Management or configuration of virtualized resources (specific details on emulation or internal functioning of virtual machines G06F9/455)}
- G06F 12/1009: using page tables, e.g. page table structures
- G06F 12/1063: {the data cache being concurrently virtually addressed}
- G06F 12/109: for multiple virtual address spaces, e.g. segmentation (G06F12/1036 takes precedence)
- G06F 12/023: {Free address space management}
- G06F 12/08: in hierarchically structured memory systems, e.g. virtual memory systems
- G06F 12/1036: for multiple virtual address spaces, e.g. segmentation (G06F12/1045 takes precedence)
- G06F 12/126: with special data handling, e.g. priority of data or instructions, handling errors or pinning
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F 2212/1024: Latency reduction
- G06F 2212/1052: Security improvement
- G06F 2212/151: Emulated environment, e.g. virtual machine
- G06F 2212/50: Control mechanisms for virtual memory, cache or TLB
- G06F 2212/651: Multi-level translation tables
- G06F 2212/652: Page size control
- G06F 2212/654: Look-ahead translation
- G06F 2212/656: Address space sharing
- G06F 2212/657: Virtual address space management
- G06F 2212/683: Invalidation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

To increase the speed with which the hierarchical levels of a Second Layer Address Table (SLAT) are traversed as part of a memory access where the guest physical memory of a virtual machine environment is backed by virtual memory assigned to one or more processes executing on a host computing device, one or more hierarchical levels of tables within the SLAT can be skipped or otherwise not referenced. While the SLAT can be populated with memory correlations at hierarchically higher-levels of tables, the page table of the host computing device, supporting the host computing device's provision of virtual memory, can maintain a corresponding contiguous set of memory correlations at the hierarchically lowest table level, thereby enabling the host computing device to page out, or otherwise manipulate, smaller chunks of memory. If such manipulation occurs, the SLAT can be repopulated with memory correlations at the hierarchically lowest table level.

## Claims

### Claim 1

A method of increasing a speed of access of computer memory, the method comprising:
detecting a first memory access, from a first process executing in a virtual machine computing environment, directed to a first range of memory;
generating, as a precondition to completing the first memory access, a first entry in a hierarchically arranged second layer address translation table, the hierarchically arranged second layer address translation table correlating host physical memory addresses to guest physical memory addresses, the first entry being at least one hierarchical level above a hierarchically lowest level of tables such that a second range of memory, identified by the first entry, can be identified without reference to any table in the hierarchically lowest level of tables, the second range of memory being greater than the first range of memory; and
in response to generating the first entry in the hierarchically arranged second layer address translation table, marking as used a first plurality of entries in a hierarchically arranged page table, the hierarchically arranged page table correlating the host physical memory addresses to host virtual memory addresses, the first plurality of entries referencing, in aggregate, the same second range of memory as the first entry in the hierarchically arranged second layer address translation table, wherein entries of the first plurality of entries are at a hierarchically lowest level of tables;
wherein the guest physical memory addresses are perceived as being addresses to physical memory by processes executing within the virtual machine computing environment;
wherein the host physical memory addresses are addresses to actual physical memory of a host computing device hosting the virtual machine computing environment;
wherein the host virtual memory addresses are addresses to virtual memory provided by a memory manager executing on the host computing device, the memory manager utilizing the hierarchically arranged page table to provide the virtual memory; and
wherein guest physical memory, identified by the guest physical memory addresses, is backed by a portion of host virtual memory, identified by a portion of the host virtual memory addresses.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
detecting a second memory access from the first process executing in the virtual machine computing environment, the second memory access being directed to a third range of memory that differs from the first range of memory; and
satisfying the second memory access by reference to a second subset of the first plurality of entries in the hierarchically arranged page table;
wherein the first memory access was satisfied by reference to a first subset of the first plurality of entries in the hierarchically arranged page table, the first subset comprising different entries, in the hierarchically arranged page table, than the second subset.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
detecting, after the first memory access completes, that a first subset of the first plurality of entries in the hierarchically arranged page table have had data, that was originally stored in corresponding host physical memory addresses, subsequently paged out to a non-volatile storage medium;
invalidating, in response to the detecting, the first entry in the hierarchically arranged second layer address translation table; and
generating, in place of the first entry in the hierarchically arranged second layer address translation table, a second plurality of entries in the hierarchically arranged second layer address translation table, the second plurality of entries referencing, in aggregate, at least some of the same second range of memory as the first entry, wherein entries of the second plurality of entries are at a hierarchically lowest level of tables.

### Claim 4 (depends on 3)

The method of claim 3, wherein the second plurality of entries references portions of the second range of memory that were previously accessed by the first process and were not paged out.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
assembling a first plurality of contiguous small page sized regions of the host physical memory into a single large page sized region of the host physical memory.

### Claim 6 (depends on 5)

The method of claim 5, wherein the assembling occurs subsequent to the detecting the first memory access and prior to the generating the first entry in the hierarchically arranged second layer address translation table.

### Claim 7 (depends on 5)

The method of claim 5, further comprising:
generating a second entry in the hierarchically arranged second layer address translation table, the second entry being at the least one hierarchical level above the hierarchically lowest level of tables such that a third range of memory, identified by the second entry, can be identified without reference to any table in the hierarchically lowest level of tables, the third range of memory referencing the single large page sized region of the host physical memory into which the first plurality of the contiguous small page sized regions of the host physical memory were assembled; and
in response to generating the second entry in the hierarchically arranged second layer address translation table, marking as used a second plurality of entries in the hierarchically arranged page table, the second plurality of entries referencing the first plurality of the contiguous small page sized regions of the host physical memory which were assembled into the single large page sized region of the host physical memory.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
copying data from a second plurality of small page sized regions of the host physical memory to at least a portion of the first plurality of the contiguous small page sized regions, the second plurality of small page sized regions being at least party discontinuous; and
invalidating a second plurality of entries in the hierarchically arranged second layer address translation table that referenced the second plurality of small page sized regions of the host physical memory, wherein entries of the second plurality of entries are at a hierarchically lowest level of tables;
wherein the generated second entry in the hierarchically arranged second layer address translation table is utilized in place of the second plurality of entries that were invalidated.

### Claim 9 (depends on 7)

The method of claim 7, further comprising:
copying data from a second set of one or more small page sized regions of the host physical memory to at least a portion of the first plurality of the contiguous small page sized regions; and
invalidating a second plurality of entries in the hierarchically arranged second layer address translation table, the second plurality of entries comprising both: (1) a first subset of entries that reference the second set of the one or more small page sized regions of the host physical memory and (2) a second subset of entries that reference at least some of the first plurality of contiguous small page sized regions of the host physical memory, wherein entries of the second plurality of entries are at a hierarchically lowest level of tables;
wherein the generated second entry in the hierarchically arranged second layer address translation table is utilized in place of the second plurality of entries that were invalidated.

### Claim 10 (depends on 5)

The method of claim 5, wherein the assembling the first plurality of contiguous small page sized regions of the host physical memory comprises copying data from some of the first plurality of contiguous small page sized regions to other small page sized regions of the host physical memory that differ from the first plurality of contiguous small page sized regions.

### Claim 11 (depends on 10)

The method of claim 10, wherein the copying the data from the some of the first plurality of contiguous small page sized regions to the other small page sized regions is only performed if a fragmentation of the first plurality of contiguous small page sized regions is below a fragmentation threshold.

### Claim 12 (depends on 1)

The method of claim 1, further comprising:
preventing paging of the second range of memory.

### Claim 13 (depends on 12)

The method of claim 12, wherein the preventing the paging of the second range of memory is only performed if one or more portions of the second range of memory are accessed more frequently than an access frequency threshold.

### Claim 14 (depends on 12)

The method of claim 12, further comprising removing the prevention of paging of the second range of memory if one or more portions of the second range of memory are accessed less frequently than an access frequency threshold.

### Claim 15 (depends on 1)

The method of claim 1, wherein the second range of memory is 2 MB in size.

### Claim 16

A computing device comprising:
one or more central processing units;
random access memory (RAM); and
one or more computer-readable media comprising:
a first set of computer-executable instructions, which, when executed by the computing device, cause the computing device to provide a memory manager referencing a hierarchically arranged page table to translate host virtual memory addresses to host physical memory addresses that identify locations on the RAM;
a second set of computer-executable instructions, which, when executed by the computing device, cause the computing device to provide a virtual machine computing environment, wherein processes executing within the virtual machine computing environment perceive guest physical memory addresses as being addresses to physical memory, and wherein further guest physical memory, identified by the guest physical memory addresses, is backed by a portion of host virtual memory, identified by a portion of the host virtual memory addresses; and
a third set of computer-executable instructions, which, when executed by the computing device, cause the computing device to:
detect a first memory access, from a first process executing in the virtual machine computing environment, directed to a first range of memory;
generate, as a precondition to completing the first memory access, a first entry in a hierarchically arranged second layer address translation table, the hierarchically arranged second layer address translation table correlating the host physical memory addresses to the guest physical memory addresses, the first entry being at least one hierarchical level above a hierarchically lowest level of tables such that a second range of memory, identified by the first entry, can be identified without reference to any table in the hierarchically lowest level of tables, the second range of memory being greater than the first range of memory; and
in response to generating the first entry in the hierarchically arranged second layer address translation table, mark as used a first plurality of entries in the hierarchically arranged page table, the first plurality of entries referencing, in aggregate, the same second range of memory as the first entry in the hierarchically arranged second layer address translation table, wherein entries of the first plurality of entries are at a hierarchically lowest level of tables.

### Claim 17 (depends on 16)

The computing device of claim 16, wherein the third set of computer-executable instructions comprises further computer-executable instructions, which, when executed by the computing device, cause the computing device to:
detect, after the first memory access completes, that a first subset of the first plurality of entries in the hierarchically arranged page table have had data, that was originally stored in corresponding host physical memory addresses, subsequently paged out to a non-volatile storage medium;
invalidate, in response to the detecting, the first entry in the hierarchically arranged second layer address translation table; and
generate, in place of the first entry in the hierarchically arranged second layer address translation table, a second plurality of entries in the hierarchically arranged second layer address translation table, the second plurality of entries referencing, in aggregate, at least some of the same second range of memory as the first entry, wherein entries of the second plurality of entries are at a hierarchically lowest level of tables.

### Claim 18 (depends on 16)

The computing device of claim 16, wherein the third set of computer-executable instructions comprises further computer-executable instructions, which, when executed by the computing device, cause the computing device to:
assemble a first plurality of contiguous small page sized regions of the host physical memory into a single large page sized region of the host physical memory;
wherein the assembling occurs subsequent to the detecting the first memory access and prior to the generating the first entry in the hierarchically arranged second layer address translation table.

### Claim 19 (depends on 16)

The computing device of claim 16, wherein the third set of computer-executable instructions comprises further computer-executable instructions, which, when executed by the computing device, cause the computing device to:
prevent paging of the second range of memory.

### Claim 20

One or more computer-readable storage media comprising computer-executable instructions, which when executed, cause a computing device to:
detect a first memory access, from a first process executing in a virtual machine computing environment, directed to a first range of memory;
generate, as a precondition to completing the first memory access, a first entry in a hierarchically arranged second layer address translation table, the hierarchically arranged second layer address translation table correlating host physical memory addresses to guest physical memory addresses, the first entry being at least one hierarchical level above a hierarchically lowest level of tables such that a second range of memory, identified by the first entry, can be identified without reference to any table in the hierarchically lowest level of tables, the second range of memory being greater than the first range of memory; and
in response to generating the first entry in the hierarchically arranged second layer address translation table, mark as used a first plurality of entries in a hierarchically arranged page table, the hierarchically arranged page table correlating the host physical memory addresses to host virtual memory addresses, the first plurality of entries referencing, in aggregate, the same second range of memory as the first entry in the hierarchically arranged second layer address translation table, wherein entries of the first plurality of entries are at a hierarchically lowest level of tables;
wherein the guest physical memory addresses are perceived as being addresses to physical memory by processes executing within the virtual machine computing environment;
wherein the host physical memory addresses are addresses to actual physical memory of a host computing device hosting the virtual machine computing environment;
wherein the host virtual memory addresses are addresses to virtual memory provided by a memory manager executing on the host computing device, the memory manager utilizing the hierarchically arranged page table to provide the virtual memory; and
wherein guest physical memory, identified by the guest physical memory addresses, is backed by a portion of host virtual memory, identified by a portion of the host virtual memory addresses.
