Print this page
6583 remove whole-process swapping
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/disp/sysclass.c
+++ new/usr/src/uts/common/disp/sysclass.c
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
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
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
20 20 */
21 21
22 22 /*
23 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 28 /* All Rights Reserved */
29 29
30 -#pragma ident "%Z%%M% %I% %E% SMI" /* from SVr4.0 1.12 */
31 -
32 30 #include <sys/types.h>
33 31 #include <sys/param.h>
34 32 #include <sys/sysmacros.h>
35 33 #include <sys/signal.h>
36 34 #include <sys/pcb.h>
37 35 #include <sys/user.h>
38 36 #include <sys/systm.h>
39 37 #include <sys/sysinfo.h>
40 38 #include <sys/var.h>
41 39 #include <sys/errno.h>
42 40 #include <sys/cmn_err.h>
43 41 #include <sys/proc.h>
44 42 #include <sys/debug.h>
45 43 #include <sys/inline.h>
46 44 #include <sys/disp.h>
47 45 #include <sys/class.h>
48 46 #include <sys/kmem.h>
49 47 #include <sys/cpuvar.h>
50 48 #include <sys/priocntl.h>
51 49
52 50 /*
53 51 * Class specific code for the sys class. There are no
54 52 * class specific data structures associated with
55 53 * the sys class and the scheduling policy is trivially
56 54 * simple. There is no time slicing.
57 55 */
58 56
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
59 57 pri_t sys_init(id_t, int, classfuncs_t **);
60 58 static int sys_getclpri(pcpri_t *);
61 59 static int sys_fork(kthread_t *, kthread_t *, void *);
62 60 static int sys_enterclass(kthread_t *, id_t, void *, cred_t *, void *);
63 61 static int sys_canexit(kthread_t *, cred_t *);
64 62 static int sys_nosys();
65 63 static int sys_donice(kthread_t *, cred_t *, int, int *);
66 64 static int sys_doprio(kthread_t *, cred_t *, int, int *);
67 65 static void sys_forkret(kthread_t *, kthread_t *);
68 66 static void sys_nullsys();
69 -static pri_t sys_swappri(kthread_t *, int);
70 67 static int sys_alloc(void **, int);
71 68
72 69 struct classfuncs sys_classfuncs = {
73 70 /* messages to class manager */
74 71 {
75 72 sys_nosys, /* admin */
76 73 sys_nosys, /* getclinfo */
77 74 sys_nosys, /* parmsin */
78 75 sys_nosys, /* parmsout */
79 76 sys_nosys, /* vaparmsin */
80 77 sys_nosys, /* vaparmsout */
81 78 sys_getclpri, /* getclpri */
82 79 sys_alloc,
83 80 sys_nullsys, /* free */
84 81 },
85 82 /* operations on threads */
86 83 {
87 84 sys_enterclass, /* enterclass */
↓ open down ↓ |
8 lines elided |
↑ open up ↑ |
88 85 sys_nullsys, /* exitclass */
89 86 sys_canexit,
90 87 sys_fork,
91 88 sys_forkret, /* forkret */
92 89 sys_nullsys, /* parmsget */
93 90 sys_nosys, /* parmsset */
94 91 sys_nullsys, /* stop */
95 92 sys_nullsys, /* exit */
96 93 sys_nullsys, /* active */
97 94 sys_nullsys, /* inactive */
98 - sys_swappri, /* swapin */
99 - sys_swappri, /* swapout */
100 95 sys_nullsys, /* trapret */
101 96 setfrontdq, /* preempt */
102 97 setbackdq, /* setrun */
103 98 sys_nullsys, /* sleep */
104 99 sys_nullsys, /* tick */
105 100 setbackdq, /* wakeup */
106 101 sys_donice,
107 102 (pri_t (*)())sys_nosys, /* globpri */
108 103 sys_nullsys, /* set_process_group */
109 104 sys_nullsys, /* yield */
110 105 sys_doprio,
111 106 }
112 107
113 108 };
114 109
115 110
116 111 /* ARGSUSED */
117 112 pri_t
118 113 sys_init(cid, clparmsz, clfuncspp)
119 114 id_t cid;
120 115 int clparmsz;
121 116 classfuncs_t **clfuncspp;
122 117 {
123 118 *clfuncspp = &sys_classfuncs;
124 119 return ((pri_t)v.v_maxsyspri);
125 120 }
126 121
127 122 /*
128 123 * Get maximum and minimum priorities enjoyed by sysclass threads
129 124 */
130 125 static int
131 126 sys_getclpri(pcpri_t *pcprip)
132 127 {
133 128 pcprip->pc_clpmax = maxclsyspri;
134 129 pcprip->pc_clpmin = minclsyspri;
135 130 return (0);
136 131 }
137 132
138 133 /* ARGSUSED */
139 134 static int
140 135 sys_enterclass(t, cid, parmsp, reqpcredp, bufp)
141 136 kthread_t *t;
142 137 id_t cid;
143 138 void *parmsp;
144 139 cred_t *reqpcredp;
145 140 void *bufp;
146 141 {
147 142 return (0);
148 143 }
149 144
150 145 /* ARGSUSED */
151 146 static int
152 147 sys_canexit(kthread_t *t, cred_t *reqpcredp)
153 148 {
154 149 return (0);
155 150 }
156 151
157 152 /* ARGSUSED */
158 153 static int
159 154 sys_fork(t, ct, bufp)
160 155 kthread_t *t;
161 156 kthread_t *ct;
162 157 void *bufp;
163 158 {
164 159 /*
165 160 * No class specific data structure
166 161 */
167 162 return (0);
168 163 }
169 164
170 165
171 166 /* ARGSUSED */
172 167 static void
173 168 sys_forkret(t, ct)
174 169 kthread_t *t;
175 170 kthread_t *ct;
176 171 {
177 172 register proc_t *pp = ttoproc(t);
178 173 register proc_t *cp = ttoproc(ct);
179 174
180 175 ASSERT(t == curthread);
181 176 ASSERT(MUTEX_HELD(&pidlock));
182 177
183 178 /*
184 179 * Grab the child's p_lock before dropping pidlock to ensure
↓ open down ↓ |
75 lines elided |
↑ open up ↑ |
185 180 * the process does not disappear before we set it running.
186 181 */
187 182 mutex_enter(&cp->p_lock);
188 183 mutex_exit(&pidlock);
189 184 continuelwps(cp);
190 185 mutex_exit(&cp->p_lock);
191 186
192 187 mutex_enter(&pp->p_lock);
193 188 continuelwps(pp);
194 189 mutex_exit(&pp->p_lock);
195 -}
196 -
197 -/* ARGSUSED */
198 -static pri_t
199 -sys_swappri(t, flags)
200 - kthread_t *t;
201 - int flags;
202 -{
203 - return (-1);
204 190 }
205 191
206 192 static int
207 193 sys_nosys()
208 194 {
209 195 return (ENOSYS);
210 196 }
211 197
212 198
213 199 static void
214 200 sys_nullsys()
215 201 {
216 202 }
217 203
218 204 /* ARGSUSED */
219 205 static int
220 206 sys_donice(kthread_t *t, cred_t *cr, int incr, int *retvalp)
221 207 {
222 208 return (EINVAL);
223 209 }
224 210
225 211 /* ARGSUSED */
226 212 static int
227 213 sys_doprio(kthread_t *t, cred_t *cr, int incr, int *retvalp)
228 214 {
229 215 return (EINVAL);
230 216 }
231 217
232 218 /* ARGSUSED */
233 219 static int
234 220 sys_alloc(void **p, int flag)
235 221 {
236 222 *p = NULL;
237 223 return (0);
238 224 }
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX