Print this page
OS-4915 want FX high priority zone configuration option
OS-4925 ps pri shows misleading value for zone in RT scheduling class
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/sys/fx.h
+++ new/usr/src/uts/common/sys/fx.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
|
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 + * Copyright 2015 Joyent, Inc.
24 25 */
25 26
26 27 #ifndef _SYS_FX_H
27 28 #define _SYS_FX_H
28 29
29 -#pragma ident "%Z%%M% %I% %E% SMI"
30 -
31 30 #include <sys/types.h>
32 31 #include <sys/thread.h>
33 32 #include <sys/ddi.h>
34 33 #include <sys/sunddi.h>
35 34 #include <sys/cpucaps.h>
36 35
37 36 #ifdef __cplusplus
38 37 extern "C" {
39 38 #endif
40 39
41 40 /*
42 41 * Fixed-priority dispatcher parameter table entry
43 42 */
44 43 typedef struct fxdpent {
45 44 pri_t fx_globpri; /* global (class independent) priority */
46 45 int fx_quantum; /* time quantum given to procs at this level */
47 46 } fxdpent_t;
48 47
49 48 #ifdef _KERNEL
50 49
51 50 typedef uintptr_t fx_cookie_t; /* handle for callback supplied storage */
52 51
53 52 /*
54 53 * callbacks supplied by custom scheduler. In general, a change to quantum
55 54 * and/or priority when returning from a callback has immediate effect.
56 55 *
57 56 * fx_exit - called when a thread exits. This also needs to free any storage
58 57 * for the fx_cookie_t.
59 58 *
60 59 * fx_callb_tick - called at every clock tick attributed to this thread
61 60 *
62 61 * fx_callb_preempt - called when a thread is being preempted or yielding
63 62 *
64 63 * fx_callb_stop/fx_callb_sleep - called when a thread stops running
65 64 *
66 65 * fx_callb_wakeup - called when a thread is again runnable
67 66 */
68 67 typedef struct fx_callbacks {
69 68 int fx_callb_version;
70 69 void (*fx_callb_exit)(fx_cookie_t);
71 70 void (*fx_callb_tick)(fx_cookie_t, clock_t *, pri_t *);
72 71 void (*fx_callb_preempt)(fx_cookie_t, clock_t *, pri_t *);
73 72 void (*fx_callb_stop)(fx_cookie_t);
74 73 void (*fx_callb_sleep)(fx_cookie_t);
75 74 void (*fx_callb_wakeup)(fx_cookie_t, clock_t *, pri_t *);
76 75
77 76 } fx_callbacks_t;
78 77
79 78
80 79 #define FX_CALLB_VERSION_1 1
81 80
82 81 #define FX_CALLB_REV FX_CALLB_VERSION_1
83 82
84 83 #define FX_CB_VERSION(cb) cb->fx_callb_version
85 84
86 85 #define FX_CB_EXIT(cb, c) cb->fx_callb_exit(c)
87 86
88 87 #define FX_CB_TICK(cb, c, q, p) cb->fx_callb_tick(c, q, p)
89 88
90 89 #define FX_CB_PREEMPT(cb, c, q, p) cb->fx_callb_preempt(c, q, p)
91 90
92 91 #define FX_CB_STOP(cb, c) cb->fx_callb_stop(c)
93 92
94 93 #define FX_CB_SLEEP(cb, c) cb->fx_callb_sleep(c)
95 94
96 95 #define FX_CB_WAKEUP(cb, c, q, p) cb->fx_callb_wakeup(c, q, p)
97 96
98 97 /* priority setting */
99 98 #define FX_CB_NOCHANGE -32768
100 99
101 100
102 101 /*
103 102 * Fixed-priority class specific thread structure
104 103 */
105 104 typedef struct fxproc {
106 105 int fx_pquantum; /* time quantum given to this proc */
107 106 int fx_timeleft; /* time remaining in procs quantum */
108 107
109 108 pri_t fx_pri; /* relative priority within fx class */
110 109 /* same as user priority */
111 110
112 111 pri_t fx_uprilim; /* user priority limit */
113 112
114 113 char fx_nice; /* nice value for compatibility */
115 114 uchar_t fx_flags; /* flags defined below */
116 115 kthread_t *fx_tp; /* pointer to thread */
117 116
118 117 /* the following are used only when we have callbacks registered */
119 118 kt_did_t fx_ktid;
120 119 struct fxproc *fx_cb_next; /* pointer to next fxproc that */
121 120 /* has a callback */
122 121
123 122 struct fxproc *fx_cb_prev; /* pointer to previous fxproc that */
124 123 /* has a callback */
125 124 fx_cookie_t fx_cookie; /* cookie with which callback */
126 125 /* was registered */
127 126 fx_callbacks_t *fx_callback; /* pointer to callback structure */
128 127 caps_sc_t fx_caps; /* CPU caps specific data */
129 128 } fxproc_t;
130 129
131 130
132 131 #define FX_CALLB(fxpp) fxpp->fx_callback
133 132
134 133
135 134 /* flags */
136 135 #define FXBACKQ 0x02 /* thread goes to back of disp q when preempted */
137 136
|
↓ open down ↓ |
97 lines elided |
↑ open up ↑ |
138 137 /*
139 138 * Kernel version of fixed-priority class specific parameter structure
140 139 */
141 140 typedef struct fxkparms {
142 141 pri_t fx_upri;
143 142 pri_t fx_uprilim;
144 143 int fx_tqntm;
145 144 uint_t fx_cflags;
146 145 } fxkparms_t;
147 146
147 +/*
148 + * control flags (kparms->fx_cflags).
149 + */
150 +#define FX_DOUPRILIM 0x01 /* change user priority limit */
151 +#define FX_DOUPRI 0x02 /* change user priority */
152 +#define FX_DOTQ 0x04 /* change FX time quantum */
148 153
154 +#define FXMAXUPRI 60 /* maximum user priority setting */
149 155
150 156 /*
151 157 * Interface for partner private code. This is not a public interface.
152 158 */
153 159 extern int fx_register_callbacks(fx_callbacks_t *, fx_cookie_t, pri_t, clock_t);
154 160 extern int fx_unregister_callbacks();
155 161 extern int fx_modify_priority(kt_did_t, clock_t, pri_t);
156 162 extern void *fx_get_mutex_cookie();
157 163 extern pri_t fx_get_maxpri();
158 164
159 165 #endif /* _KERNEL */
160 166
161 167 #ifdef __cplusplus
162 168 }
163 169 #endif
164 170
165 171 #endif /* _SYS_FX_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX