man pages section 3: Extended Library Functions, Volume 2

Exit Print View

Updated: July 2014
 
 

lgrp_device_lgrps(3LGRP)

Name

lgrp_device_lgrps - get IDs of lgroups closest to the specified I/O device

Synopsis

cc [ flag … ] file–llgrp [ library … ] 
#include <sys/lgrp_user.h>

int lgrp_device_lgrps(char *device_path, lgrp_id_t * lgrpids,
     uint_t count);

Description

The lgrp_device_lgrps() returns the number of lgroups closest to the specified I/O device. If both lgrpids[] is non-null and count is not 0, lgrpids[] is also filled up to the specified count of lgroup IDs closest to the device.

Each I/O device on the system can be connected to one or more NUMA nodes. In order to optimize I/O performance for a given device through locality, an application needs to know which lgroups are closest to the I/O device and place its threads and/or memory needed for performing I/O near the device. It is therefore important for applications to know the NUMA I/O topology of the system.

The device_path parameter is the path to an I/O device specified by the caller.

Return Values

Upon successful completion, lgrp_device_lgrps() returns the number of lgroups closest to the specified I/O device. Otherwise, it returns -1 and errno is set to indicate the error.

Errors

The lgrp_device_lgrps() function will fail if:

EACCES

Operation permission is denied to the calling process (see Intro(2).

EFAULT

The lgrpids parameter points to an invalid memory address.

EINVAL

An invalid device path is specified.

ENOENT

The specified lgroup path does not name an existing device node.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
MT-Safe

See also

Intro(2), lgrp_affinity_get(3LGRP), lgrp_cpus(3LGRP), lgrp_nlgrps(3LGRP), lgrp_resources(3LGRP), liblgrp(3LIB), attributes(5)