Database Reference
In-Depth Information
multiple VMs at a physical host and the physical memory turns stressed, none of the
VMs can automatically help in freeing up memory. The hypervisor deals with the
situation by applying a reclamation technique . As its name suggests, a reclamation
technique attempts to reclaim inactive real memory pages at VMs and make them
available for the hypervisor upon experiencing a memory shortage. One popular
reclamation technique is the ballooning process incorporated in VMWare ESX [62].
In VMWare ESX, a balloon driver must be installed and enabled in each guest OS
as a pseudodevice driver. The balloon driver regularly polls the hypervisor through a
private channel to obtain a target balloon size. As illustrated in Figure 16.20, when the
hypervisor experiences memory shortage, it inflates the balloon by setting a proper tar-
get balloon size. Figure 16.20a shows 4 real memory pages mapped to 4 physical pages,
out of which only 2 pages are actually active (the red and the yellow ones). Without
involving the ballooning process, the hypervisor is unaware of the other 2 inactive
pages (the green and the dark blue ones) since they are still mapped to physical pages.
Consequently, the hypervisor will not be able to reclaim inactive pages unless getting
informed. With memory ballooning, however, the hypervisor can set the balloon target
size to an integer number (say 2 or 3). When recognized by the balloon driver at the
guest OS, the driver checks out the pages, locates the 2 inactive ones, and pins them
(see Figure 16.20b). The pinning process is carried out by the guest OS via ensuring
that the pinned pages cannot be read/written by any process during memory reclama-
tion. After pinning the inactive pages, the balloon driver transmits to the hypervisor
the addresses of the pinned pages. Subsequently, the hypervisor proceeds safely with
reclaiming the respective physical pages and allocating them to needy VMs. Finally, to
unpin pinned pages, the hypervisor deflates the balloon by setting a smaller target bal-
loon size, and communicates that to the balloon driver. When received by the balloon
driver, it unpins the pinned pages so as the guest OS can utilize them.
Guest OS
Guest OS
Balloon
driver
Balloon
driver
Poll the hypervisor
to obtain the target
balloon size
Pinned
Pinned
Balloon has
inflated
Balloon inflating
Balloon
Balloon
Hypervisor
Hypervisor
(a)
(b)
FIGURE 16.20 The ballooning process in VMWare ESX. (a) Two inactive memory pages at
the guest OS which can be reclaimed by the hypervisor via inflating the balloon. (b) The guest
OS pins the inactive pages (for the hypervisor to reclaim) after recognizing a balloon inflation.
Search WWH ::




Custom Search