IP Library Granted Patent US 10,613,990
Granted Patent B2
US 10,613,990 · App. 15/831,724 · Granted Apr 7, 2020

Host address space identifier for non-uniform memory access locality in virtual machines

Inventors: Andrea Arcangeli (Imola, IT); Michael Tsirkin (Lexington, MA)
Assignee: Red Hat, Inc.
G06F12/1009G06F9/45545G06F12/0292G06F2009/45583
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,613,990
App. No.
15/831,724
Granted
Apr 7, 2020
Kind
B2
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 (47)

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, wherein the HASID corresponds to a non-uniform memory access (NUMA) node locality associated with 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.

2. 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.

3. 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.

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

5. 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.

6. 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 page in the destination host NUMA node.

7. 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.

8. 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.

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

10. 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.

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 the processing device and managed by a hypervisor, that a memory page of the guest is to 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, wherein the HASID corresponds to a non-uniform memory access (NUMA) node locality associated with the GPA;

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.

12. 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.

13. 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.

14. 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.

15. The apparatus of claim 14 , wherein a 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.

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, wherein the HASID corresponds to a non-uniform memory access (NUMA) node locality associated with 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.

17. 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.

18. 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 page at the destination host NUMA node.

19. 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.

20. 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.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 5, 2017
From: ARCANGELI, ANDREA; TSIRKIN, MICHAEL
To: RED HAT, INC.
Reel/Frame 044301/0159 →
Continuity (1)
Related Publication 20190171577A1 · Jun 6, 2019
Cited By (2)
US 12,393,439 US 12,591,445