2 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH LGRP_INIT 3LGRP "Jan 26, 2005"
8 lgrp_init \- initialize lgroup interface
12 cc [ \fIflag\fR... ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary\fR... ]
13 #include <sys/lgrp_user.h>
15 \fBlgrp_cookie_t\fR \fBlgrp_init\fR(\fBlgrp_view_t\fR \fIview\fR);
21 The \fBlgrp_init()\fR function initializes the lgroup interface and takes a
22 snapshot of the lgroup hierarchy with the given \fIview\fR. If the given
23 \fIview\fR is \fBLGRP_VIEW_CALLER\fR, the snapshot contains only the resources
24 that are available to the caller (for example, with respect to processor sets).
25 When the \fIview\fR is \fBLGRP_VIEW_OS\fR, the snapshot contains what is
26 available to the operating system.
29 Given the \fIview\fR, \fBlgrp_init()\fR returns a cookie representing this
30 snapshot of the lgroup hierarchy. This cookie should be used with other
31 routines in the lgroup interface needing the lgroup hierarchy. The
32 \fBlgrp_fini\fR(3LGRP) function should be called with the cookie when it is no
36 The lgroup hiearchy represents the latency topology of the machine. The
37 hierarchy is simplified to be a tree and can be used to find the nearest
41 The lgroup hiearchy consists of a root lgroup, which is the maximum bounding
42 locality group of the system, contains all the CPU and memory resources of the
43 machine, and may contain other locality groups that contain CPUs and memory
44 within a smaller locality. The leaf lgroups contain resources within the
48 The resources of a given lgroup come directly from the lgroup itself or from
49 leaf lgroups contained within the lgroup. Leaf lgroups directly contain their
50 own resources and do not encapsulate any other lgroups.
53 The lgroup hierarchy can be used to find the nearest resources. From a given
54 lgroup, the closest resources can be found in the lgroup itself. After that,
55 the next nearest resources can be found in its parent lgroup, and so on until
56 the root lgroup is reached where all the resources of the machine are located.
60 Upon successful completion, \fBlgrp_init()\fR returns a cookie. Otherwise it
61 returns \fBLGRP_COOKIE_NONE\fR and sets \fBerrno\fR to indicate the error.
65 The \fBlgrp_init()\fR function will fail if:
72 The view is not valid.
81 There was not enough memory to allocate the snapshot of the lgroup hierarchy.
87 See \fBattributes\fR(5) for descriptions of the following attributes:
95 ATTRIBUTE TYPE ATTRIBUTE VALUE
97 Interface Stability Evolving
105 \fBlgrp_children\fR(3LGRP), \fBlgrp_cookie_stale\fR(3LGRP),
106 \fBlgrp_cpus\fR(3LGRP), \fBlgrp_fini\fR(3LGRP), \fBlgrp_mem_size\fR(3LGRP),
107 \fBlgrp_nlgrps\fR(3LGRP), \fBlgrp_parents\fR(3LGRP),
108 \fBlgrp_resources\fR(3LGRP), \fBlgrp_root\fR(3LGRP), \fBlgrp_view\fR(3LGRP),
109 \fBliblgrp\fR(3LIB), \fBattributes\fR(5)