Page compressibility checker
First Claim
1. A method for checking the compressibility of virtual machine (VM) memory pages for facilitating host swapping on a host system, the method comprising:
- identifying a swap target VM that a hypervisor of the host system has determined to be a target for host swapping;
determining, by the host system, a target number of swap candidate pages to be swapped to disk from an allocated memory space of the swap target VM;
selecting, by the host system, a memory page at random from the allocated memory space of the swap target VM;
determining, by the host system, a compression ratio for the memory page by compressing the memory page using a first compression algorithm;
comparing, by the host system, the compression ratio to a threshold;
if the compression ratio does not exceed the threshold;
predicting, by the host system, that the memory page is compressible by a second compression algorithm that is distinct from the first compression algorithm, wherein on average the second compression algorithm is slower, but achieves a lower compression ratio, than the first compression algorithm; and
adding the memory page to a list of swap candidate pages for the swap target VM;
determining, by the host system subsequently to adding the memory page to the list of swap candidate pages, whether the target number of swap candidate pages has been reached;
if the target number of swap candidate pages has not been reached, determining, by the host system, whether a maximum number of memory pages that the host system may check for compressibility has been reached; and
if the maximum number of memory pages that the host system may check for compressibility has been reached, adding, by the host system, randomly selected memory pages from the allocated memory space of the swap target VM to the list of swap candidate pages until the target number of swap candidate pages is reached.
2 Assignments
0 Petitions
Accused Products
Abstract
Techniques for checking the compressibility of a memory page that is allocated to a virtual machine (VM) running on a host system are provided. In one embodiment, the host system can determine a compression ratio for the memory page by compressing the memory page using a first compression algorithm. The host system can then compare the compression ratio to a threshold. If the compression ratio does not exceed the threshold, the host system can predict that the memory page is compressible by a second compression algorithm that is distinct from the first compression algorithm. On average, the second compression algorithm can be slower, but achieve a lower compression ratio, than the first compression algorithm.
23 Citations
24 Claims
-
1. A method for checking the compressibility of virtual machine (VM) memory pages for facilitating host swapping on a host system, the method comprising:
-
identifying a swap target VM that a hypervisor of the host system has determined to be a target for host swapping; determining, by the host system, a target number of swap candidate pages to be swapped to disk from an allocated memory space of the swap target VM; selecting, by the host system, a memory page at random from the allocated memory space of the swap target VM; determining, by the host system, a compression ratio for the memory page by compressing the memory page using a first compression algorithm; comparing, by the host system, the compression ratio to a threshold; if the compression ratio does not exceed the threshold; predicting, by the host system, that the memory page is compressible by a second compression algorithm that is distinct from the first compression algorithm, wherein on average the second compression algorithm is slower, but achieves a lower compression ratio, than the first compression algorithm; and adding the memory page to a list of swap candidate pages for the swap target VM; determining, by the host system subsequently to adding the memory page to the list of swap candidate pages, whether the target number of swap candidate pages has been reached; if the target number of swap candidate pages has not been reached, determining, by the host system, whether a maximum number of memory pages that the host system may check for compressibility has been reached; and if the maximum number of memory pages that the host system may check for compressibility has been reached, adding, by the host system, randomly selected memory pages from the allocated memory space of the swap target VM to the list of swap candidate pages until the target number of swap candidate pages is reached. - View Dependent Claims (2, 3, 4, 5, 6, 7, 22)
-
-
8. A non-transitory computer readable storage medium having stored thereon software executable by a host system, the software embodying a method for checking the compressibility of virtual machine (VM) memory pages for facilitating host swapping on the host system, the method comprising:
-
identifying a swap target VM that a hypervisor of the host system has determined to be a target for host swapping; determining, by the host system, a target number of swap candidate pages to be swapped to disk from an allocated memory space of the swap target VM; selecting, by the host system, a memory page at random from the allocated memory space of the swap target VM; determining a compression ratio for the memory page by compressing the memory page using a first compression algorithm; comparing the compression ratio to a threshold; if the compression ratio does not exceed the threshold; predicting that the memory page is compressible by a second compression algorithm that is distinct from the first compression algorithm, wherein on average the second compression algorithm is slower, but achieves a lower compression ratio, than the first compression algorithm; and adding the memory page to a list of swap candidate pages for the swap target VM; determining, subsequently to adding the memory page to the list of swap candidate pages, whether the target number of swap candidate pages has been reached; if the target number of swap candidate pages has not been reached, determining whether a maximum number of memory pages that the host system may check for compressibility has been reached; and if the maximum number of memory pages that the host system may check for compressibility has been reached, adding randomly selected memory pages from the allocated memory space of the swap target VM to the list of swap candidate pages until the target number of swap candidate pages is reached. - View Dependent Claims (9, 10, 11, 12, 13, 14, 23)
-
-
15. A computer system comprising:
-
a processor; and a non-transitory computer readable medium having stored thereon program code that causes the processor to, upon being executed; identify a swap target VM that a hypervisor of the computer system has determined to be a target for host swapping; determine a target number of swap candidate pages to be swapped to disk from an allocated memory space of the swap target VM; select a memory page at random from the allocated memory space of the swap target VM; determine a compression ratio for the memory page by compressing the memory page using a first compression algorithm; compare the compression ratio to a threshold; if the compression ratio does not exceed the threshold; predict that the memory page is compressible by a second compression algorithm that is distinct from the first compression algorithm, wherein on average the second compression algorithm is slower, but achieves a lower compression ratio, than the first compression algorithm; and add the memory page to a list of swap candidate pages for the swap target VM; determine, subsequently to adding the memory page to the list of swap candidate pages, whether the target number of swap candidate pages has been reached; if the target number of swap candidate pages has not been reached, determine whether a maximum number of memory pages that the host system may check for compressibility has been reached; and if the maximum number of memory pages that the host system may check for compressibility has been reached, add randomly selected memory pages from the allocated memory space of the swap target VM to the list of swap candidate pages until the target number of swap candidate pages is reached. - View Dependent Claims (16, 17, 18, 19, 20, 21, 24)
-
Specification