IP Library › Granted Patent US 10,503,659
Granted Patent B2
US 10,503,659 · App. 15/943,515 · Granted Dec 10, 2019

Post-copy VM migration speedup using free page hinting

Inventors: Michael Tsirkin (Yokeneam Yillit, IL); David A. Gilbert (Manchester, GB)
Assignee: Red Hat Israel, Ltd.
G06F12/1009G06F12/109G06F2212/1024G06F2212/151G06F2212/254G06F2212/261
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,503,659
App. No.
15/943,515
Granted
Dec 10, 2019
Kind
B2
Abstract

A system and methods for migrating a virtual machine (VM). In one embodiment, a hypervisor receives a request to migrate the contents of a memory of a source VM in a first physical memory area to a destination VM in a second physical memory area, where the first and second physical memory areas are disjoint. The hypervisor executes the destination VM in response to the request, and detects an access of a page of memory of the destination VM. The hypervisor determines, in view of a data structure maintained by a guest operating system executing in the destination VM, that a first page of a memory of the source VM in the first physical memory area is currently in use by the destination VM. In response to the detecting, the hypervisor: copies, in view of the first page of VM memory being used by the destination VM, the contents of the first page to a corresponding page of the destination VM; and maps, in view of a second page of VM memory not being used by the destination VM, (i) a physical memory page that is external to the first physical memory area and to the second physical memory area to (ii) a page of the destination VM corresponding to the second page.

Claims (45)

1. A method comprising:

receiving, by a hypervisor executed by a processing device of a host computing system, a request to migrate contents of a memory of a source virtual machine (VM) to a destination VM; and

migrating the contents of the source VM to the destination VM, wherein the migrating comprises:

determining, by the hypervisor, one or more unused pages of the memory of the source VM; and

in response to determining the one or more unused pages, mapping, by the hypervisor, (i) one or more physical memory pages of the host computing system that are external to the memory of the source VM to (ii) one or more memory pages of the destination VM that correspond to the one or more unused pages.

2. The method of claim 1 , wherein the physical memory pages that are external to the memory of the source VM are zero pages of a physical machine, and wherein the mapping to the zero pages is read-only.

3. The method of claim 2 , further comprising:

detecting, via the hypervisor, a command to write to at least one of the memory pages of the destination VM that are mapped to the zero pages; and

in response to detecting the command, allocating at least one writeable physical memory page and mapping the at least one of the memory pages of the destination VM to the allocated at least one writeable physical memory page.

4. The method of claim 1 , wherein determining the one or more unused pages of the memory of the source VM comprises determining, in view of a data structure that maintains a used status of memory pages of the source VM, the one or more unused pages of the memory of the source VM.

5. The method of claim 1 , wherein the request to migrate the contents of the memory comprises a request to migrate the contents of the memory stored in a first physical memory area corresponding to the source VM to a second physical memory area corresponding to the destination VM.

6. The method of claim 5 , wherein the first physical memory area and the second physical memory area are associated with a physical machine.

7. The method of claim 5 , wherein the second physical memory area is associated with a physical machine, and wherein the first physical memory area is associated with a different physical machine.

8. The method of claim 1 , wherein migrating the contents of the source VM to the destination VM, further comprises:

determining, by the hypervisor, one or more used pages of the memory of the source VM that are in use by the destination VM; and

in response to determining the one or more used pages, copying, by the hypervisor, contents of the one or more used pages of the memory of the source VM to corresponding one or more memory pages of the destination VM.

9. The method of claim 1 , wherein mapping of (i) the one or more physical memory pages of the host computing system that are external to the memory of the source VM to (ii) the one or more memory pages of the destination VM that correspond to the one or more unused pages is performed instead of copying the one or more unused pages of memory of the source VM to the destination VM.

10. An apparatus comprising:

one or more physical memories; and

a processing device, operatively coupled to the one or more physical memories, to:

execute a hypervisor;

receive, via the hypervisor executed by the processing device, a request to migrate contents of a memory of a source virtual machine (VM) to a destination VM; and

migrate the contents of the source VM to the destination VM, wherein to migrate the contents of the source VM, the processing device is to:

determine, via the hypervisor, one or more unused pages of the memory of the source VM; and

in response to determining the one or more unused pages, map, via the hypervisor, (i) one or more physical memory pages that are external to the memory of the source VM to (ii) one or more memory pages of the destination VM that correspond to the one or more unused pages.

11. The apparatus of claim 10 , wherein the physical memory pages that are external to the memory of the source VM are zero pages of a physical machine, and wherein the mapping to the zero pages is read-only.

12. The apparatus of claim 11 , wherein the processing device is further to:

detect, via the hypervisor, a command to write to at least one of the memory pages of the destination VM that are mapped to the zero pages; and

in response to detecting the command, allocate at least one writeable physical memory page and map the at least one of the memory pages of the destination VM to the allocated at least one writeable physical memory page.

13. The apparatus of claim 10 , wherein to determine the one or more unused pages of the memory of the source VM, the processing device is further to determine, in view of a data structure that maintains a used status of memory pages of the source VM, the one or more unused pages of the memory of the source VM.

14. The apparatus of claim 10 , wherein the request to migrate the contents of the memory comprises a request to migrate the contents of the memory stored in a first physical memory area corresponding to the source VM to a second physical memory area corresponding to the destination VM.

15. A non-transitory computer-readable medium comprising instructions that, when executed by a processing device of a physical machine, cause the processing device to execute a hypervisor to:

receive a request to migrate contents of a memory of a source virtual machine (VM) to a destination VM; and

migrate the contents of the source VM to the destination VM, wherein to migrate the contents of the source VM, the processing device is to:

determine one or more unused pages of the memory of the source VM; and

in response to determining the one or more unused pages, map (i) one or more physical memory pages that are external to the memory of the source VM to (ii) one or more memory pages of the destination VM that correspond to the one or more unused pages.

16. The non-transitory computer-readable medium of claim 15 , wherein the physical memory pages that are external to the memory of the source VM are zero pages of a physical machine, and wherein the mapping to the zero pages is read-only.

17. The non-transitory computer-readable medium of claim 16 , wherein the hypervisor is further to:

detect a command to write to at least one of the memory pages of the destination VM that are mapped to the zero pages; and

in response to detecting the command, allocate at least one writeable physical memory page and mapping the at least one of the memory pages of the destination VM to the allocated at least one writeable physical memory page.

18. The non-transitory computer-readable medium of claim 15 , wherein to determine the one or more unused pages of the memory of the source VM, the processing device is further to determine, in view of a data structure that maintains a used status of memory pages of the source VM, the one or more unused pages of the memory of the source VM.

19. The non-transitory computer-readable medium of claim 15 , wherein the request to migrate the contents of the memory comprises a request to migrate the contents of the memory stored in a first physical memory area corresponding to the source VM to a second physical memory area corresponding to the destination VM.

20. The non-transitory computer readable medium of claim 15 , wherein the hypervisor is further to:

determine one or more used pages of the memory of the source VM that are in use by the destination VM; and

in response to determining the one or more used pages, copy contents of the one or more used pages of the memory of the source VM to corresponding one or more memory pages of the destination VM.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 2, 2018
From: TSIRKIN, MICHAEL; GILBERT, DAVID ALAN
To: RED HAT ISRAEL, LTD.
Reel/Frame 045415/0056 →
Continuity (2)
Continuation 14952833 · Nov 25, 2015
Related Publication 20180225221A1 · Aug 9, 2018
Cited By (1)
US 12,639,090