summaryrefslogtreecommitdiff
path: root/usr/src/man/man3lib/libpool.3lib
blob: dda52516f54c72131bc5142a02b7ada538a82f28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
'\" te
.\" Copyright (c) 2006, 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 LIBPOOL 3LIB "Dec 14, 2006"
.SH NAME
libpool \- pool configuration manipulation library
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
#include <\fBpool.h\fR>
.fi

.SH DESCRIPTION
.sp
.LP
The functions in this library define the interface for reading and writing
resource pools configuration files, as well as that for commiting an existing
configuration to becoming the running OS configuration (with respect to
partitioning subsystems). The <\fBpool.h\fR> header provides type and function
declarations for all library services.
.sp
.LP
The resource pools facility brings together process-bindable resources into a
common abstraction called a pool. Processor sets and other entities can be
configured, grouped, and labelled in a persistent fashion such that workload
components can be associated with a subset of a system's total resources. The
\fBlibpool\fR library provides a C language API for accessing this
functionality, while \fBpooladm\fR(1M), \fBpoolbind\fR(1M), and
\fBpoolcfg\fR(1M) make this facility available through command invocations from
a shell. Each of those manual pages describes aspects of the pools facility;
this page describes the properties available to the various entities managed
within the pools facility. These entities include the system, pools, and the
\fBpset\fR resources for processor sets.
.sp
.LP
When the pools facility is enabled on a system, the behavior of the following
functions is modified.
.sp

.sp
.TS
c c
l l .
System Call	Error Value
_
\fBpset_assign\fR(pset !=\fBPS_QUERY\fR)	\fBENOTSUP\fR
\fBpset_bind\fR(pset !=\fBPS_QUERY\fR)	\fBENOTSUP\fR
\fBpset_create()\fR	\fBENOTSUP\fR
\fBpset_destroy()\fR	\fBENOTSUP\fR
\fBpset_setattr()\fR	\fBENOTSUP\fR
.TE

.sp
.LP
Each active entity within the resource pools framework can have an arbitrary
collection of named, typed properties associated with it. Properties supported
by the pools framework are listed, with descriptions, under each entity below.
In general, resource properties can be one of five types: boolean (\fBbool\fR),
signed (\fBint64\fR) and unsigned (\fBuint64\fR) integers, floating point
(\fBdouble\fR), and \fBstring\fR values.
.sp
.LP
All entities and resources support a string property for commenting purposes;
this property is available for use by management applications to record
descriptions and other administrator oriented data. The comment field is not
used by the default pools commands, except when a configuration is initiated by
the \fBpoolcfg\fR utility, in which case an informative message is placed in
the \fBsystem.comment\fR property for that configuration.
.SS "System"
.sp

.sp
.TS
c c c
l l l .
Property name	Type	Description
\fBsystem.allocate-method\fR	\fBstring\fR	T{
Allocation method to use when this configuration is instantiated
T}
\fBsystem.bind-default\fR	\fBbool\fR	T{
If specified pool not found, bind to pool with 'pool.default' property set to true
T}
\fBsystem.comment\fR	\fBstring\fR	User description of system
\fBsystem.name\fR	\fBstring\fR	User name for the configuration
\fBsystem.version\fR	\fBint64\fR	T{
\fBlibpool\fR version required to manipulate this configuration
T}
\fBsystem.poold.log-level\fR	\fBstring\fR	\fBpoold\fR logging level
\fBsystem.poold.log-location\fR	\fBstring\fR	\fBpoold\fR logging location
\fBsystem.poold.history-file\fR	\fBstring\fR	\fBpoold\fR decision history location
\fBsystem.poold.monitor-interval\fR	\fBuint64\fR	\fBpoold\fR monitoring sample interval
\fBsystem.poold.objectives\fR	\fBstring\fR	\fBpoold\fR objectives for a system.
.TE

.sp
.LP
The \fBsystem.allocate-method\fR, \fBsystem.bind-default\fR,
\fBsystem.comment\fR, \fBsystem.name\fR, \fBsystem.poold.log-level\fR,
\fBsystem.poold.log-location\fR, \fBsystem.poold.history-file\fR,
\fBsystem.poold.monitor-interval\fR, and \fBsystem.poold.objectives\fR
properties are writable; the \fBsystem.version\fR property is not.
.sp
.LP
The \fBsystem.allocate-method\fR property accepts only two values, "importance
based" and "surplus to default". The default value for this property is
"importance based". The property is optional and if it is not present the
library will allocate resources as though it were present and had the default
value. These strings are defined in <\fBpool.h\fR> as \fBPOA_IMPORTANCE\fR and
\fBPOA_SURPLUS_TO_DEFAULT\fR.
.sp
.LP
If "importance based" allocation is defined, then during a commit the library
will allocate resources to pools using an algorithm that observes minimum and
maximum constraints for resources but favors those resources with greater
importance.
.sp
.LP
If "surplus to default" is defined, then during a commit the library will
allocate minimum resources to all resource sets apart from default which will
receive any surplus.
.sp
.LP
The \fBsystem.bind-default\fR property defaults to true. This property
interacts with the \fBproject.pool\fR resource control to specify the binding
behavior for processes associated with a project. If \fBproject.pool\fR is not
specified, then this property has no effect. If \fBproject.pool\fR is specified
and the specified pool exists, this property has no effect. If the specified
pool does not exist, perhaps because of a reconfiguration, then this property
controls the binding behavior for the project member. If
\fBsystem.bind-default\fR is true, then the project member is bound to the
default pool (identified as the pool for which \fBpool.default\fR is true);
otherise the project member is refused access to the system. Care should be
taken with the pools configuration if this property is set to false, so as to
avoid denying users access to the system.
.sp
.LP
The various \fBpoold\fR properties are used to configure the operation of
\fBpoold\fR(1M).
.sp
.LP
The \fBsystem.poold.log-level\fR property is used to specify the level of
detail provided in log messages. Valid values are: \fBALERT\fR, \fBCRIT\fR,
\fBERR\fR, \fBWARNING\fR, \fBNOTICE\fR, \fBINFO\fR, and \fBDEBUG\fR.
.sp
.LP
\fBALERT\fR provides the least level of detail, \fBDEBUG\fR the greatest. See
\fBsyslog\fR(3C) for more information about the meaning of these debug levels.
If this property is not specified, the default value \fBNOTICE\fR is used.
.sp
.LP
The \fBsystem.poold.log-location\fR property is used to specify the location of
the logfiles generated by \fBpoold\fR. The special value of "syslog" indicates
that logged messages should be written to \fBsyslog()\fR. If this property is
not specified, the default location \fB/var/log/pool\fR is used.
.sp
.LP
The \fBsystem.poold.history-file\fR specifies the location of the decision
history file which is used by \fBpoold\fR to improve the quality of its
decision making over time. If this property is not specified, the default
location \fB/var/adm/pool\fR is used.
.sp
.LP
The \fBsystem.poold.monitor-interval\fR property specifies the monitoring
interval (in milliseconds) to be used by \fBpoold\fR when sampling utilization
statistics. If this property is not specified, the default value of 15 seconds
is used.
.sp
.LP
The \fBsystem.poold.objectives\fR property specifies any system wide
objectives. An objectives property has the following syntax:
.sp
.in +2
.nf
objectives = objective [; objective]*
objective = [n:] keyword [op] [value]
.fi
.in -2

.sp
.LP
All objectives are prefixed with an optional importance. The importance acts as
a multiplier for the objective and thus increases the significance of its
contribution to the objective function evaluation. If no importance is
specified, the default value is 1.
.sp
.LP
The "wt-load" objective is the only objective to which a system element can be
set. This objective favors configurations that match resource allocations to
resource utilization. A resource set that uses more resources will be given
more resources when this objective is active. An administrator should use this
objective when he is relatively satisfied with the constraints established
using the minimum and maximum properties and would like the DRP to manipulate
resources freely within those constraints.
.SS "Pools"
.sp

.sp
.TS
c c c
l l l .
Property name	Type	Description
\fBpool.active\fR	\fBbool\fR	Mark this pool as active, if true.
\fBpool.comment\fR	\fBstring\fR	User description of pool.
\fBpool.default\fR	\fBbool\fR	T{
Mark this pool as the default pool, if true; see system.bind-default property.
T}
\fBpool.importance\fR	\fBint64\fR	T{
Relative importance of this pool; for possible resource dispute resolution.
T}
\fBpool.name\fR	\fBstring\fR	T{
User name for pool; used by \fBsetproject\fR(3PROJECT) as value for 'project.pool' project attribute in \fBproject\fR(4) database.
T}
\fBpool.scheduler\fR	\fBstring\fR	T{
Scheduler class to which consumers of this pool will be bound. This property is optional and if not specified, the scheduler bindings for consumers of this pool are not affected.
T}
\fBpool.sys_id\fR	\fBint64\fR	System-assigned pool ID.
\fBpool.temporary\fR	\fBbool\fR	T{
Mark this pool as a temporary resource; if true, this pool can exist only in the dynamic configuration and cannot be committed to a configuration file.
T}
.TE

.sp
.LP
The \fBpool.default\fR, \fBpool.sys_id\fR, and \fBpool.temporary\fR properties
are not writable; all other listed properties are writable.
.sp
.LP
If pool.scheduler is specified, it must be set to the name of a valid
scheduling class for the system. See the \fB-c\fR option for \fBpriocntl\fR(1)
for a list of valid class names.
.SS "Processor Sets"
.sp

.sp
.TS
c c c
l l l .
Property name	Type	Description
\fBpset.comment\fR	\fBstring\fR	User description of resource.
\fBpset.default\fR	\fBbool\fR	Marks default processor set.
\fBpset.load\fR	\fBuint64\fR	The load for this processor set.
\fBpset.max\fR	\fBuint64\fR	T{
Maximum number of CPUs permitted in this processor set.
T}
\fBpset.min\fR	\fBuint64\fR	T{
Minimum number of CPUs permitted in this processor set.
T}
\fBpset.name\fR	\fBstring\fR	User name for resource.
\fBpset.size\fR	\fBuint64\fR	T{
Current number of CPUs in this processor set.
T}
\fBpset.sys_id\fR	\fBint64\fR	System-assigned processor set ID.
\fBpset.temporary\fR	\fBbool\fR	T{
Mark this processor set as a temporary resource; if true, this processor set can exist only in the dynamic configuration and cannot be committed to a configuration file.
T}
\fBpset.type\fR	\fBstring\fR	T{
Names resource type; value for all processor sets is \fBpset\fR.
T}
\fBpset.units\fR	\fBstring\fR	T{
Identifies meaning of size-related properties; value for all processor sets is \fBpopulation\fR.
T}
\fBpset.poold.objectives\fR	\fBstring\fR	T{
Specifies the poold objectives for a pset.
T}
.TE

.sp
.LP
The \fBpset.comment\fR, \fBpset.max\fR, \fBpset.min\fR, \fBpset.name\fR, and
\fBpset.poold.objectives\fR properties are writable; the \fBpset.default\fR,
\fBpset.load\fR, \fBpset.size\fR, \fBpset.sys_id\fR, \fBpset.temporary\fR,
\fBpset.type\fR, and \fBpset.units\fR properties are not.
.sp
.LP
The \fBpset.load\fR property represents the load on a processor set. The lowest
value for this property is 0. The value of \fBpset.load\fR increases in a
linear fashion with the load on the set, as measured by the number of jobs in
the system run queue.
.sp
.LP
The \fBpset.poold.objectives\fR property specifies an objective which is
specific to a particular \fBpset\fR. See the \fBsystem.poold.objectives\fR
entry for the specification of this property's syntax.
.sp
.LP
There are two types of objectives that can be set on a \fBpset\fR:
.sp
.ne 2
.na
\fB\fBlocality\fR\fR
.ad
.RS 15n
This objective influences the impact that locality, as measured by lgroup data,
has upon the chosen configuration. This objective can take one of three values:
.sp
.ne 2
.na
\fB\fBtight\fR\fR
.ad
.RS 9n
If set, configurations that maximize resource locality are favored.
.RE

.sp
.ne 2
.na
\fB\fBloose\fR\fR
.ad
.RS 9n
If set, configurations that minimize resource locality are favored.
.RE

.sp
.ne 2
.na
\fB\fBnone\fR\fR
.ad
.RS 9n
This is the default value for this objective. If set, configuration
favorability is uninfluenced by resource locality.
.RE

.RE

.sp
.ne 2
.na
\fB\fButilization\fR\fR
.ad
.RS 15n
This objective favors configurations that allocate resources to partitions that
are failing to preserve the specified utilization objective.
.RE

.sp
.LP
These objectives are specified in terms of an operator and a value. The
operators are
.sp
.ne 2
.na
\fB\fB<\fR\fR
.ad
.RS 5n
The ``less than'' operator is used to indicate that the specified value should
be treated as a maximum target value.
.RE

.sp
.ne 2
.na
\fB\fB>\fR\fR
.ad
.RS 5n
The ``greater than'' operator is used to indicate that the specified value
should be treated as a minimum target value.
.RE

.sp
.ne 2
.na
\fB\fB~\fR\fR
.ad
.RS 5n
The ``about'' operator is used to indicate that the specified value should be
treated as a target value about which some fluctuation is acceptable.
.RE

.sp
.LP
Only one objective of each type of operator can be set. For example, if the
\fB~\fR operator is set, the \fB<\fR and \fB>\fR operators cannot be set. It is
possible to set a \fB<\fR and a \fB>\fR operator together; the values will be
validated to ensure that they do not overlap.
.SS "Processors"
.sp

.sp
.TS
c c c
l l l .
Property name	Type	Description
_
\fBcpu.comment\fR	\fBstring\fR	User description of CPU.
\fBcpu.pinned\fR	\fBbool\fR	CPU pinned to this processor set.
\fBcpu.status\fR	\fBint64\fR	T{
Processor status, on-line, offline or interrupts disabled.
T}
\fBcpu.sys_id\fR	\fBint64\fR	System-assigned processor ID.
.TE

.sp
.LP
The \fBcpu.comment\fR, \fBcpu.pinned\fR, and \fBcpu.status\fR properties are
writeable.
.sp
.LP
The \fBcpu.status\fR property can be set only to the following values:
.sp
.ne 2
.na
\fB\fBoff-line\fR\fR
.ad
.RS 12n
Set the CPU offline.
.RE

.sp
.ne 2
.na
\fB\fBon-line\fR\fR
.ad
.RS 12n
Set the CPU online.
.RE

.sp
.ne 2
.na
\fB\fBno-intr\fR\fR
.ad
.RS 12n
Disable interrupt processing on the CPU.
.RE

.sp
.LP
These values are defined in <\fBsys/processor.h\fR> as the \fBPS_OFFLINE\fR,
\fBPS_ONLINE\fR, and \fBPS_NOINTR\fR macros.
.SH INTERFACES
.sp
.LP
The shared object \fBlibpool.so.1\fR provides the public interfaces defined
below. See \fBIntro\fR(3) for additional information on shared object
interfaces.
.sp

.sp
.TS
l l
l l .
\fBpool_associate\fR	\fBpool_component_info\fR
\fBpool_component_to_elem\fR	\fBpool_conf_alloc\fR
\fBpool_conf_close\fR	\fBpool_conf_commit\fR
\fBpool_conf_export\fR	\fBpool_conf_free\fR
\fBpool_conf_info\fR	\fBpool_conf_location\fR
\fBpool_conf_open\fR	\fBpool_conf_remove\fR
\fBpool_conf_rollback\fR	\fBpool_conf_status\fR
\fBpool_conf_to_elem\fR	\fBpool_conf_update\fR
\fBpool_conf_validate\fR	\fBpool_create\fR
\fBpool_destroy\fR	\fBpool_dissociate\fR
\fBpool_dynamic_location\fR	\fBpool_error\fR
\fBpool_get_binding\fR	\fBpool_get_owning_resource\fR
\fBpool_get_pool\fR	\fBpool_get_property\fR
\fBpool_get_resource\fR	\fBpool_get_resource_binding\fR
\fBpool_get_status\fR	\fBpool_info\fR
\fBpool_put_property\fR	\fBpool_query_components\fR
\fBpool_query_pool_resources\fR	\fBpool_query_pools\fR
\fBpool_query_resource_components\fR	\fBpool_query_resources\fR
\fBpool_resource_create\fR	\fBpool_resource_destroy\fR
\fBpool_resource_info\fR	\fBpool_resource_to_elem\fR
\fBpool_resource_transfer\fR	\fBpool_resource_type_list\fR
\fBpool_resource_xtransfer\fR	\fBpool_rm_property\fR
\fBpool_set_binding\fR	\fBpool_set_status\fR
\fBpool_static_location\fR	\fBpool_strerror\fR
\fBpool_to_elem\fR	\fBpool_value_alloc\fR
\fBpool_value_free\fR	\fBpool_value_get_bool\fR
\fBpool_value_get_double\fR	\fBpool_value_get_int64\fR
\fBpool_value_get_name\fR	\fBpool_value_get_string\fR
\fBpool_value_get_type\fR	\fBpool_value_get_uint64\fR
\fBpool_value_set_bool\fR	\fBpool_value_set_double\fR
\fBpool_value_set_int64\fR	\fBpool_value_set_name\fR
\fBpool_value_set_string\fR	\fBpool_value_set_uint64\fR
\fBpool_version\fR	\fBpool_walk_components\fR
\fBpool_walk_pools\fR	\fBpool_walk_properties\fR
\fBpool_walk_resources\fR	
.TE

.SH FILES
.sp
.ne 2
.na
\fB\fB/usr/lib/libpool.so.1\fR\fR
.ad
.RS 28n
shared object
.RE

.sp
.ne 2
.na
\fB\fB/usr/lib/64/libpool.so.1\fR\fR
.ad
.RS 28n
64-bit shared object
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
CSI	Enabled
_
Interface Stability	Unstable
_
MT-Level	Safe
.TE

.SH SEE ALSO
.sp
.LP
\fBIntro\fR(3), \fBpool_component_info\fR(3POOL), \fBpool_conf_open\fR(3POOL),
\fBpool_conf_to_elem\fR(3POOL), \fBpool_create\fR(3POOL),
\fBpool_error\fR(3POOL), \fBpool_get_binding\fR(3POOL),
\fBpool_get_property\fR(3POOL), \fBpool_get_resource\fR(3POOL),
\fBpool_resource_create\fR(3POOL), \fBpool_value_alloc\fR(3POOL),
\fBpool_walk_pools\fR(3POOL), \fBattributes\fR(5), \fBsmf\fR(5)
.SH NOTES
.sp
.LP
Functions in \fBlibpool\fR can be used to manipulate static configurations even
when the pools facility is not enabled. See \fBpooladm\fR(1M) and
\fBpool_set_status\fR(3POOL) for more information about enabling the pools
facility. The pools facility must be enabled, however, to modify the dynamic
configuration.
.sp
.LP
Since the Resource Pools facility is an \fBsmf\fR(5) service, it can also be
enabled and disabled using the standard Service Management Facility (SMF)
interfaces.