Locality Groups and Thread and Memory Placement
This section discusses the APIs used to discover and affect thread and memory placement with respect to lgroups.
-
The
lgrp_home() function is used to discover thread placement. For more information, see thelgrp_home(3LGRP) man page. -
The
meminfo() system call is used to discover memory placement. For more information, see thememinfo(2) man page. -
The
MADV_ACCESSflags to themadvise() function are used to affect memory allocation among lgroups. For more information, see themadvise(3C) man page. -
The
lgrp_affinity_set() function can affect thread and memory placement by setting a thread's affinity for a given lgroup. For more information, see thelgrp_affinity_set(3LGRP) man page. -
The affinities of an lgroup may specify an order of preference for lgroups from which to allocate resources.
-
The kernel needs information about the likely pattern of an application's memory use in order to allocate memory resources efficiently.
-
The
madvise() function and its shared object analoguemadv.so.1provides this information to the kernel. -
A running process can gather memory usage information about itself by using the
meminfo() system call.