Cooperative memory management background

6.10 z/VM guest

Cooperative memory management (CMM, or "cmm1") dynamically adjusts the memory available to Linux®.

In a virtualized environment it is common practice to give the virtual machines more memory than is actually available to the hypervisor. Linux tends to use all of its available memory. As a result, the hypervisor (z/VM®) might start swapping.

To avoid excessive z/VM swapping, the memory available to Linux can be reduced. CMM allocates pages to page pools that make the pages unusable to Linux. There are two such page pools as shown in Figure 1.

Figure 1. Page pools
The Linux memory is shown within the z/VM memory. It includes a fixed size static page pool and a variable size and a timed page pool.
There are two page pools:
A static page pool
The page pool is controlled by a resource manager that changes the pool size at intervals according to guest activity as well as overall memory usage on z/VM (see Figure 2).
Figure 2. Static page pool. The size of the pool is static during an interval.
This chart shows a fixed amount of memory allocated to Linux. In successive time intervals different constant amounts are taken away by the page pool.
A timed page pool
Pages are released from this pool at a speed that is set in the release rate (see Figure 3). According to guest activity and overall memory usage on z/VM, a resource manager adds pages at intervals. If no pages are added and the release rate is not zero, the pool empties.
Figure 3. Timed page pool. Pages are freed at a set release rate.
This chart shows how the timed page pool takes memory away from the total memory that is allocated to Linux.

The external resource manager that controls the pools can be the z/VM resource monitor (VMRM) or a third-party systems management tool.

VMRM controls the pools over a message interface. Setting up the external resource manager is beyond the scope of this information. For more details, see the chapter about VMRM in z/VM: Performance, SC24-6301.

Third-party tools can provide a Linux deamon that receives commands for the memory allocation through TCP/IP. The deamon, in turn, uses the procfs-based interface. You can use the procfs interface to read the pool sizes. These values are useful diagnostic data.