1 TB Segment Aliasing

1 TB segment aliasing improves performance by using 1 TB segment translations on Shared Memory Regions with 256 MB segment size. This support is provided on all 64 bit applications that use Shared Memory Regions. Both directed and undirected shared memory attachments are eligible for 1 TB segment aliasing.

If an application qualifies to have its Shared Memory Regions to use 1 TB aliases, the AIX operating system uses 1 TB segments translations without changing the application. This requires using the shm_1tb_shared VMO tunable, shm_1tb_unshared VMO tunable, and esid_allocator VMO tunable.

The shm_1tb_shared VMO tunable can be set on a per-process basis using the"SHM_1TB_SHARED=" VMM_CNTRL environment variable. The default value is set dynamically at boot time base on the capabilities of the processor. If a single Shared Memory Region has the required number of ESIDs, it is automatically changed to a shared alias. The acceptable values are in the range of 0 to 4 KB (approximately require 256 MB ESIDs in a 1 TB range).

The shm_1tb_unshared VMO tunable can be set on a per-process basis using the"SHM_1TB_UNSHARED=" VMM_CNTRL environment variable. The default value is set to 256. The acceptable values are in a rage of 0 to 4 KB. The default value is set cautiously (requiring the population of up to 64 GB address space) before moving to an unshared 1 TB alias. The threshold number is set to 256 MB segments at which a shared memory region is promoted to use a 1 TB alias. Lower values must cautiously use the shared memory regions to use a 1 TB alias. This can lower the segment look-aside buffer (SLB) misses but can also increase the page table entry (PTE) misses, if many shared memory regions that are not used across processes are aliased.

The esid_allocator VMO tunable can be set on a per-process basis using the "ESID_ALLOCATOR=" VMM_CNTRL environment variable. The default value is set to 0 for AIX Version 6.1 and 1 for AIX Version 7.0. Values can be either 0 or 1. When set to 0, the old allocator for undirected attachments is enabled. Otherwise, a new address space allocation policy is used for undirected attachments. This new address space allocator attaches any undirected allocation (such as SHM, and MMAP) to a new address range of 0x0A00000000000000 - 0x0AFFFFFFFFFFFFFF in the address space of the application. The allocator optimizes the allocations in order to provide the best possible chances of 1 TB alias promotion. Such optimization can result in address space "holes", which are considered normal when using undirected attachments. Directed attachments is done for 0x0700000000000000 - 0x07FFFFFFFFFFFFFF range, thus preserving compatibility with earlier version. In certain cases where this new allocation policy creates a binary compatibility issue, the legacy allocator behavior can be restored by setting the tunable to 0.

Shared memory regions that were not qualified for shared alias promotion are grouped into 1 TB regions. In a group of shared memory regions in a 1 TB region of the application's address space, if the application exceeds the threshold value of 256 MB segments, they are promoted to use an unshared 1 TB alias. In applications where the shared memory is frequently attached and detached, lower values of the unshared alias threshold result in performance degradation.

To avoid polluting the environments name space, all environment tunables are used under the master tunable VMM_CNTRL. The master tunable is specified with the@ symbol separating the commands. An example for using VMM_CNTRL is:
VMM_CNTRL=SHM_1TB_UNSHARED=32@SHM_1TB_SHARED=5

All environment variable settings are inherited by the child on a fork(), and initialized to the system default values at exec(). All 32-bit applications are not affected by either VMO or environment variable tunable changes.

All VMO tunables and environment variables have analogous vm_pattr commands. The exception is esid_allocator tunable. This tunable is not present in the vm_pattr options to avoid situations where portions of the shared memory address space are allocated before running the command.