JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Programming Interfaces Guide     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Memory and CPU Management

2.  Session Description Protocol API

3.  Process Scheduler

4.  Locality Group APIs

Locality Groups Overview

Verifying the Interface Version

Initializing the Locality Group Interface

Using lgrp_init()

Using lgrp_fini()

Locality Group Hierarchy

Using lgrp_cookie_stale()

Using lgrp_view()

Using lgrp_nlgrps()

Using lgrp_root()

Using lgrp_parents()

Using lgrp_children()

Locality Group Contents

Using lgrp_resources()

Using lgrp_cpus()

Using lgrp_mem_size()

Locality Group Characteristics

Using lgrp_latency_cookie()

Locality Groups and Thread and Memory Placement

Using lgrp_home()

Using madvise()

Using madv.so.1

madv.so.1 Usage Examples

Using meminfo()

Locality Group Affinity

Using lgrp_affinity_get()

Using lgrp_affinity_set()

Examples of API Usage

5.  Input/Output Interfaces

6.  Interprocess Communication

7.  Socket Interfaces

8.  Programming With XTI and TLI

9.  Packet Filtering Hooks

10.  Transport Selection and Name-to-Address Mapping

11.  Real-time Programming and Administration

12.  The Oracle Solaris ABI and ABI Tools

A.  UNIX Domain Sockets

Index

Locality Group Characteristics

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

Using lgrp_latency_cookie()

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

#include <sys/lgrp_user.h>
int lgrp_latency_cookie(lgrp_cookie_t cookie, lgrp_id_t from, lgrp_id_t to.
                        lat_between_t between);

The lgrp_latency_cookie() function takes a cookie that represents a snapshot of the lgroup hierarchy. The lgrp_init() function creates this cookie. The lgrp_latency_cookie() function returns a value that represents the latency between a hardware resource in the lgroup given by the value of the from argument and a hardware resource in the lgroup given by the value of the to argument. If both arguments point to the same lgroup, the lgrp_latency_cookie() function returns the latency value within that lgroup.


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


When the value of the between argument is LGRP_LAT_CPU_TO_MEM, the lgrp_latency_cookie() function measures the latency from a CPU resource to a memory resource.

The lgrp_latency_cookie() function returns EINVAL when the lgroup ID is not valid. When the lgrp_latency_cookie() 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_cookie() function returns ESRCH.