Shared memory distribution

The hypervisor uses the memory weight of each logical partition that uses shared memory (hereafter referred to as shared memory partitions) to help determine which logical partitions receive more physical memory from the shared memory pool. To help optimize performance and memory use, the operating systems that run in shared memory partitions provide the hypervisor with information about how the operating system uses its memory to help the hypervisor determine which pages to store in the shared memory pool and which pages to store in the paging space devices.

In a shared memory configuration that is physically overcommitted (where the sum of the logical memory that is currently used by of all shared memory partitions is greater than the amount of memory in the shared memory pool), the hypervisor stores a portion of the logical memory in the shared memory pool and stores the remainder of the logical memory in the paging space devices. The hypervisor determines the amount of physical memory to allocate from the shared memory pool to each shared memory partition and the amount of logical memory to store in the paging space devices. The hypervisor also determines which pieces, or pages, of memory to store in each location.

The smallest amount of physical memory that the hypervisor can allocate from the shared memory pool to a shared memory partition at any given time is the amount of physical memory that the shared memory partition requires for its I/O devices. The hypervisor guarantees to each shared memory partition that the shared memory partition can use a portion of the shared memory pool for its I/O devices, up to the I/O entitled memory that is assigned to the shared memory partition. The largest amount of physical memory that the hypervisor can allocate from the shared memory pool to a shared memory partition at any given time is the amount of logical memory assigned to the shared memory partition.

The amount of physical memory from the shared memory pool that the hypervisor allocates to the shared memory partitions is determined by the workloads that are running in the shared memory partitions and the amount of logical memory that is assigned to each shared memory partition. You can influence how much physical memory the hypervisor allocates from the shared memory pool to each shared memory partition by specifying a memory weight for each shared memory partition. Memory weight is a relative value that is one of the factors that the hypervisor uses to allocate physical memory from the shared memory pool to the shared memory partitions. A higher memory weight relative to the memory weights of other shared memory partitions increases the probability that the hypervisor allocates more physical memory to a shared memory partition.

To help maintain the best possible performance, the operating system that runs in a shared memory partition continually attempts to operate within the amount of physical memory allocated to it from the shared memory pool by moving its overcommitted logical memory to a paging space. In general, the operating system moves its memory to a paging space more often when it runs in a shared memory partition than when it runs in a dedicated memory partition. Therefore, the paging space that the operating system uses to manage its memory needs to be larger when the logical partition uses shared memory than when the logical partition uses dedicated memory.

The operating systems that run in shared memory partitions provide information to the hypervisor about how the operating system uses its pages. When the hypervisor manages the overcommitted logical memory, it uses this information to determine which pages to store in the paging space device and which pages to store in the shared memory pool. When the hypervisor needs to deallocate physical memory from the shared memory partition and move it to the paging space device, the hypervisor requests the operating system to release pages. The operating system might mark the pages that it will not use, and the hypervisor moves the marked pages first. This enables the hypervisor to select the most optimal pages to move out of the shared memory pool, which improves memory use and performance. For example, the operating system uses one page for kernel data and another page for cache and the hypervisor needs to move one page to the paging space device. The hypervisor moves the cache page to the paging space device to optimize performance.