Write minimization for de-allocated memory
AssigneeAmazon Technologies, Inc.
InventorsThomas A. Volpe, Nafea Bshara
Life of this patent
Estimating the term…
Abstract
Disclosed herein are techniques for reducing the number of write operations performed to a storage-class memory in a virtualized environment. In one embodiment, when a memory page is de-allocated from a virtual machine, the memory page and/or the subpages of the memory page are marked as “trimmed” in a control table such that any read to the memory page or subpages is denied, and no physical memory initialization is performed to the memory page or subpages. A de-allocated memory page or subpage is only initialized when it is reallocated and is to be written to by the virtual machine to which the memory page is reallocated.
Claims23
A computer-implemented method, comprising:
- de-allocating physical memory pages allocated to a first virtual machine on a computer system without rewriting the physical memory pages with a pre-determined data pattern, the physical memory pages stored in a storage-class memory of the computer system;
- marking, by a hypervisor and in a control table, the physical memory pages de-allocated from the first virtual machine as trimmed;
- denying access to the physical memory pages marked as trimmed;
- allocating, by the hypervisor, a first physical memory page of the de-allocated physical memory pages marked as trimmed to a second virtual machine;
- receiving a request to access the first physical memory page by the second virtual machine;
- changing, by the hypervisor and in the control table, a status of the first physical memory page from trimmed to not trimmed;
- rewriting the first physical memory page with the pre-determined data pattern after changing the status of the first physical memory page from trimmed to not trimmed in the control table;
- and
- granting, by a memory controller, access to the first physical memory page that stores the pre-determined data pattern by the second virtual machine.
A computer-implemented method, comprising:
- marking physical memory pages de-allocated from a first virtual machine as trimmed in a control table, wherein access by another virtual machine to the physical memory pages marked as trimmed is denied, and wherein the physical memory pages are stored in a memory of a computer system;
- allocating a first physical memory page of the de-allocated physical memory pages marked as trimmed to a second virtual machine;
- receiving a request to write to the first physical memory page by the second virtual machine;
- responsive to receiving the request:
- changing a status of the first physical memory page from trimmed to not trimmed in the control table to allow access to the first physical memory page by the second virtual machine;
- and
- rewriting the first physical memory page with a pre-determined data pattern after changing the status of the first physical memory page from trimmed to not trimmed in the control table.
A system comprising:
- a processor;
- a memory controller coupled to the processor;
- and
- a memory coupled to the memory controller, the memory storing instructions associated with a hypervisor, the instructions, when executed by the processor, causing the processor to:
- mark physical memory pages de-allocated from a first virtual machine as trimmed in a control table, wherein access by another virtual machine to the physical memory pages marked as trimmed is denied, and wherein the physical memory pages are stored in the memory;
- allocate a first physical memory page of the de-allocated physical memory pages marked as trimmed to a second virtual machine;
- receive a request to write to the first physical memory page by the second virtual machine;
- and
- responsive to receiving the request:
- change a status of the first physical memory page from trimmed to not trimmed in the control table to allow access to the first physical memory page by the second virtual machine;
- and
- rewrite the first physical memory page with a pre-determined data pattern based on after changing the status of the first physical memory page from trimmed to not trimmed in the control table.
Dependencies are inferred from the claim text.