xref: /illumos-gate/usr/src/uts/common/sys/pool_pset.h (revision 2d6eb4a5)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_POOL_PSET_H
28 #define	_SYS_POOL_PSET_H
29 
30 #include <sys/types.h>
31 #include <sys/cpupart.h>
32 #include <sys/procset.h>
33 #include <sys/nvpair.h>
34 #include <sys/exacct.h>
35 #include <sys/time.h>
36 #include <sys/list.h>
37 
38 #ifdef	__cplusplus
39 extern "C" {
40 #endif
41 
42 #ifdef	_KERNEL
43 
44 struct zone;
45 
46 typedef struct pool_pset {
47 	psetid_t		pset_id;	/* pset ID */
48 	uint_t			pset_npools;	/* # of pools we belong to */
49 	list_node_t		pset_link;	/* link to next/prev pset */
50 	nvlist_t		*pset_props;	/* pset properties */
51 } pool_pset_t;
52 
53 extern pool_pset_t *pool_pset_default;		/* default pset */
54 extern hrtime_t pool_pset_mod;			/* pset modification time */
55 extern hrtime_t pool_cpu_mod;			/* cpu modification time */
56 
57 extern void pool_pset_init(void);
58 extern int pool_pset_enable(void);
59 extern int pool_pset_disable(void);
60 extern int pool_pset_create(psetid_t *);
61 extern int pool_pset_destroy(psetid_t);
62 extern int pool_pset_assoc(poolid_t, psetid_t);
63 extern void pool_pset_bind(proc_t *, psetid_t, void *, void *);
64 extern int pool_pset_xtransfer(id_t, id_t, size_t, id_t *);
65 extern int pool_pset_proprm(psetid_t, char *);
66 extern int pool_pset_propput(psetid_t, nvpair_t *);
67 extern int pool_pset_propget(psetid_t, char *, nvlist_t *);
68 extern int pool_cpu_proprm(processorid_t, char *);
69 extern int pool_cpu_propput(processorid_t, nvpair_t *);
70 extern int pool_cpu_propget(processorid_t, char *, nvlist_t *);
71 extern int pool_pset_pack(ea_object_t *);
72 
73 extern int pset_bind_start(struct proc **, struct pool *);
74 extern void pset_bind_abort(struct proc **, struct pool *);
75 extern void pset_bind_finish(void);
76 
77 extern boolean_t pool_pset_enabled(void);
78 
79 extern void pool_pset_visibility_add(psetid_t, struct zone *);
80 extern void pool_pset_visibility_remove(psetid_t, struct zone *);
81 
82 #endif	/* _KERNEL */
83 
84 #ifdef	__cplusplus
85 }
86 #endif
87 
88 #endif	/* _SYS_POOL_PSET_H */
89