Page table based dirty page tracking
AssigneeRed Hat Israel, Ltd.
InventorMichael Tsirkin
Life of this patent
Estimating the term…
Abstract
A hypervisor identifies a set of pages associated with a guest operating system (OS) of a virtual machine (VM) that are shared with an application. The hypervisor maps each of the set of pages associated with the guest OS to a corresponding page associated with the application. The hypervisor modifies a write protection attribute for each corresponding page associated with the application to cause a protection page fault upon an application attempt to update the corresponding page. The hypervisor detects updated pages by detecting the protection page fault upon the application attempt to update one of the corresponding pages associated with the application. The hypervisor then logs a modification of each updated corresponding page.
Claims18
A method comprising:
- identifying, by a processing device of a first host executing a hypervisor, a set of pages of a guest operating system (OS) of a virtual machine that are shared with an application associated with the guest OS, wherein the application is a virtual network interface controller (NIC) application, and wherein the virtual NIC application writes communication packets to the set of pages shared with the guest OS:
- mapping, by the hypervisor, each of the set of pages associated with the guest OS to a corresponding page associated with the virtual NIC application, the mapping stored in a mapping table accessible by the hypervisor;
- responsive to receiving, by the hypervisor, a request to migrate the virtual machine to a second host, modifying, by the hypervisor, a write protection attribute for each corresponding page associated with the virtual NIC application to cause a protection page fault upon the virtual NIC application attempt to update the corresponding page;
- detecting, by the hypervisor, updated pages, wherein detecting updated pages comprises detecting the protection page fault upon the virtual NIC application attempt to update one of the corresponding pages associated with the virtual NIC application;
- logging, by the hypervisor, a modification of each updated corresponding page, wherein logging the modification of each updated corresponding page comprises translating an address of the updated corresponding page associated with the virtual NIC application to a guest physical address of a corresponding shared page associated with the guest OS of the virtual machine;
- and
- determining, based on logged modifications of updated corresponding pages, whether the updated corresponding pages are to be copied to another location associated with migrating the virtual machine to the second host.
A computing apparatus comprising:
- a memory to store instructions;
- and
- a processing device, operatively coupled to the memory, to execute the instructions, wherein the processing device is to:
- identify, by the processing device executing a hypervisor, a set of pages of a guest operating system (OS) of a virtual machine that are shared with an application associated with the guest OS, wherein the application is a virtual network interface controller (NIC) application, and wherein the virtual NIC application writes communication packets to the set of pages shared with the guest OS;
- map, by the hypervisor, each of the set of pages of the guest OS to a corresponding page associated with the virtual NIC application, the mapping stored in a mapping table accessible by the hypervisor;
- responsive to receiving, by the hypervisor, a request to migrate the virtual machine to a second host, modify, by the hypervisor, a write protection attribute for each corresponding page associated with the virtual NIC application to cause a protection page fault upon the virtual NIC application attempt to update the corresponding page;
- detect, by the hypervisor, updated pages, wherein detecting updated pages comprises detecting the protection page fault upon the virtual NIC application attempt to update one of the corresponding pages associated with the virtual NIC application;
- log, by the hypervisor, a modification of each updated corresponding page, wherein to log the modification, the processing device is to translate an address of the updated page associated with the virtual NIC application to a guest physical address of a corresponding shared page associated with the guest OS of the virtual machine;
- and
- determine, based on logged modification of each updated corresponding pages, whether the updated corresponding pages are to be copied to another location associated with migrating the virtual machine to the second host.
A non-transitory computer readable storage medium, having instructions stored therein, which when executed by a processing device of a computer system, cause the processing device to:
- identify, by the processing device executing a hypervisor, a set of pages associated with the guest operating system (OS) of a virtual machine that are shared with an application associated with the guest OS, wherein the application is a virtual network interface controller (NIC) application, and wherein the virtual NIC application writes communication packets to the set of pages shared with the guest OS;
- map, by the hypervisor, each of the set of pages associated with the guest OS to a corresponding page associated with the virtual NIC application, the mapping stored in a mapping table accessible by the hypervisor,
- responsive to receiving, by the hypervisor, a request to migrate the virtual machine to a second host, modify, by the hypervisor, a write protection attribute for each corresponding page associated with the virtual NIC application to cause a protection page fault upon the virtual NIC application attempt to update the corresponding page;
- detect, by the hypervisor, updated pages, wherein detecting updated pages comprises detecting the protection page fault upon the virtual NIC application attempt to update one of the corresponding pages associated with the virtual NIC application;
- log, by the hypervisor, a modification of each updated corresponding page, wherein to log the modification, the processing device is to translate an address of the updated page associated with the virtual NIC application to a guest physical address of a corresponding shared page associated with the guest OS of the virtual machine;
- and
- determine, based on logged modification of each updated corresponding pages, whether the updated corresponding pages are to be copied to another location associated with migrating the virtual machine to the second host.
Dependencies are inferred from the claim text.