# US 2019/0171577 A1 · Host Address Space Identifier For Non-Uniform Memory Access Locality In Virtual Machines

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

- Number: US 2019/0171577 A1
- Document ID: US20190171577A1
- Status: Published application
- Kind: A1
- Application number: 15/831,724
- Filed: 2017-12-05
- Published: 2019-06-06
- Earliest claimed: 2017-12-05
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Andrea Arcangeli; Michael Tsirkin
- Web page: https://patentgrep.com/patent/US20190171577A1

## CPC

- G06F 12/1009: using page tables, e.g. page table structures
- G06F 9/45545: {Guest-host, i.e. hypervisor is an application program itself, e.g. VirtualBox}
- G06F 12/0292: {using tables or multilevel address translation means (G06F12/023 takes precedence; address translation in virtual memory systems G06F12/10)}
- G06F 12/1036: for multiple virtual address spaces, e.g. segmentation (G06F12/1045 takes precedence)
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Aspects of the disclosure provide for host address space identifiers for non-uniform memory access (NUMA) locality in virtual machines. A method of the disclosure includes receiving, by a hypervisor executed by a processing device of a host machine, execution control from a guest managed by the hypervisor, wherein a page fault corresponding to a guest physical address (GPA) triggered an exit to the hypervisor from the guest, identifying a host address space identifier (HASID) from the GPA, determining, in view of the HASID, whether to migrate a memory page associated with the GPA to a destination host non-uniform memory access (NUMA) node corresponding to the HASID, and creating a new page table entry for the GPA in a host page table of the hypervisor.

## Claims

### Claim 1

A method comprising:
receiving, by a hypervisor executed by a processing device of a host machine, execution control from a guest managed by the hypervisor, wherein a page fault corresponding to a guest physical address (GPA) triggered an exit to the hypervisor from the guest;
identifying a host address space identifier (HASID) from the GPA;
determining, in view of the HASID, whether to migrate a memory page associated with the GPA to a destination host non-uniform memory access (NUMA) node corresponding to the HASID; and
creating a new page table entry for the GPA in a host page table of the hypervisor.

### Claim 2 (depends on 1)

The method of claim 1, wherein the HASID is maintained in a determined number of upper bits of the GPA, wherein an address portion of the GPA is maintained in lower bits of the GPA separate from the HASID.

### Claim 3 (depends on 1)

The method of claim 1, wherein identifying the HASID comprises:
referencing a NUMA node locality table maintained by the hypervisor with the GPA; and
identifying a host physical address and the HASID corresponding to the GPA in the NUMA node locality table.

### Claim 4 (depends on 3)

The method of claim 3, wherein the HASID corresponds to an offset used to adjust the GPA.

### Claim 5 (depends on 4)

The method of claim 4, wherein the adjusting the GPA with the offset causes the GPA to reside outside of a range of memory addresses that the guest accesses.

### Claim 6 (depends on 1)

The method of claim 1, further comprising, responsive to determining to migrate the memory page:
determining the destination host NUMA node corresponding to the virtual NUMA of the HASID; and
copying data of the memory page from a first location of the memory page in a source host NUMA node to a second location of the memory in at the destination host NUMA node.

### Claim 7 (depends on 1)

The method of claim 1, wherein the HASID comprises a virtual NUMA node indicated by the guest to associate with the GPA, the virtual NUMA node different than a current virtual NUMA node associated with the GPA.

### Claim 8 (depends on 6)

The method of claim 6, wherein mapping of HASIDs to groups of virtual central processing units (vCPUs) of the guest is agreed upon by both the host machine and the guest.

### Claim 9 (depends on 7)

The method of claim 7, wherein a change to the mapping of the HASIDs to the groups of vCPUs is synchronized between the host machine and the guest.

### Claim 10 (depends on 1)

The method of claim 1, further comprising, responsive to determining not to migrate the memory page associated with the GPA to the destination host NUMA node corresponding to the HASID:
identifying the destination host NUMA node corresponding to the HASID;
selecting a host central processing unit (CPU) of the destination host NUMA node; and
causing a virtual CPU that generated the page fault to run on the selected host CPU.

### Claim 11

An apparatus, comprising:
a memory; and
a processing device communicably coupled to the memory, the processing device to:
determine, by a guest executed by a processing device and managed by a hypervisor, that a memory page of the guest should be moved from a first virtual non-uniform memory access (NUMA) node of the guest to a second virtual NUMA node of the guest;
update, by the guest in a guest page table, a guest physical address (GPA) of the memory page to include a host address space identifier (HASID) of the second virtual NUMA node;
attempting to access the updated GPA; and
responsive to a page fault resulting from attempting to access the updated GPA, exiting from the guest to the hypervisor.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein the HASID is maintained in a determined number of upper bits of the GPA, wherein an address portion of the GPA is maintained in lower bits of the GPA separate from the HASID.

### Claim 13 (depends on 11)

The apparatus of claim 11, wherein updating the GPA comprises:
referencing a guest NUMA node locality table to determine an offset to add to an address of memory page, the offset corresponding to the second virtual NUMA node; and
generating the GPA in view of the offset.

### Claim 14 (depends on 11)

The apparatus of claim 11, wherein the HASID comprises a virtual NUMA node indicated by the guest to associate with the GPA, the virtual NUMA node different than a current virtual NUMA node associated with the GPA.

### Claim 15 (depends on 14)

The apparatus of claim 14, wherein mapping of HASIDs to groups of virtual central processing units (vCPUs) of the guest is agreed upon by both the host machine and the guest.

### Claim 16

A non-transitory computer-readable storage medium including instructions that, when executed by a processing device, cause the processing device to:
receive, at a hypervisor executed by the processing device, execution control from a virtual machine (VM) managed by the hypervisor, wherein a page fault corresponding to a guest physical address (GPA) triggered an exit to the hypervisor from the VM;
decode, by the hypervisor, the GPA to identify a host address space identifier (HASID) located in upper bits of the GPA;
determine, by the hypervisor in view of the HASID, whether to migrate a memory page associated with the GPA; and
create, by the hypervisor, a new page table entry for the GPA in a host page table of the hypervisor.

### Claim 17 (depends on 16)

The non-transitory computer-readable storage medium of claim 16, wherein an address portion of the GPA is maintained in lower bits of the GPA separate from the HASID.

### Claim 18 (depends on 16)

The non-transitory computer-readable storage medium of claim 16, wherein the processing device is further to, responsive to determining to migrate the memory page:
determine a destination host NUMA node corresponding to the virtual NUMA of the HASID; and
copy data of the memory page from a first location of the memory page in a source host NUMA node to a second location of the memory in at the destination host NUMA node.

### Claim 19 (depends on 18)

The non-transitory computer-readable storage medium of claim 18, wherein the processing device is further to, prior to creating the new page table entry in the host page table:
identify a previous mapping of a memory address of the GPA to another host NUMA node; and
remove the previous mapping in the host page table.

### Claim 20 (depends on 16)

The non-transitory computer-readable storage medium of claim 16, wherein the HASID comprises a virtual NUMA node indicated by the guest to associate with the GPA, the virtual NUMA node different than a current virtual NUMA node associated with the GPA.
