diff options
Diffstat (limited to 'usr/src/man/man3lgrp')
| -rw-r--r-- | usr/src/man/man3lgrp/Makefile | 47 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_affinity_get.3lgrp | 175 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_children.3lgrp | 82 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_cookie_stale.3lgrp | 79 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_cpus.3lgrp | 101 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_fini.3lgrp | 69 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_home.3lgrp | 102 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_init.3lgrp | 114 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_latency.3lgrp | 114 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_mem_size.3lgrp | 113 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_nlgrps.3lgrp | 68 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_parents.3lgrp | 84 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_resources.3lgrp | 99 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_root.3lgrp | 65 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_version.3lgrp | 81 | ||||
| -rw-r--r-- | usr/src/man/man3lgrp/lgrp_view.3lgrp | 74 |
16 files changed, 1467 insertions, 0 deletions
diff --git a/usr/src/man/man3lgrp/Makefile b/usr/src/man/man3lgrp/Makefile new file mode 100644 index 0000000000..a92e9f0417 --- /dev/null +++ b/usr/src/man/man3lgrp/Makefile @@ -0,0 +1,47 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet +# at http://www.illumos.org/license/CDDL. +# + +# Copyright 2011, Richard Lowe + +include ../../Makefile.master + +MANSECT = 3lgrp + +MANFILES = lgrp_affinity_get.3lgrp \ + lgrp_children.3lgrp \ + lgrp_cookie_stale.3lgrp \ + lgrp_cpus.3lgrp \ + lgrp_fini.3lgrp \ + lgrp_home.3lgrp \ + lgrp_init.3lgrp \ + lgrp_latency.3lgrp \ + lgrp_mem_size.3lgrp \ + lgrp_nlgrps.3lgrp \ + lgrp_parents.3lgrp \ + lgrp_resources.3lgrp \ + lgrp_root.3lgrp \ + lgrp_version.3lgrp \ + lgrp_view.3lgrp + +MANSOFILES = lgrp_affinity_set.3lgrp \ + lgrp_latency_cookie.3lgrp + +MANFILES += $(MANSOFILES) + +lgrp_affinity_set.3lgrp := SOSRC = man3lgrp/lgrp_affinity_get.3lgrp + +lgrp_latency_cookie.3lgrp := SOSRC = man3lgrp/lgrp_latency.3lgrp + +.KEEP_STATE: + +include ../Makefile.man + +install: $(ROOTMANFILES) diff --git a/usr/src/man/man3lgrp/lgrp_affinity_get.3lgrp b/usr/src/man/man3lgrp/lgrp_affinity_get.3lgrp new file mode 100644 index 0000000000..d87e56f512 --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_affinity_get.3lgrp @@ -0,0 +1,175 @@ +'\" te +.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_affinity_get 3LGRP "16 Apr 2003" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_affinity_get, lgrp_affinity_set \- get of set lgroup affinity +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary \&.\|.\|.\fR ] +#include <sys/lgrp_user.h> + +\fBlgrp_affinity_t\fR \fBlgrp_affinity_get\fR(\fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR, + \fBlgrp_id_t\fR \fIlgrp\fR); +.fi + +.LP +.nf +\fBint\fR \fBlgrp_affinity_set\fR(\fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR, \fBlgrp_id_t\fR \fIlgrp\fR, + \fBlgrp_affinity_t\fR \fIaffinity\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_affinity_get()\fR function returns the affinity that the LWP or set +of LWPs specified by the \fIidtype\fR and \fIid\fR arguments have for the given +lgroup. +.sp +.LP +The \fBlgrp_affinity_set()\fR function sets the affinity that the LWP or set of +LWPs specified by \fIidtype\fR and \fIid\fR have for the given lgroup. The +lgroup affinity can be set to \fBLGRP_AFF_STRONG\fR, \fBLGRP_AFF_WEAK\fR, or +\fBLGRP_AFF_NONE\fR. +.sp +.LP +If the \fIidtype\fR is \fBP_PID\fR, the affinity is retrieved for one of the +LWPs in the process or set for all the LWPs of the process with process ID +(PID) \fIid\fR. The affinity is retrieved or set for the LWP of the current +process with LWP ID \fIid\fR if \fIidtype\fR is \fBP_LWPID\fR. If \fIid\fR is +\fBP_MYID\fR, then the current LWP or process is specified. +.sp +.LP +The operating system uses the lgroup affinities as advice on where to run a +thread and allocate its memory and factors this advice in with other +constraints. Processor binding and processor sets can restrict which lgroups a +thread can run on, but do not change the lgroup affinities. +.sp +.LP +Each thread can have an affinity for an lgroup in the system such that the +thread will tend to be scheduled to run on that lgroup and allocate memory from +there whenever possible. If the thread has affinity for more than one lgroup, +the operating system will try to run the thread and allocate its memory on the +lgroup for which it has the strongest affinity, then the next strongest, and so +on up through some small, system-dependent number of these lgroup affinities. +When multiple lgroups have the same affinity, the order of preference among +them is unspecified and up to the operating system to choose. The lgroup with +the strongest affinity that the thread can run on is known as its "home lgroup" +(see \fBlgrp_home\fR(3LGRP)) and is usually the operating system's first choice +of where to run the thread and allocate its memory. +.sp +.LP + There are different levels of affinity that can be specified by a thread for a +particuliar lgroup. The levels of affinity are the following from strongest to +weakest: +.sp +.in +2 +.nf +LGRP_AFF_STRONG /* strong affinity */ +LGRP_AFF_WEAK /* weak affinity */ +LGRP_AFF_NONE /* no affinity */ +.fi +.in -2 + +.sp +.LP +The \fBLGRP_AFF_STRONG\fR affinity serves as a hint to the operating system +that the calling thread has a strong affinity for the given lgroup. If this is +the thread's home lgroup, the operating system will avoid rehoming it to +another lgroup if possible. However, dynamic reconfiguration, processor +offlining, processor binding, and processor set binding and manipulation are +examples of events that can cause the operating system to change the thread's +home lgroup for which it has a strong affinity. +.sp +.LP +The \fBLGRP_AFF_WEAK\fR affinity is a hint to the operating system that the +calling thread has a weak affinity for the given lgroup. If a thread has a +weak affinity for its home lgroup, the operating system interpets this to mean +that thread does not mind whether it is rehomed, unlike \fBLGRP_AFF_STRONG\fR. +Load balancing, dynamic reconfiguration, processor binding, or processor set +binding and manipulation are examples of events that can cause the operating +system to change a thread's home lgroup for which it has a weak affinity. +.sp +.LP +The \fBLGRP_AFF_NONE\fR affinity signifies no affinity and can be used to +remove a thread's affinity for a particuliar lgroup. Initially, each thread +has no affinity to any lgroup. If a thread has no lgroup affinities set, the +operating system chooses a home lgroup for the thread with no affinity set. +.SH RETURN VALUES +.sp +.LP +Upon successful completion, \fBlgrp_affinity_get()\fR returns the affinity for +the given lgroup. +.sp +.LP +Upon successful completion, \fBlgrp_affinity_set()\fR return 0. +.sp +.LP +Otherwise, both functions return \(mi1 and set \fBerrno\fR to indicate the +error. +.SH ERRORS +.sp +.LP +The \fBlgrp_affinity_get()\fR and \fBlgrp_affinity_set()\fR functions will fail +if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The specified lgroup, affinity, or ID type is not valid. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBEPERM\fR\fR +.ad +.RS 10n +.rt +The effective user of the calling process does not have appropriate privileges, +and its real or effective user ID does not match the real or effective user ID +of one of the LWPs. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBESRCH\fR\fR +.ad +.RS 10n +.rt +The specified lgroup or LWP(s) was not found. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_home\fR(3LGRP), \fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_children.3lgrp b/usr/src/man/man3lgrp/lgrp_children.3lgrp new file mode 100644 index 0000000000..3d1e70721b --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_children.3lgrp @@ -0,0 +1,82 @@ +'\" te +.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_children 3LGRP "16 Apr 2003" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_children \- get children of given lgroup +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary \&.\|.\|.\fR ] +#include <sys/lgrp_user.h> + +\fBint\fR \fBlgrp_children\fR(\fBlgrp_cookie_t\fR \fIcookie\fR, \fBlgrp_id_t\fR \fIparent\fR, + \fBlgrp_id_t *\fR\fIlgrp_array\fR, \fBuint_t\fR \fIlgrp_array_size\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_children()\fR function takes a \fIcookie\fR representing a snapshot +of the lgroup hierarchy retrieved from \fBlgrp_init\fR(3LGRP) and returns the +number of lgroups that are children of the specified lgroup. If the +\fIlgrp_array\fR and \fIlgrp_array_size\fR arguments are non-null, the array is +filled with as many of the children lgroup IDs as will fit, given the size of +the array. +.SH RETURN VALUES +.sp +.LP +\(mi returns the number of child lgroup IDs. Otherwise, it returns \(mi1 and +sets \fBerrno\fR to indicate the error. +.SH ERRORS +.sp +.LP +The \fBlgrp_children()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The specified lgroup ID is not valid or the cookie is invalid. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBESRCH\fR\fR +.ad +.RS 10n +.rt +The specified lgroup ID was not found. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_init\fR(3LGRP), \fBlgrp_nlgrps\fR(3LGRP), \fBlgrp_parents\fR(3LGRP), +\fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_cookie_stale.3lgrp b/usr/src/man/man3lgrp/lgrp_cookie_stale.3lgrp new file mode 100644 index 0000000000..a3261b6fe1 --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_cookie_stale.3lgrp @@ -0,0 +1,79 @@ +'\" te +.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_cookie_stale 3LGRP "16 Apr 2003" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_cookie_stale \- determine whether snapshot of lgroup hierarchy is stale +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary \&.\|.\|.\fR ] +#include <sys/lgrp_user.h> + +\fBint\fR \fBlgrp_cookie_stale\fR(\fBlgrp_cookie_t\fR \fIcookie\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_cookie_stale()\fR function takes a \fIcookie\fR representing the +snapshot of the lgroup hierarchy obtained from \fBlgrp_init\fR(3LGRP) and +returns whether it is stale. The snapshot can become out-of-date for a number +of reasons depending on its view. If the snapshot was taken with +\fBLGRP_VIEW_OS\fR, changes in the lgroup hierarchy from dynamic +reconfiguration, CPU on/offline, or other conditions can cause the snapshot to +become out-of-date. A snapshot taken with \fBLGRP_VIEW_CALLER\fR can be +affected by the caller's processor set binding and changes in its processor set +itself, as well as changes in the lgroup hierarchy. +.sp +.LP +If the snapshot needs to be updated, \fBlgrp_fini\fR(3LGRP) should be called +with the old cookie and \fBlgrp_init()\fR should be called to obtain a new +snapshot. +.SH RETURN VALUES +.sp +.LP +Upon successful completion, \fBlgrp_cookie_stale()\fR returns whether the +cookie is stale. Otherwise, it returns \(mi1 and sets \fBerrno\fR to indicate +the error. +.SH ERRORS +.sp +.LP +The \fBlgrp_cookie_stale()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The cookie is not valid. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_init\fR(3LGRP), \fBlgrp_fini\fR(3LGRP), \fBlgrp_view\fR(3LGRP), +\fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_cpus.3lgrp b/usr/src/man/man3lgrp/lgrp_cpus.3lgrp new file mode 100644 index 0000000000..a6e44bd6e5 --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_cpus.3lgrp @@ -0,0 +1,101 @@ +'\" te +.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_cpus 3LGRP "26 Jan 2005" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_cpus \- get CPU IDs contained in specified lgroup +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary\fR\&.\|.\|. ] +#include <sys/lgrp_user.h> + +\fBint\fR \fBlgrp_cpus\fR(\fBlgrp_cookie_t\fR \fIcookie\fR, \fBlgrp_id_t\fR \fIlgrp\fR, + \fBprocessorid_t *\fR\fIcpuids\fR, \fBuint_t\fR \fIcount\fR, \fBint\fR \fIcontent\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_cpus()\fR function takes a \fIcookie\fR representing a snapshot of +the lgroup hierarchy obtained from \fBlgrp_init\fR(3LGRP) and returns the +number of CPUs in the lgroup specified by \fIlgrp\fR. If both the +\fIcpuids\fR[] argument is non-null and the count is non-zero, +\fBlgrp_cpus()\fR stores up to the specified count of CPU IDs into the +\fIcpuids\fR[] array. +.sp +.LP +The \fIcontent\fR argument should be set to one of the following values to +specify whether the direct contents or everything in this lgroup should be +returned: +.sp +.in +2 +.nf +LGRP_CONTENT_ALL /* everything in this lgroup */ +LGRP_CONTENT_DIRECT /* directly contained in lgroup */ +LGRP_CONTENT_HIERARCHY /* everything within this hierarchy (for + compatibility only, use LGRP_CONTENT_ALL) */ +.fi +.in -2 + +.sp +.LP +The \fBLGRP_CONTENT_HIERARCHY\fR value can still be used, but is being replaced +by \fBLGRP_CONTENT_ALL\fR. +.SH RETURN VALUES +.sp +.LP +Upon successful completion, the number of CPUs in the given lgroup is returned. +Otherwise, \(mi1 is returned and \fBerrno\fR is set to indicate the error. +.SH ERRORS +.sp +.LP +The \fBlgrp_cpus()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The specified cookie, lgroup ID, or one of the flags is not valid. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBESRCH\fR\fR +.ad +.RS 10n +.rt +The specified lgroup ID was not found. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_init\fR(3LGRP), \fBlgrp_mem_size\fR(3LGRP), +\fBlgrp_resources\fR(3LGRP), \fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_fini.3lgrp b/usr/src/man/man3lgrp/lgrp_fini.3lgrp new file mode 100644 index 0000000000..a9c7cc8305 --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_fini.3lgrp @@ -0,0 +1,69 @@ +'\" te +.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_fini 3LGRP "16 Apr 2003" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_fini \- finished using lgroup interface +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary\fR\&.\|.\|. ] +#include <sys/lgrp_user.h> + +\fBint\fR \fBlgrp_fini\fR(\fBlgrp_cookie_t\fR \fIcookie\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_fini()\fR function takes a \fIcookie\fR, frees the snapshot of the +lgroup hierarchy created by \fBlgrp_init\fR(3LGRP), and cleans up anything else +set up by \fBlgrp_init()\fR. After this function is called, any memory +allocated and returned by the lgroup interface might no longer be valid and +should not be used. +.SH RETURN VALUES +.sp +.LP +Upon successful completion, 0 is returned. Otherwise, \(mi1 is returned and +\fBerrno\fR is set to indicate the error. +.SH ERRORS +.sp +.LP +The \fBlgrp_fini()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The \fIcookie\fR is not valid. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_init\fR(3LGRP), \fBlgrp_cookie_stale\fR(3LGRP), \fBliblgrp\fR(3LIB), +\fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_home.3lgrp b/usr/src/man/man3lgrp/lgrp_home.3lgrp new file mode 100644 index 0000000000..5b15db569c --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_home.3lgrp @@ -0,0 +1,102 @@ +'\" te +.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_home 3LGRP "1 Jun 2003" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_home \- get home lgroup +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary\fR\&.\|.\|. ] +#include <sys/lgrp_user.h> + +\fBlgrp_id_t\fR \fBlgrp_home\fR(\fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_home()\fR function returns the ID of the home lgroup for the given +process or thread. A thread can have an affinity for an lgroup in the system +such that the thread will tend to be scheduled to run on that lgroup and +allocate memory from there whenever possible. The lgroup with the strongest +affinity that the thread can run on is known as the "home lgroup" of the +thread. If the thread has no affinity for any lgroup that it can run on, the +operating system will choose a home for it. +.sp +.LP +The \fIidtype\fR argument should be \fBP_PID\fR to specify a process and the +\fIid\fR argument should be its process ID. Otherwise, the \fIidtype\fR +argument should be \fBP_LWPID\fR to specify a thread and the \fIid\fR argument +should be its LWP ID. The value \fBP_MYID\fR can be used for the \fIid\fR +argument to specify the current process or thread. +.SH RETURN VALUES +.sp +.LP +Upon successful completion, \fBlgrp_home()\fR returns the ID of the home lgroup +of the specified process or thread. Otherwise, \(mi1 is returned and +\fBerrno\fR is set to indicate the error. +.SH ERRORS +.sp +.LP +The \fBlgrp_home()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The ID type is not valid. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBEPERM\fR\fR +.ad +.RS 10n +.rt +The effective user of the calling process does not have appropriate privileges, +and its real or effective user ID does not match the real or effective user ID +of one of the threads. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBESRCH\fR\fR +.ad +.RS 10n +.rt +The specified process or thread was not found. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_affinity_get\fR(3LGRP), \fBlgrp_init\fR(3LGRP), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_init.3lgrp b/usr/src/man/man3lgrp/lgrp_init.3lgrp new file mode 100644 index 0000000000..dbb23b539d --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_init.3lgrp @@ -0,0 +1,114 @@ +'\" te +.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_init 3LGRP "26 Jan 2005" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_init \- initialize lgroup interface +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag\fR... ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary\fR... ] +#include <sys/lgrp_user.h> + +\fBlgrp_cookie_t\fR \fBlgrp_init\fR(\fBlgrp_view_t\fR \fIview\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_init()\fR function initializes the lgroup interface and takes a +snapshot of the lgroup hierarchy with the given \fIview\fR. If the given +\fIview\fR is \fBLGRP_VIEW_CALLER\fR, the snapshot contains only the resources +that are available to the caller (for example, with respect to processor sets). +When the \fIview\fR is \fBLGRP_VIEW_OS\fR, the snapshot contains what is +available to the operating system. +.sp +.LP +Given the \fIview\fR, \fBlgrp_init()\fR returns a cookie representing this +snapshot of the lgroup hierarchy. This cookie should be used with other +routines in the lgroup interface needing the lgroup hierarchy. The +\fBlgrp_fini\fR(3LGRP) function should be called with the cookie when it is no +longer needed. +.sp +.LP +The lgroup hiearchy represents the latency topology of the machine. The +hierarchy is simplified to be a tree and can be used to find the nearest +resources. +.sp +.LP +The lgroup hiearchy consists of a root lgroup, which is the maximum bounding +locality group of the system, contains all the CPU and memory resources of the +machine, and may contain other locality groups that contain CPUs and memory +within a smaller locality. The leaf lgroups contain resources within the +smallest latency. +.sp +.LP +The resources of a given lgroup come directly from the lgroup itself or from +leaf lgroups contained within the lgroup. Leaf lgroups directly contain their +own resources and do not encapsulate any other lgroups. +.sp +.LP +The lgroup hierarchy can be used to find the nearest resources. From a given +lgroup, the closest resources can be found in the lgroup itself. After that, +the next nearest resources can be found in its parent lgroup, and so on until +the root lgroup is reached where all the resources of the machine are located. +.SH RETURN VALUES +.sp +.LP +Upon successful completion, \fBlgrp_init()\fR returns a cookie. Otherwise it +returns \fBLGRP_COOKIE_NONE\fR and sets \fBerrno\fR to indicate the error. +.SH ERRORS +.sp +.LP +The \fBlgrp_init()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The view is not valid. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBENOMEM\fR\fR +.ad +.RS 10n +.rt +There was not enough memory to allocate the snapshot of the lgroup hierarchy. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_children\fR(3LGRP), \fBlgrp_cookie_stale\fR(3LGRP), +\fBlgrp_cpus\fR(3LGRP), \fBlgrp_fini\fR(3LGRP), \fBlgrp_mem_size\fR(3LGRP), +\fBlgrp_nlgrps\fR(3LGRP), \fBlgrp_parents\fR(3LGRP), +\fBlgrp_resources\fR(3LGRP), \fBlgrp_root\fR(3LGRP), \fBlgrp_view\fR(3LGRP), +\fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_latency.3lgrp b/usr/src/man/man3lgrp/lgrp_latency.3lgrp new file mode 100644 index 0000000000..d340fd297e --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_latency.3lgrp @@ -0,0 +1,114 @@ +'\" te +.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_latency 3LGRP "26 Jan 2005" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_latency, lgrp_latency_cookie \- get latency between two lgroups +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag\fR... ] \fIfile\fR... \fB-llgrp\fR [ \fIlibrary\fR... ] +#include <sys/lgrp_user.h> + +\fBint\fR \fBlgrp_latency_cookie\fR(\fBlgrp_cookie_t\fR \fIcookie\fR, \fBlgrp_id_t\fR \fIfrom\fR, + \fBlgrp_id_t\fR \fIto\fR, \fBlgrp_lat_between_t\fR \fIbetween\fR); +.fi + +.LP +.nf +\fBint\fR \fBlgrp_latency\fR(\fBlgrp_id_t\fR \fIfrom\fR, \fBlgrp_id_t\fR \fIto\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_latency_cookie()\fR function takes a cookie representing a snapshot +of the lgroup hierarchy obtained from \fBlgrp_init\fR(3LGRP) and returns the +latency value between a hardware resource in the \fIfrom\fR lgroup to a +hardware resource in the \fIto\fR lgroup. If \fIfrom\fR is the same lgroup as +\fIto\fR, the latency value within that lgroup is returned. +.sp +.LP +The \fIbetween\fR argument should be set to the following value to specify +between which hardware resources the latency should be measured: +.sp +.in +2 +.nf +LGRP_LAT_CPU_TO_MEM /* latency from CPU to memory */ +.fi +.in -2 + +.sp +.LP +The latency value is defined by the operating system and is platform-specific. +It can be used only for relative comparison of lgroups on the running system. +It does not necessarily represent the actual latency between hardware devices, +and it might not be applicable across platforms. +.sp +.LP +The \fBlgrp_latency()\fR function is similiar to the +\fBlgrp_latency_cookie()\fR function, but returns the latency between the given +lgroups at the given instant in time. Since lgroups can be freed and +reallocated, this function might not be able to provide a consistent answer +across calls. For that reason, the \fBlgrp_latency_cookie()\fR function should +be used in its place. +.SH RETURN VALUES +.sp +.LP +Upon successful completion, the latency value is returned. Otherwise \(mi1 is +returned and \fBerrno\fR is set to indicate the error. +.SH ERRORS +.sp +.LP +The \fBlgrp_latency_cookie()\fR and \fBlgrp_latency()\fR functions will fail +if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The specified cookie, lgroup ID, or value given for the \fIbetween\fR argument +is not valid. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBESRCH\fR\fR +.ad +.RS 10n +.rt +The specified lgroup ID was not found, the \fIfrom\fR lgroup does not contain +any CPUs, or the \fIto\fR lgroup does not have any memory. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_init\fR(3LGRP), \fBlgrp_parents\fR(3LGRP), \fBlgrp_children\fR(3LGRP), +\fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_mem_size.3lgrp b/usr/src/man/man3lgrp/lgrp_mem_size.3lgrp new file mode 100644 index 0000000000..fa31258a97 --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_mem_size.3lgrp @@ -0,0 +1,113 @@ +'\" te +.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_mem_size 3LGRP "26 Jan 2005" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_mem_size \- return the memory size of the given lgroup +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary\fR\&.\|.\|. ] +#include <sys/lgrp_user.h> + +\fBlgrp_mem_size_t\fR \fBlgrp_mem_size\fR(\fBlgrp_cookie_t\fR \fIcookie\fR, \fBlgrp_id_t\fR \fIlgrp\fR, + \fBint\fR \fItype\fR, \fBint\fR \fIcontent\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_mem_size()\fR function takes a \fIcookie\fR representing a snapshot +of the lgroup hierarchy. The \fIcookie\fR was obtained by calling +\fBlgrp_init\fR(3LGRP). The \fBlgrp_mem_size()\fR function returns the memory +size of the given lgroup in bytes. The \fItype\fR argument should be set to one +of the following values: +.sp +.in +2 +.nf +LGRP_MEM_SZ_FREE /* free memory */ +LGRP_MEM_SZ_INSTALLED /* installed memory */ +.fi +.in -2 + +.sp +.LP +The \fIcontent\fR argument should be set to one of the following values to +specify whether the direct contents or everything in this lgroup should be +returned: +.sp +.in +2 +.nf +LGRP_CONTENT_ALL /* everything in this lgroup */ +LGRP_CONTENT_DIRECT /* directly contained in lgroup */ +LGRP_CONTENT_HIERARCHY /* everything within this hierarchy (for */ + compatibility only, use LGRP_CONTENT_ALL) */ +.fi +.in -2 + +.sp +.LP +The \fBLGRP_CONTENT_HIERARCHY\fR value can still be used, but is being replaced +by \fBLGRP_CONTENT_ALL\fR. +.sp +.LP +The total sizes include all the memory in the lgroup including its children, +while the others reflect only the memory contained directly in the given +lgroup. +.SH RETURN VALUES +.sp +.LP +Upon successful completion, the size in bytes is returned. Otherwise, \(mi1 is +returned and \fBerrno\fR is set to indicate the error. +.SH ERRORS +.sp +.LP +The \fBlgrp_mem_size()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The specified cookie, lgroup ID, or one of the flags is not valid. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBESRCH\fR\fR +.ad +.RS 10n +.rt +The specified lgroup ID was not found. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_init\fR(3LGRP), \fBlgrp_cpus\fR(3LGRP), \fBlgrp_resources\fR(3LGRP), +\fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_nlgrps.3lgrp b/usr/src/man/man3lgrp/lgrp_nlgrps.3lgrp new file mode 100644 index 0000000000..bf21541c17 --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_nlgrps.3lgrp @@ -0,0 +1,68 @@ +'\" te +.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_nlgrps 3LGRP "16 Apr 2003" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_nlgrps \- get number of lgroups +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary \&.\|.\|.\fR ] +#include <sys/lgrp_user.h> + +\fBint\fR \fBlgrp_nlgrps\fR(\fBlgrp_cookie_t\fR \fIcookie\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_nlgrps()\fR function takes a \fIcookie\fR representing a snapshot +of the lgroup hierarchy obtained from \fBlgrp_init\fR(3LGRP). It returns the +number of lgroups in the hierarchy where the number is always at least one. +.SH RETURN VALUES +.sp +.LP +Upon successful completion,\fB lgrp_nlgrps()\fR returns the number of lgroups +in the system. Otherwise, it returns \(mi1 and sets \fBerrno\fR to indicate the +error. +.SH ERRORS +.sp +.LP +The \fBlgrp_nlgrps()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The \fIcookie\fR is not valid. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_children\fR(3LGRP), \fBlgrp_init\fR(3LGRP), \fBlgrp_parents\fR(3LGRP), +\fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_parents.3lgrp b/usr/src/man/man3lgrp/lgrp_parents.3lgrp new file mode 100644 index 0000000000..408f105efc --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_parents.3lgrp @@ -0,0 +1,84 @@ +'\" te +.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_parents 3LGRP "16 Apr 2003" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_parents \- get parents of given lgroup +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary \&.\|.\|.\fR ] +#include <sys/lgrp_user.h> + +\fBint\fR \fBlgrp_parents\fR(\fBlgrp_cookie_t\fR \fIcookie\fR, \fBlgrp_id_t\fR \fIchild\fR, + \fBlgrp_id_t *\fR\fIlgrp_array\fR, \fBuint_t\fR \fIlgrp_array_size\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_parents()\fR function takes a \fIcookie\fR representing a snapshot +of the lgroup hierarchy obtained from \fBlgrp_init\fR(3LGRP) and returns the +number of parent lgroups of the specified lgroup. If \fIlgrp_array\fR is +non-null and the \fIlgrp_array_size\fR is non-zero, the array is filled with as +many of the parent lgroup IDs as will fit given the size of the array. For the +root lgroup, the number of parents returned is 0 and the \fIlgrp_array\fR +argument is not filled in. +.SH RETURN VALUES +.sp +.LP +Upon successful completion, \fBlgrp_parents()\fR returns the number of parent +lgroup IDs. Otherwise, \(mi1 is returned and \fBerrno\fR is set to indicate the +error. +.SH ERRORS +.sp +.LP +The \fBlgrp_parents()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The specified cookie or lgroup ID is not valid. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBESRCH\fR\fR +.ad +.RS 10n +.rt +The specified lgroup ID was not found. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_children\fR(3LGRP), \fBlgrp_init\fR(3LGRP), \fBlgrp_nlgrps\fR(3LGRP), +\fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_resources.3lgrp b/usr/src/man/man3lgrp/lgrp_resources.3lgrp new file mode 100644 index 0000000000..470516cf3c --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_resources.3lgrp @@ -0,0 +1,99 @@ +'\" te +.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_resources 3LGRP "26 Jan 2005" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_resources \- get lgroup resources of given lgroup +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary \&.\|.\|.\fR ] +#include <sys/lgrp_user.h> + +\fBint\fR \fBlgrp_resources\fR(\fBlgrp_cookie_t\fR \fIcookie\fR, \fBlgrp_id_t\fR \fIlgrp\fR, + \fBlgrp_id_t *\fR\fIlgrpids\fR, \fBuint_t\fR \fIcount\fR, \fBlgrp_rsrc_t\fR \fItype\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_resources()\fR function takes a cookie representing a snapshot +of the lgroup hierarchy obtained from \fBlgrp_init\fR(3LGRP) and returns the +number of resources in the lgroup specified by \fIlgrp\fR. The resources are +represented by a set of lgroups in which each lgroup directly contains CPU +and/or memory resources. +.sp +.LP +The \fItype\fR argument should be set to one of the following values to specify +whether the CPU or memory resources should be returned: +.sp +.in +2 +.nf +LGRP_RSRC_CPU /* CPU resources */ +LGRP_RSRC_MEM /* Memory resources */ +.fi +.in -2 + +.sp +.LP +If the \fIlgrpids\fR[] argument is non-null and the \fIcount\fR argument is +non-zero, \fBlgrp_resources()\fR stores up to the specified count of lgroup IDs +into the \fIlgrpids\fR[] array. +.SH RETURN VALUES +.sp +.LP +Upon successful completion, \fBlgrp_resources()\fR returns the number of +lgroup resources. Otherwise, -1 is returned and \fBerrno\fR is set to indicate +the error. +.SH ERRORS +.sp +.LP +The \fBlgrp_resources()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The specified cookie, lgroup ID, or type is not valid. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBESRCH\fR\fR +.ad +.RS 10n +.rt +The specified lgroup ID was not found. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_children\fR(3LGRP), \fBlgrp_init\fR(3LGRP), \fBlgrp_parents\fR(3LGRP), +\fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_root.3lgrp b/usr/src/man/man3lgrp/lgrp_root.3lgrp new file mode 100644 index 0000000000..db31cc426b --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_root.3lgrp @@ -0,0 +1,65 @@ +'\" te +.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_root 3LGRP "31 Jan 2008" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_root \- return root lgroup ID +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary \&.\|.\|.\fR ] +#include <sys/lgrp_user.h> + +\fBlgrp_id_t\fR \fBlgrp_root\fR(\fBlgrp_cookie_t\fR \fIcookie\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_root()\fR function returns the root lgroup ID. +.SH RETURN VALUES +.sp +.LP +Upon successful completion, \fBlgrp_root()\fR returns the lgroup ID of the root +lgroup. Otherwise, it returns \(mi1 and sets \fBerrno\fR to indicate the error. +.SH ERRORS +.sp +.LP +The \fBlgrp_root()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The \fIcookie\fR is not valid. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityCommitted +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_children\fR(3LGRP), \fBlgrp_init\fR(3LGRP), \fBlgrp_nlgrps\fR(3LGRP), +\fBlgrp_parents\fR(3LGRP), \fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_version.3lgrp b/usr/src/man/man3lgrp/lgrp_version.3lgrp new file mode 100644 index 0000000000..8d432f7baf --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_version.3lgrp @@ -0,0 +1,81 @@ +'\" te +.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_version 3LGRP "16 Apr 2003" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_version \- coordinate library and application versions +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary \&.\|.\|.\fR ] +#include <sys/lgrp_user.h> + +\fBint\fR \fBlgrp_version\fR(\fBconst int\fR \fIversion\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_version()\fR function takes an interface version number, +\fIversion\fR, as an argument and returns an lgroup interface version. The +\fIversion\fR argument should be the value of \fBLGRP_VER_CURRENT\fR bound to +the application when it was compiled or \fBLGRP_VER_NONE\fR to find out the +current lgroup interface version on the running system. +.SH RETURN VALUES +.sp +.LP +If \fIversion\fR is still supported by the implementation, then +\fBlgrp_version()\fR returns the requested version. If \fBLGRP_VER_NONE\fR is +returned, the implementation cannot support the requested version. The +application should be recompiled and might require further changes. +.sp +.LP +If \fIversion\fR is \fBLGRP_VER_NONE\fR, \fBlgrp_version()\fR returns the +current version of the library. +.SH EXAMPLES +.LP +\fBExample 1 \fRTest whether the version of the interface used by the caller is +supported. +.sp +.LP +The following example tests whether the version of the interface used by the +caller is supported: + +.sp +.in +2 +.nf +#include <sys/lgrp_user.h> + +if (lgrp_version(LGRP_VER_CURRENT) != LGRP_VER_CURRENT) { + fprintf(stderr, "Built with unsupported lgroup interface %d\en", + LGRP_VER_CURRENT); + exit (1); +} +.fi +.in -2 + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_init\fR(3LGRP), \fBliblgrp\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lgrp/lgrp_view.3lgrp b/usr/src/man/man3lgrp/lgrp_view.3lgrp new file mode 100644 index 0000000000..e69b6948f4 --- /dev/null +++ b/usr/src/man/man3lgrp/lgrp_view.3lgrp @@ -0,0 +1,74 @@ +'\" te +.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH lgrp_view 3LGRP "16 Apr 2003" "SunOS 5.11" "Locality Group Library Functions" +.SH NAME +lgrp_view \- get view of lgroup hierarchy +.SH SYNOPSIS +.LP +.nf +cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-llgrp\fR [ \fIlibrary \&.\|.\|.\fR ] +#include <sys/lgrp_user.h> + +\fBlgrp_view_t\fR \fBlgrp_view\fR(\fBlgrp_cookie_t\fR \fIcookie\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlgrp_view()\fR function takes a \fIcookie\fR representing the snapshot +of the lgroup hierarchy obtained from \fBlgrp_init\fR(3LGRP) and returns the +snapshot's view of the lgroup hierarchy. +.sp +.LP +If the given view is \fBLGRP_VIEW_CALLER\fR, the snapshot contains only the +resources that are available to the caller (such as those with respect to +processor sets). When the view is \fBLGRP_VIEW_OS\fR, the snapshot contains +what is available to the operating system. +.SH RETURN VALUES +.sp +.LP +Upon succesful completion, \fBlgrp_view()\fR returns the view for the snapshot +of the lgroup hierarchy represented by the given cookie. Otherwise, \(mi1 is +returned and \fBerrno\fR is set to indicate the error. +.SH ERRORS +.sp +.LP +The \fBlgrp_view()\fR function will fail if: +.sp +.ne 2 +.mk +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +.rt +The \fIcookie\fR is not valid. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +Interface StabilityEvolving +_ +MT-LevelMT-Safe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlgrp_cookie_stale\fR(3LGRP), \fBlgrp_fini\fR(3LGRP), \fBlgrp_init\fR(3LGRP), +\fBliblgrp\fR(3LIB), \fBattributes\fR(5) |
