Programming Interfaces Guide

Locality Group Characteristics

The following API retrieves information about the characteristics of a given lgroup.

Using lgrp_latency()

The lgrp_latency() function returns the latency between a CPU in one lgroup to the memory in another lgroup.

#include <sys/lgrp_user.h>
int lgrp_latency(lgrp_id_t from, lgrp_id_t to);

The lgrp_latency() function returns a value that represents the latency between a CPU in the lgroup given by the value of the from argument and the memory in the lgroup given by the value of the to argument. If both arguments point to the same lgroup, the lgrp_latency() function returns the latency value within that lgroup.


Note –

The latency value returned by the lgrp_latency() function is defined by the operating system and is platform-specific. This value does not necessarily represent the actual latency between hardware devices and may only be used for comparison within one domain.


The lgrp_latency() function returns EINVAL when the lgroup ID is not valid. When the lgrp_latency() function does not find the specified lgroup ID, the 'from' lgroup does not contain any CPUs, or the 'to' lgroup does not have any memory, the lgrp_latency() function returns ESRCH.