Print this page
11909 THREAD_KPRI_RELEASE does nothing of the sort
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/fss.h
+++ new/usr/src/uts/common/sys/fss.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
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
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 /*
23 23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 - * Copyright 2012 Joyent, Inc. All rights reserved.
25 + * Copyright 2019 Joyent, Inc.
26 26 */
27 27
28 28 #ifndef _SYS_FSS_H
29 29 #define _SYS_FSS_H
30 30
31 31 #include <sys/types.h>
32 32 #include <sys/thread.h>
33 33 #include <sys/project.h>
34 34 #include <sys/cpucaps.h>
35 35
36 36 #ifdef __cplusplus
37 37 extern "C" {
38 38 #endif
39 39
40 40 #ifdef _KERNEL
41 41
42 42 typedef uint64_t fsspri_t;
43 43 typedef uint64_t fssusage_t;
44 44 struct cpupart;
45 45 struct zone;
46 46
47 47 /*
48 48 * Valid arg1's for fss_allocbuf()
49 49 */
50 50 #define FSS_NPSET_BUF 1
51 51 #define FSS_NPROJ_BUF 2
52 52 #define FSS_ONE_BUF 3
53 53
54 54 /*
55 55 * Valid arg2's for fss_allocbuf()
56 56 */
57 57 #define FSS_ALLOC_PROJ 1
58 58 #define FSS_ALLOC_ZONE 2
59 59
60 60 #define FSS_MAXSHARES 65535
61 61
62 62 typedef struct fssbuf {
63 63 int fssb_size;
64 64 void **fssb_list;
65 65 } fssbuf_t;
66 66
67 67 void *fss_allocbuf(int, int);
68 68 void fss_freebuf(fssbuf_t *, int);
69 69 void fss_changeproj(kthread_id_t, void *, void *, fssbuf_t *, fssbuf_t *);
70 70 void fss_changepset(kthread_id_t, void *, fssbuf_t *, fssbuf_t *);
71 71
72 72 /*
73 73 * Fair share scheduling class specific cpu partition structure
74 74 */
75 75 typedef struct fsspset {
76 76 kmutex_t fssps_lock; /* lock to protect per-pset */
77 77 /* list of fssproj structures */
78 78 disp_lock_t fssps_displock; /* lock for fsps_maxfsspri */
79 79 struct cpupart *fssps_cpupart; /* ptr to our cpu partition */
80 80 /* protected by fsspsets_lock */
81 81 fsspri_t fssps_maxfsspri; /* maximum fsspri value among */
82 82 /* all projects on this pset */
83 83 uint32_t fssps_shares; /* number of active shares */
84 84 uint32_t fssps_nproj; /* number of fssproj structures */
85 85 /* on the list */
86 86 struct fssproj *fssps_list; /* list of project parts */
87 87 struct fsszone *fssps_zones; /* list of fsszone_t's in pset */
88 88 uint32_t fssps_gen; /* generation for zone's kstats */
89 89 } fsspset_t;
90 90
91 91 /*
92 92 * One of these structures is allocated to each project running within each
93 93 * active cpu partition.
94 94 */
95 95 typedef struct fssproj {
96 96 kproject_t *fssp_proj; /* ptr to our project structure */
97 97 fsspset_t *fssp_pset; /* ptr to our fsspset structure */
98 98 uint32_t fssp_threads; /* total number of threads here */
99 99 /* protected by fssps_lock */
100 100 uint32_t fssp_runnable; /* number of runnable threads */
101 101 /* protected by fssps_lock */
102 102 uint32_t fssp_shares; /* copy of our kpj_shares */
103 103 /* protected by fssps_displock */
104 104 uint32_t fssp_ticks; /* total of nice tick values */
105 105 /* protected by fssps_displock */
106 106 uint32_t fssp_tick_cnt; /* cnt of all ticks in this sec */
107 107 uint32_t fssp_shr_pct; /* active shr % in this sec */
108 108 /* protected by fssps_displock */
109 109 fssusage_t fssp_usage; /* this project's decayed usage */
110 110 fssusage_t fssp_shusage; /* normalized usage */
111 111 struct fssproj *fssp_next; /* next project on this pset */
112 112 struct fssproj *fssp_prev; /* prev project on this pset */
113 113 struct fsszone *fssp_fsszone; /* fsszone_t for this fssproj */
114 114 } fssproj_t;
115 115
116 116 /*
117 117 * Fair share scheduling class specific thread structure
118 118 */
119 119 typedef struct fssproc {
120 120 kthread_t *fss_tp; /* pointer back to our thread */
121 121 fssproj_t *fss_proj; /* pointer to our project FSS data */
122 122 uchar_t fss_flags; /* flags defined below */
123 123 int fss_timeleft; /* time remaining in procs quantum */
124 124 uint32_t fss_ticks; /* ticks accumulated by this thread */
125 125 pri_t fss_upri; /* user supplied priority (to priocntl) */
126 126 pri_t fss_uprilim; /* user priority limit */
127 127 pri_t fss_umdpri; /* user mode priority within fs class */
128 128 pri_t fss_scpri; /* remembered priority, for schedctl */
129 129 int fss_nice; /* nice value for compatibility with ts */
130 130 fsspri_t fss_fsspri; /* internal fair share priority */
131 131 int fss_runnable; /* to indicate runnable/sleeping thread */
132 132 struct fssproc *fss_next; /* pointer to next fssproc_t struct */
↓ open down ↓ |
97 lines elided |
↑ open up ↑ |
133 133 struct fssproc *fss_prev; /* pointer to prev fssproc_t sturct */
134 134 caps_sc_t fss_caps; /* CPU caps specific data */
135 135 } fssproc_t;
136 136
137 137 /*
138 138 * One of these structures is allocated to each zone running within
139 139 * each active cpu partition. This means that if a zone spans more
140 140 * than one cpu partition then it will have a few of these structures.
141 141 */
142 142 typedef struct fsszone {
143 - struct zone *fssz_zone; /* ptr to our zone structure */
143 + struct zone *fssz_zone; /* ptr to our zone structure */
144 144 struct fsszone *fssz_next; /* next fsszone_t in fsspset_t */
145 145 struct fsszone *fssz_prev; /* prev fsszone_t in fsspset_t */
146 146 uint32_t fssz_shares; /* sum of all project shares */
147 147 uint32_t fssz_nproj; /* # of projects */
148 148 uint32_t fssz_rshares; /* "real" shares given to zone */
149 149 uint32_t fssz_runnable; /* # of runnable projects */
150 150 } fsszone_t;
151 151
152 152 #define FSSPROC(tx) ((fssproc_t *)(tx->t_cldata))
153 153 #define FSSPROC2FSSPROJ(fssx) ((fssx)->fss_proj);
154 154 #define FSSPROC2FSSPSET(fssx) (FSSPROC2FSSPROJ(fssx)->fssp_pset)
155 155 #define FSSPROJ(tx) (FSSPROC(tx)->fss_proj)
156 156 #define FSSPROJ2FSSPSET(fssx) ((fssx)->fssp_pset)
157 157 #define FSSPROJ2KPROJ(fssx) ((fssx)->fssp_proj)
158 158 #define FSSPROJ2FSSZONE(fssx) ((fssx)->fssp_fsszone)
159 159
160 160 /*
161 161 * fss_flags
162 162 */
163 -#define FSSKPRI 0x01 /* the thread is in kernel mode */
163 +/* Formerly: FSSKPRI 0x01 - the thread is in kernel mode */
164 164 #define FSSBACKQ 0x02 /* thread should be placed at the back of */
165 165 /* the dispatch queue if preempted */
166 166 #define FSSRESTORE 0x04 /* thread was not preempted, due to schedctl */
167 167 /* restore priority from fss_scpri */
168 168
169 169 #endif /* _KERNEL */
170 170
171 171 #ifdef __cplusplus
172 172 }
173 173 #endif
174 174
175 175 #endif /* _SYS_FSS_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX