1lgrp_init(3LGRP) Locality Group Library Functions lgrp_init(3LGRP)
2
3
4
6 lgrp_init - initialize lgroup interface
7
9 cc [ flag... ] file... -llgrp [ library... ]
10 #include <sys/lgrp_user.h>
11
12 lgrp_cookie_t lgrp_init(lgrp_view_t view);
13
14
16 The lgrp_init() function initializes the lgroup interface and takes a
17 snapshot of the lgroup hierarchy with the given view. If the given
18 view is LGRP_VIEW_CALLER, the snapshot contains only the resources that
19 are available to the caller (for example, with respect to processor
20 sets). When the view is LGRP_VIEW_OS, the snapshot contains what is
21 available to the operating system.
22
23
24 Given the view, lgrp_init() returns a cookie representing this snapshot
25 of the lgroup hierarchy. This cookie should be used with other routines
26 in the lgroup interface needing the lgroup hierarchy. The
27 lgrp_fini(3LGRP) function should be called with the cookie when it is
28 no longer needed.
29
30
31 The lgroup hiearchy represents the latency topology of the machine.
32 The hierarchy is simplified to be a tree and can be used to find the
33 nearest resources.
34
35
36 The lgroup hiearchy consists of a root lgroup, which is the maximum
37 bounding locality group of the system, contains all the CPU and memory
38 resources of the machine, and may contain other locality groups that
39 contain CPUs and memory within a smaller locality. The leaf lgroups
40 contain resources within the smallest latency.
41
42
43 The resources of a given lgroup come directly from the lgroup itself or
44 from leaf lgroups contained within the lgroup. Leaf lgroups directly
45 contain their own resources and do not encapsulate any other lgroups.
46
47
48 The lgroup hierarchy can be used to find the nearest resources. From a
49 given lgroup, the closest resources can be found in the lgroup itself.
50 After that, the next nearest resources can be found in its parent
51 lgroup, and so on until the root lgroup is reached where all the
52 resources of the machine are located.
53
55 Upon successful completion, lgrp_init() returns a cookie. Otherwise it
56 returns LGRP_COOKIE_NONE and sets errno to indicate the error.
57
59 The lgrp_init() function will fail if:
60
61 EINVAL The view is not valid.
62
63
64 ENOMEM There was not enough memory to allocate the snapshot of the
65 lgroup hierarchy.
66
67
69 See attributes(5) for descriptions of the following attributes:
70
71
72
73
74 ┌─────────────────────────────┬─────────────────────────────┐
75 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
76 ├─────────────────────────────┼─────────────────────────────┤
77 │Interface Stability │Evolving │
78 ├─────────────────────────────┼─────────────────────────────┤
79 │MT-Level │MT-Safe │
80 └─────────────────────────────┴─────────────────────────────┘
81
83 lgrp_children(3LGRP), lgrp_cookie_stale(3LGRP), lgrp_cpus(3LGRP),
84 lgrp_fini(3LGRP), lgrp_mem_size(3LGRP), lgrp_nlgrps(3LGRP), lgrp_par‐
85 ents(3LGRP), lgrp_resources(3LGRP), lgrp_root(3LGRP), lgrp_view(3LGRP),
86 liblgrp(3LIB), attributes(5)
87
88
89
90SunOS 5.11 26 Jan 2005 lgrp_init(3LGRP)