Virtual machine migration using memory page hints
AssigneeRed Hat Israel, Ltd.
InventorsMichael Tsirkin, Uri Lublin
Life of this patent
Estimating the term…
Abstract
Methods, systems, and computer program products are provided for migrating memory pages. A virtual machine is run by a hypervisor. The virtual machine includes a guest that is allocated a plurality of guest memory pages. A data structure is initialized corresponding to a memory page of the plurality of guest memory pages. A first status is assigned in the data structure to the memory page. The memory page is migrated to a destination and the data structure is modified to assign the memory page a second status.
Claims17
A method for migrating memory pages, the method comprising:
- running a virtual machine by a hypervisor, the virtual machine including a guest that is allocated a plurality of guest memory pages;
- initializing a data structure corresponding to a memory page of the plurality of guest memory pages, wherein the data structure is readable by the guest and writable by the hypervisor;
- assigning the memory page a first status in the data structure, the first status indicating that the memory page has not been migrated;
- migrating the memory page that is assigned the first status;
- assigning the memory page a second status in the data structure, the second status indicating that the memory page has been migrated and has not been modified since the migration;
- receiving a notification that a migration has started;
- determining that at least one memory page of the plurality of guest memory pages is to be modified, wherein the determining is triggered by a request to write data to the at least one memory page;
- in response to determining that the at least one memory page of the plurality of guest memory pages has the first status indicating that the at least one memory page of the plurality of guest memory pages has not been migrated, modifying the at least one memory page of the plurality of guest memory pages that has the first status, wherein the determining is based on a size of data that is to be written into the plurality of guest memory pages;
- and
- notifying the guest via a signal that the data structure has been modified.
A computer program product stored on a non-transitory computer-readable medium, the computer program product comprising machine readable instructions that when executed by one or more processors cause the one or more processors to:
- run a virtual machine by a hypervisor, the virtual machine including a guest that is allocated a plurality of guest memory pages;
- initialize a data structure corresponding to a memory page of the plurality of guest memory pages;
- assign, in the data structure, a first status to the memory page, wherein the first status indicates that the memory page includes data that has not been migrated;
- migrate the memory page;
- and
- assign, in the data structure, a second status to the memory page, wherein the second status indicates that the memory page has been migrated and has not been modified since the migration;
- receiving a notification that a migration has started;
- determining that at least one memory page of the plurality of guest memory pages is to be modified, wherein the determining is triggered by a request to write data to the at least one memory page;
- in response to determining that the at least one memory page of the plurality of guest memory pages has the first status indicating that the at least one memory page of the plurality of guest memory pages has not been migrated, modifying the at least one memory page of the plurality of guest memory pages that has the first status, wherein the determining is based on a size of data that is to be written into the plurality of guest memory pages;
- and
- notifying the guest via a signal that the data structure has been modified.
A system, the system comprising:
- a processor and a memory;
- a data structure stored in the memory, the data structure indicating migration status corresponding to a memory page of a plurality of guest memory pages;
- a hypervisor executed by the processor, the hypervisor to:
- run a virtual machine, the virtual machine including a guest that is allocated the plurality of guest memory pages,
- assign, in the data structure, a first status to the memory page, wherein the first status indicates that the memory page has not been migrated;
- migrate the memory page;
- assign, in the data structure, a second status to the memory page, wherein the second status indicates that the memory page has been migrated and has not been modified since the migration;
- receive a notification that a migration has started;
- determine that at least one memory page of the plurality of guest memory pages is to be modified, wherein the determining is triggered by a request to write data to the at least one memory page;
- in response to determining that the at least one memory page of the plurality of guest memory pages has the first status that indicates that the at least one memory page of the plurality of guest memory pages has not been migrated, modify the at least one memory page of the plurality of guest memory pages that has the first status, wherein the determining is based on a size of data that is to be written into the plurality of guest memory pages;
- and
- notifying the guest via a signal that the data structure has been modified.
Dependencies are inferred from the claim text.