The present disclosure relates to the field of computing, in particular, to apparatuses, methods and storage media associated with memory management in virtualized computing.
The background description provided herein is for the purpose of generally presenting the context of the disclosure. Unless otherwise indicated herein, the materials described in this section are not prior art to the claims in this application and are not admitted to be prior art by inclusion in this section.
In a virtualization environment, when creating a virtual machine (VM), a host system typically allocates enough memory for the VM. Frequently, the allocated memory is not fully used by the VM. Various memory saving technologies have been developed to free unused memory of the VM for allocation to other VMs, to improve overall system memory usage efficiency, and in turn, overall system performance. However, so far there is no efficient method developed for freeing used memory of VM to further improve system memory usage and performance.
Embodiments will be readily understood by the following detailed description in conjunction with the accompanying drawings. To facilitate this description, like reference numerals designate like structural elements. Embodiments are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings.
Apparatuses, methods and storage media associated with memory management in virtualized computing are disclosed herein. In embodiments, an apparatus may include a virtual machine manager to manage operations of a plurality of virtual machines, having a memory manager to manage allocation and de-allocation of physical memory to and from the plurality of virtual machines. Allocation and de-allocation may include de-allocation of unused and used physical memory allocated to a first of the plurality of virtual machines to recover physical memory for allocation to one or more other ones of the plurality of virtual machines, and re-allocation of physical memory for the previously de-allocated unused and used physical memory of the first virtual machine. As a result, more virtual machines may be supported for a given amount of physical memory, or less memory may be required to support a given number of virtual machines.
In embodiments, the memory management technology disclosed herein may be employed by a cloud computing server configured to host a number of virtual machines, or by mobile devices configured to operate with multiple operating systems, e.g., an operating system configured to support phone or tablet computing, such as Android™, and another operating system configured to support laptop computing, such as Windows®.
In the following detailed description, reference is made to the accompanying drawings, which form a part hereof, wherein like numerals designate like parts throughout, and in which is shown, by way of illustration, embodiments that may be practiced. It is to be understood that other embodiments may be utilized and structural or logical changes may be made without departing from the scope of the present disclosure. Therefore, the following detailed description is not to be taken in a limiting sense, and the scope of certain embodiments is defined by the appended claims and their equivalents.
Operations of various methods may be described as multiple discrete actions or operations in turn, in a manner that is most helpful in understanding the claimed subject matter. However, the order of description should not be construed as to imply that these operations are necessarily order dependent. In particular, these operations may not be performed in the order of presentation. Operations described may be performed in a different order than the described embodiments. Various additional operations may be performed and/or described operations may be omitted, split or combined in additional embodiments.
For the purposes of the present disclosure, the phrase “A and/or B” means (A), (B), or (A and B). For the purposes of the present disclosure, the phrase “A, B, and/or C” means (A), (B), (C), (A and B), (A and C), (B and C), or (A, B and C).
The description may use the phrases “in an embodiment,” or “in embodiments,” which may each refer to one or more of the same or different embodiments. Furthermore, the terms “comprising,” “including,” “having,” and the like, as used with respect to embodiments of the present disclosure, are synonymous.
As used hereinafter, including the claims, the term “module” may refer to, be part of, or include an Application Specific Integrated Circuit (ASIC), an electronic circuit, a processor (shared, dedicated, or group) and/or memory (shared, dedicated, or group) that execute one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that provide the described functionality.
Software elements 202 may include virtual machine manager (VMM) 206 configured to manage operations of a number of virtual machines, e.g., 212 and 214, hosted by computing device 200. VMM 206 may include memory manager 208 to manage allocation and de-allocation of physical memory 225 to virtual machines 212/214 in support of the virtual memory spaces of virtual machines 212/214. Additionally, memory manager 208 may be configured to manage mapping of the virtual addresses of the virtual memory spaces of virtual machines 212/214 to physical addresses of physical memory 225 to facilitate access of memory locations within memory 225. In embodiments, memory locations of memory 225 may be organized and managed in units of pages, and memory manager 208 may be configured with page tables (not shown) to manage allocation/de-allocation of the resources of memory 225, as well as control access to the allocated resources. Further, memory manager 208 may be configured with memory management techniques that reduce the amount of memory 225 required to support a number of virtual machines 212/214 for a given service level requirement, or support more virtual machines 212/214 at a service level requirement, for a given amount of memory 225, to be further described below.
Each virtual machine 212/214 may include an operating system (OS) 204. OS 204 of each virtual machine 212/214 may be the same or different. Each OS 204 may include firmware 236, device drivers 234 and applications 232. Firmware 236 may be configured to provide basic system input/output services, including, but not limited to, basic services employed for the operation of virtual machine 212/214 prior to the operation of OS 204. Examples of OS 204 may include, but are not limited to, Android™, available from Google, Inc of Mountain View, Calif., or Windows®, available from Microsoft Corporation, of Redmond, Wash. Examples of device drivers 234 may include, but are not limited to, video drivers, network drivers, disk drivers, and so forth. Examples of applications 232 may include, but are not limited to, web services, Internet portal services, search engines, social networking, news services, games, word processing, spreadsheets, calendars, telephony, imaging, and so forth.
While for ease of understanding, only two virtual machines are illustrated in
Continuing to refer to
In embodiments, VMM 206 may be configured to request memory manager 208 to de-allocate unused and used memory of a virtual machine 212/214, in response to a determination that the virtual machine 212/214 is transitioning from an active state to a low activity state or an idle state. Further, VMM 206 may be configured to request memory manager 208 to re-allocate memory to a virtual machine 212/214 to replace the previously de-allocated unused and used memory of a virtual machine 212/214, in response to a determination that the virtual machine 212/214 is transitioning from a low activity or an idle state to an active state.
In embodiments, to facilitate de-allocation of unused memory of a virtual machine 212/214 and re-allocation of memory to replenish previously de-allocated unused memory of the virtual machine 212/214, memory manager 208 may be configured to include an associated driver, and cause the associated driver to be installed in OS 204 of a virtual machine 212/214 (e.g., as one of device drivers 234). In embodiments, the associated driver 234 may be pre-installed in OS 204. In other embodiments, the associated driver 234 may be installed in OS 204 in real time, on instantiation of OS 204. In embodiments, to facilitate de-allocation of used memory of a virtual machine 212/214, and re-allocation of memory for previously de-allocated used memory of the virtual machine 212/214, VMM 206 may be configured to include a memory pool 210. In embodiments, memory pool 210 may be configured as a block device.
In embodiments, VMM 206 may be the first third party driver running from firmware, in particular, firmware configured with Unified Extensible Firmware Interface (UEFI).
To further describe usage of the associated driver 234 and memory pool 210, refer now also to
Process 250 may start at block 252. At block 252, a determination may be made, e.g., by memory manager 208, on whether a received memory management request is to de-allocate memory allocated to a virtual machine 212/214, or to re-allocate memory to a virtual machine 212/214 for previously de-allocated memory. If the request is to de-allocate memory allocated to a virtual machine 212/214, process 250 may proceed to block 254. On the other hand, if the request is to re-allocate memory to a virtual machine 212/214 for previously de-allocated memory, process 250 may proceed to block 258.
At block 254, the unused memory of the virtual machine 212/214 may be freed, i.e., de-allocated, and made available for allocation to other virtual machines 212/214 hosted by computing device 200. For the earlier described embodiments with memory manager 208 having associated driver 234, as part of the de-allocation process, a request may be made to OS 204, e.g., by memory manager 208, to assign the virtual memory that maps to the unused memory of the virtual machine 212/214 to associated driver 234. On receipt of identifications of the virtual memory of the virtual machine 212/214 having been assigned to driver 234, memory allocation/mapping tables may be updated, to reflect the availability of the recovered memory for allocation to other virtual machines 212/214 hosted by computing device 200. In embodiments, the amount of unused memory freed may vary at the discretion of memory manager 208. In other words, memory manager 208 may ascertain, e.g., through the special driver 234 it caused to be installed, the amount of unused memory available, and request all or a portion to be assigned/freed. From block 254, process 250 may proceed to block 256.
At block 256, the used memory of the virtual machine 212/214 may be partially freed, i.e., partially de-allocated, and made available for allocation to other virtual machines 212/214 hosted by computing device 200. More specifically, as part of the de-allocation process, a portion of memory pool 210 may be allocated to the virtual machine 212/214, to replace (swap for) the used memory of the virtual machine 212/214. Data in the used memory being swapped may be compressed, and copied into the portion of memory pool 210, thereby allowing the used memory of the virtual machine 212/214 to be freed for allocation to other virtual machines 212/214 hosted by computing device 200. Typically, by virtue of compression, the (swap in) area in memory pool 210 will be smaller than the used memory being de-allocated. The amount of reduction may depend on a particular compression technique employed.
From block 256, the process may terminate.
At block 258, the previously partially de-allocated used memory of the virtual machine 212/214 may be replenished. More specifically, as part of the re-allocation process, a new area of memory 225 may be allocated to the virtual machine 212/214 being resumed, to replace (swap for) the used memory of the virtual machine 212/214. Data in the used memory may be decompressed, and copied into the new area of memory 225 being newly allocated to the virtual machine 212/214, thereby restoring the data in the used memory, enabling the virtual machine 212/214 to resume operation. Typically, the new area of memory 225 being allocated (swap in) will be larger than the replaced (swap out) area. From block 258, process 250 may proceed to block 260.
At block 260, the previously de-allocated unused memory of the virtual machine 212/214 may be restored, i.e., re-allocated. For the earlier described embodiments with memory manager 208 having associated driver 234, as part of the re-allocation process, in addition to updating the memory allocation/mapping table, a request may be made to OS 204, e.g., by memory manager 208, to un-assign from associated driver 234 the virtual memory that maps to the unused memory of the virtual machine 212/214, thereby allowing the unused memory of the virtual machine 212/214 to be available for use by applications 232 or OS 204 of the virtual machines 212/214.
From block 260, the process may terminate.
Thereafter, a portion of the used memory 302 is also freed, through, e.g., the earlier described compressed and swap technique 314. As illustrated in the lower portion of
The process is reversed when the previously de-allocated used and unused memory 302 and 304 are replenished, with the used memory 302 being restored first, followed by the unused memory 304, going from the lower portion of
In an example application of the present disclosure to a dual OS computing device having Android™ and Windows®, potential substantial saving was observed. On initialization, Windows® was created on top of Android′ with 1 GB of memory assigned to Windows®, and about 450 MB used. When Windows® is not used actively, ˜500 MB of the unused memory was first freed and made available to Android′ as earlier described. Thereafter, another ˜300 MB of the 450 MB used memory may be further freed as earlier described, resulting in almost 800 MB of memory being freed for use by Android™ to improve its performance.
Referring now to
Each of these elements may perform its conventional functions known in the art. In particular, system memory 404 and mass storage device(s) 406 may be employed to store a working copy and a permanent copy of the programming instructions implementing the operations described earlier, e.g., but not limited to, operations associated with VMM 206 (including memory manager 208), denoted as computational logic 422. The various elements may be implemented by assembler instructions supported by processor(s) 402 or high-level languages, such as, for example, C, that can be compiled into such instructions.
The permanent copy of the programming instructions may be placed into permanent mass storage device(s) 406 in the factory, or in the field, through, for example, a distribution medium (not shown), such as a compact disc (CD), or through communication interface 410 (from a distribution server (not shown)). That is, one or more distribution media having an implementation of the agent program may be employed to distribute the agent and program various computing devices.
The number, capability and/or capacity of these elements 410-412 may vary, depending on the intended use of example computer 400, e.g., whether example computer 400 is a smartphone, tablet, ultrabook, laptop or a server. The constitutions of these elements 410-412 are otherwise known, and accordingly will not be further described.
Referring back to
Accordingly, embodiments for manage memory for virtualized computing have been described. Example embodiments may include:
Example 1 may be an apparatus for virtualized computing. The apparatus may comprise: one or more processors; physical memory coupled with the one or more processors; and a virtual machine manager. The virtual machine manager may be operated by the one or more processors to manage operations of a plurality of virtual machines, having a memory manager to manage allocation and de-allocation of the physical memory to and from the plurality of virtual machines, which may include: de-allocation of unused and used physical memory allocated to a first of the plurality of virtual machines to recover physical memory for allocation to other one or ones of the plurality of virtual machines, and re-allocation of physical memory to replenish previously de-allocated unused and used physical memory of the first virtual machine.
Example 2 may be example 1, wherein the memory manager may perform the de-allocation or the re-allocation in response to a request.
Example 3 may be example 2, wherein the virtual machine manager may make the request in response to a determination that the first virtual machine is entering or leaving a particular state.
Example 4 may be example 3, wherein the virtual machine manager may make the request in response to a determination that the first virtual machine is entering or leaving an idle or background state.
Example 5 may be example 3, wherein the virtual machine manager may further monitor state transitions of the plurality of virtual machines.
Example 6 may be any one of examples 1-5, wherein the memory manager may further cause a driver to be installed in an operating system of the first virtual machine, and to request the operating system to assign unused virtual memory addresses of the first virtual machine to the driver as part of the de-allocation of unused physical memory from the first virtual machine.
Example 7 may be example 6, wherein the memory manager may further request the operating system to un-assign the virtual memory addresses of the first virtual machine assigned to the driver as part of the re-allocation of the physical memory for the previously de-allocated unused physical memory of the first virtual machine.
Example 8 may be any one of examples 1-7, wherein the memory manager may further compress data in the used physical memory and copy the data after compression into a memory pool of the virtual machine manager as part of the de-allocation of used physical memory from the first virtual machine.
Example 9 may be example 8, wherein the memory manager may further decompress the compressed data copied into the memory pool, and copy the data after decompression back into physical memory allocated to the first virtual machine as part of the re-allocation of the physical memory for the previously de-allocated unused physical memory of the first virtual machine.
Example 10 may be example 1-9, wherein the apparatus is a selected one of a mobile device or a cloud computing server.
Example 11 is an example method for virtualized computing. The method may comprise: de-allocating, by a computing system, unused and used physical memory allocated to a first of a plurality of virtual machines of the computing system to recover physical memory for allocation to other one or ones of the plurality of virtual machines; and re-allocating, by the computing system, physical memory to replenish previously de-allocated unused and used physical memory of the first virtual machine.
Example 12 may be example 11, wherein de-allocating or re-allocating may be performed in response to a request.
Example 13 may be example 12, wherein the request may be made in response to a determination that the first virtual machine is entering or leaving a particular state.
Example 14 may be example 13, wherein the request may be made in response to a determination that the first virtual machine is entering or leaving an idle or background state.
Example 15 may be example 13, further comprising monitoring, by the computing system, state transitions of the plurality of virtual machines.
Example 16 may be any one of examples 11-15, further comprising a virtual machine manager of the computing system causing a driver to be installed in an operating system of the first virtual machine, and requesting the operating system to assign unused virtual memory addresses of the first virtual machine to the driver as part of de-allocating unused physical memory from the first virtual machine.
Example 17 may be example 16, further comprising requesting, by the computing system, the operating system to un-assign the virtual memory addresses of the first virtual machine assigned to the driver as part of re-allocating the physical memory for the previously de-allocated unused physical memory of the first virtual machine.
Example 18 may be any one of examples 11-17, further comprising compressing, by the computing system, data in the used physical memory and copying the data after compression into a memory pool of a virtual machine manager of the computing system as part of de-allocating used physical memory from the first virtual machine.
Example 19 may be example 18, further comprising decompressing, by the computing system, the compressed data copied into the memory pool, and copying the data after decompression back into physical memory allocated to the first virtual machine as part of re-allocating the physical memory for the previously de-allocated unused physical memory of the first virtual machine.
Example 20 may be any one of examples 11-19, wherein the computing system is a selected one of a mobile device or a cloud computing server.
Example 21 is one non-transitory computer-readable storage medium having instructions that cause a computer system, in response to execution of the instructions by a computer system, to: de-allocate unused and used physical memory allocated to a first of a plurality of virtual machines of the computer system to recover physical memory for allocation to other one or ones of the plurality of virtual machines, and re-allocate physical memory to replenish previously de-allocated unused and used physical memory of the first virtual machine.
Example 22 may be example 21, wherein de-allocate or re-allocate may be performed in response to a request.
Example 23 may be example 22, wherein the request may be made in response to a determination that the first virtual machine is entering or leaving a particular state.
Example 24 may be example 23, wherein the request may be made in response to a determination that the first virtual machine is entering or leaving an idle or background state.
Example 25 may be example 23, wherein the computer system may be further caused to monitor state transitions of the plurality of virtual machines.
Example 26 may be any one of examples 21-25, wherein the computer system may be further caused to have a virtual machine manager of the computer system cause a driver to be installed in an operating system of the first virtual machine, and to request the operating system to assign unused virtual memory addresses of the first virtual machine to the driver as part of the de-allocation of unused physical memory from the first virtual machine.
Example 27 may be example 26, wherein the virtual machine manager may be further caused to request the operating system to un-assign the virtual memory addresses of the first virtual machine assigned to the driver as part of the re-allocation of the physical memory for the previously de-allocated unused physical memory of the first virtual machine.
Example 28 may be any one of examples 21-27, wherein the computer system may be further caused to compress data in the used physical memory and copy the data after compression into a memory pool of a virtual machine manager of the computer system as part of the de-allocation of used physical memory from the first virtual machine.
Example 29 may be example 28, wherein the computer system may be further caused to decompress the compressed data copied into the memory pool, and copy the data after decompression back into physical memory allocated to the first virtual machine as part of the re-allocation of the physical memory for the previously de-allocated unused physical memory of the first virtual machine.
Example 30 may be any one of examples 21-29, wherein the computer system may be a selected one of a mobile device or a cloud computing server.
Example 31 may be an apparatus for virtualized computing. The apparatus may comprise: means for de-allocating unused and used physical memory allocated to a first of a plurality of virtual machines of the computing system to recover physical memory for allocation to other one or ones of the plurality of virtual machines; and means for re-allocating physical memory to replenish previously de-allocated unused and used physical memory of the first virtual machine.
Example 32 may be example 31, wherein de-allocating or re-allocating may be performed in response to a request.
Example 33 may be example 32, wherein the request may be made in response to a determination that the first virtual machine is entering or leaving a particular state.
Example 34 may be example 33, wherein the request may be made in response to a determination that the first virtual machine is entering or leaving, an idle or background state.
Example 35 may be example 33, further comprising means for monitoring state transitions of the plurality of virtual machines.
Example 36 may be any one of examples 31-35, further comprising means for causing driver to be installed in an operating system of the first virtual machine, and requesting the operating system to assign unused virtual memory addresses of the first virtual machine to the driver as part of de-allocating unused physical memory from the first virtual machine.
Example 37 may be example 36, further comprising means for requesting the operating system to un-assign the virtual memory addresses of the first virtual machine assigned to the driver as part of re-allocating the physical memory for the previously de-allocated unused physical memory of the first virtual machine.
Example 38 may be any one of examples 31-38, further comprising means for compressing data in the used physical memory and copying the data after compression into a memory pool of a virtual machine manager of the computing system as part of de-allocating used physical memory from the first virtual machine.
Example 39 may be example 38, further comprising means for decompressing the compressed data copied into the memory pool, and copying the data after decompression back into physical memory allocated to the first virtual machine as part of re-allocating the physical memory for the previously de-allocated unused physical memory of the first virtual machine.
Example 40 may be any one of examples 31-39, wherein the apparatus may be a selected one of a mobile device or a cloud computing server.
Although certain embodiments have been illustrated and described herein for purposes of description, a wide variety of alternate and/or equivalent embodiments or implementations calculated to achieve the same purposes may be substituted for the embodiments shown and described without departing from the scope of the present disclosure. This application is intended to cover any adaptations or variations of the embodiments discussed herein. Therefore, it is manifestly intended that embodiments described herein be limited only by the claims.
Where the disclosure recites “a” or “a first” element or the equivalent thereof, such disclosure includes one or more such elements, neither requiring nor excluding two or more such elements. Further, ordinal indicators (e.g., first, second or third) for identified elements are used to distinguish between the elements, and do not indicate or imply a required or limited number of such elements, nor do they indicate a particular position or order of such elements unless otherwise specifically stated.
Number | Date | Country | |
---|---|---|---|
Parent | 14778054 | Sep 2015 | US |
Child | 15808581 | US |