Print this page
11528 Makefile.noget can get gone
11529 Use -Wno-maybe-initialized
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/i86pc/vm/vm_dep.h
+++ new/usr/src/uts/i86pc/vm/vm_dep.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 *
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
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
20 20 */
21 21 /*
22 22 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
23 + * Copyright 2019 Joyent, Inc.
23 24 */
24 25 /*
25 26 * Copyright (c) 2010, Intel Corporation.
26 27 * All rights reserved.
27 28 */
28 29
29 30 /*
30 31 * UNIX machine dependent virtual memory support.
31 32 */
32 33
33 34 #ifndef _VM_DEP_H
34 35 #define _VM_DEP_H
35 36
36 37
37 38 #ifdef __cplusplus
38 39 extern "C" {
39 40 #endif
40 41
41 42 #include <sys/clock.h>
42 43 #include <vm/hat_pte.h>
43 44 #include <sys/param.h>
44 45 #include <sys/memnode.h>
45 46
46 47 /*
47 48 * WARNING: vm_dep.h is included by files in common.
48 49 */
49 50
50 51 #define GETTICK() tsc_read()
51 52 /*
52 53 * Do not use this function for obtaining clock tick. This
53 54 * is called by callers who do not need to have a guarenteed
54 55 * correct tick value. The proper routine to use is tsc_read().
55 56 */
56 57
57 58 extern u_longlong_t randtick();
58 59 extern uint_t page_create_update_flags_x86(uint_t);
59 60
60 61 extern size_t plcnt_sz(size_t);
61 62 #define PLCNT_SZ(ctrs_sz) (ctrs_sz = plcnt_sz(ctrs_sz))
62 63
63 64 extern caddr_t plcnt_init(caddr_t);
64 65 #define PLCNT_INIT(addr) (addr = plcnt_init(addr))
65 66
66 67 extern void plcnt_inc_dec(page_t *, int, int, long, int);
67 68 #define PLCNT_INCR(pp, mnode, mtype, szc, flags) \
68 69 plcnt_inc_dec(pp, mtype, szc, 1l << PAGE_BSZS_SHIFT(szc), flags)
69 70 #define PLCNT_DECR(pp, mnode, mtype, szc, flags) \
70 71 plcnt_inc_dec(pp, mtype, szc, \
71 72 (long)(ULONG_MAX << PAGE_BSZS_SHIFT(szc)), flags)
72 73
73 74 /*
74 75 * macro to update page list max counts. no-op on x86.
75 76 */
76 77 #define PLCNT_XFER_NORELOC(pp)
77 78
78 79 /*
79 80 * macro to modify the page list max counts when memory is added to
80 81 * the page lists during startup (add_physmem) or during a DR operation
81 82 * when memory is added (kphysm_add_memory_dynamic) or deleted
82 83 * (kphysm_del_cleanup).
83 84 */
84 85 #define PLCNT_MODIFY_MAX(pfn, cnt) mtype_modify_max(pfn, cnt)
85 86
86 87 extern int memrange_num(pfn_t);
87 88 extern int pfn_2_mtype(pfn_t);
88 89 extern int mtype_func(int, int, uint_t);
89 90 extern void mtype_modify_max(pfn_t, long);
90 91 extern int mnode_pgcnt(int);
91 92 extern int mnode_range_cnt(int);
92 93
93 94 /*
94 95 * candidate counters in vm_pagelist.c are indexed by color and range
95 96 */
96 97 #define NUM_MEM_RANGES 4 /* memory range types */
97 98 #define MAX_MNODE_MRANGES NUM_MEM_RANGES
98 99 #define MNODE_RANGE_CNT(mnode) mnode_range_cnt(mnode)
99 100 #define MNODE_MAX_MRANGE(mnode) memrange_num(mem_node_config[mnode].physbase)
100 101
101 102 /*
102 103 * This was really badly defined, it implicitly uses mnode_maxmrange[]
103 104 * which is a static in vm_pagelist.c
104 105 */
105 106 extern int mtype_2_mrange(int);
106 107 #define MTYPE_2_MRANGE(mnode, mtype) \
107 108 (mnode_maxmrange[mnode] - mtype_2_mrange(mtype))
108 109
109 110 /*
110 111 * Per page size free lists. Allocated dynamically.
111 112 * dimensions [mtype][mmu_page_sizes][colors]
112 113 *
113 114 * mtype specifies a physical memory range with a unique mnode.
114 115 */
115 116
116 117 extern page_t ****page_freelists;
117 118
118 119 #define PAGE_FREELISTS(mnode, szc, color, mtype) \
119 120 (*(page_freelists[mtype][szc] + (color)))
120 121
121 122 /*
122 123 * For now there is only a single size cache list. Allocated dynamically.
123 124 * dimensions [mtype][colors]
124 125 *
125 126 * mtype specifies a physical memory range with a unique mnode.
126 127 */
127 128 extern page_t ***page_cachelists;
128 129
129 130 #define PAGE_CACHELISTS(mnode, color, mtype) \
130 131 (*(page_cachelists[mtype] + (color)))
131 132
132 133 /*
133 134 * There are mutexes for both the page freelist
134 135 * and the page cachelist. We want enough locks to make contention
135 136 * reasonable, but not too many -- otherwise page_freelist_lock() gets
136 137 * so expensive that it becomes the bottleneck!
137 138 */
138 139
139 140 #define NPC_MUTEX 16
140 141
141 142 extern kmutex_t *fpc_mutex[NPC_MUTEX];
142 143 extern kmutex_t *cpc_mutex[NPC_MUTEX];
143 144
144 145 extern page_t *page_get_mnode_freelist(int, uint_t, int, uchar_t, uint_t);
145 146 extern page_t *page_get_mnode_cachelist(uint_t, uint_t, int, int);
146 147
147 148 /* mem node iterator is not used on x86 */
148 149 #define MEM_NODE_ITERATOR_DECL(it)
149 150 #define MEM_NODE_ITERATOR_INIT(pfn, mnode, szc, it)
150 151
151 152 /*
152 153 * interleaved_mnodes mode is never set on x86, therefore,
153 154 * simply return the limits of the given mnode, which then
154 155 * determines the length of hpm_counters array for the mnode.
155 156 */
156 157 #define HPM_COUNTERS_LIMITS(mnode, physbase, physmax, first) \
157 158 { \
158 159 (physbase) = mem_node_config[(mnode)].physbase; \
159 160 (physmax) = mem_node_config[(mnode)].physmax; \
160 161 (first) = (mnode); \
161 162 }
162 163
163 164 #define PAGE_CTRS_WRITE_LOCK(mnode) \
164 165 { \
165 166 rw_enter(&page_ctrs_rwlock[(mnode)], RW_WRITER);\
166 167 page_freelist_lock(mnode); \
167 168 }
168 169
169 170 #define PAGE_CTRS_WRITE_UNLOCK(mnode) \
170 171 { \
171 172 page_freelist_unlock(mnode); \
172 173 rw_exit(&page_ctrs_rwlock[(mnode)]); \
173 174 }
174 175
175 176 /*
176 177 * macro to call page_ctrs_adjust() when memory is added
177 178 * during a DR operation.
178 179 */
179 180 #define PAGE_CTRS_ADJUST(pfn, cnt, rv) { \
180 181 spgcnt_t _cnt = (spgcnt_t)(cnt); \
181 182 int _mn; \
182 183 pgcnt_t _np; \
183 184 pfn_t _pfn = (pfn); \
184 185 pfn_t _endpfn = _pfn + _cnt; \
185 186 while (_pfn < _endpfn) { \
186 187 _mn = PFN_2_MEM_NODE(_pfn); \
187 188 _np = MIN(_endpfn, mem_node_config[_mn].physmax + 1) - _pfn; \
188 189 _pfn += _np; \
189 190 if ((rv = page_ctrs_adjust(_mn)) != 0) \
190 191 break; \
191 192 } \
192 193 }
193 194
194 195 #define PAGE_GET_COLOR_SHIFT(szc, nszc) \
195 196 (hw_page_array[(nszc)].hp_shift - hw_page_array[(szc)].hp_shift)
196 197
197 198 #define PAGE_CONVERT_COLOR(ncolor, szc, nszc) \
198 199 ((ncolor) << PAGE_GET_COLOR_SHIFT((szc), (nszc)))
199 200
200 201 #define PFN_2_COLOR(pfn, szc, it) \
201 202 (((pfn) & page_colors_mask) >> \
202 203 (hw_page_array[szc].hp_shift - hw_page_array[0].hp_shift))
203 204
204 205 #define PNUM_SIZE(szc) \
205 206 (hw_page_array[(szc)].hp_pgcnt)
206 207 #define PNUM_SHIFT(szc) \
207 208 (hw_page_array[(szc)].hp_shift - hw_page_array[0].hp_shift)
208 209 #define PAGE_GET_SHIFT(szc) \
209 210 (hw_page_array[(szc)].hp_shift)
210 211 #define PAGE_GET_PAGECOLORS(szc) \
211 212 (hw_page_array[(szc)].hp_colors)
212 213
213 214 /*
214 215 * This macro calculates the next sequential pfn with the specified
215 216 * color using color equivalency mask
216 217 */
217 218 #define PAGE_NEXT_PFN_FOR_COLOR(pfn, szc, color, ceq_mask, color_mask, it) \
218 219 { \
219 220 uint_t pfn_shift = PAGE_BSZS_SHIFT(szc); \
220 221 pfn_t spfn = pfn >> pfn_shift; \
221 222 pfn_t stride = (ceq_mask) + 1; \
222 223 ASSERT(((color) & ~(ceq_mask)) == 0); \
223 224 ASSERT((((ceq_mask) + 1) & (ceq_mask)) == 0); \
224 225 if (((spfn ^ (color)) & (ceq_mask)) == 0) { \
225 226 pfn += stride << pfn_shift; \
226 227 } else { \
227 228 pfn = (spfn & ~(pfn_t)(ceq_mask)) | (color); \
228 229 pfn = (pfn > spfn ? pfn : pfn + stride) << pfn_shift; \
229 230 } \
230 231 }
231 232
232 233 /* get the color equivalency mask for the next szc */
233 234 #define PAGE_GET_NSZ_MASK(szc, mask) \
234 235 ((mask) >> (PAGE_GET_SHIFT((szc) + 1) - PAGE_GET_SHIFT(szc)))
235 236
236 237 /* get the color of the next szc */
237 238 #define PAGE_GET_NSZ_COLOR(szc, color) \
238 239 ((color) >> (PAGE_GET_SHIFT((szc) + 1) - PAGE_GET_SHIFT(szc)))
239 240
240 241 /* Find the bin for the given page if it was of size szc */
241 242 #define PP_2_BIN_SZC(pp, szc) (PFN_2_COLOR(pp->p_pagenum, szc, NULL))
242 243
243 244 #define PP_2_BIN(pp) (PP_2_BIN_SZC(pp, pp->p_szc))
244 245
245 246 #define PP_2_MEM_NODE(pp) (PFN_2_MEM_NODE(pp->p_pagenum))
246 247 #define PP_2_MTYPE(pp) (pfn_2_mtype(pp->p_pagenum))
247 248 #define PP_2_SZC(pp) (pp->p_szc)
248 249
249 250 #define SZCPAGES(szc) (1 << PAGE_BSZS_SHIFT(szc))
250 251 #define PFN_BASE(pfnum, szc) (pfnum & ~(SZCPAGES(szc) - 1))
251 252
252 253 /*
253 254 * this structure is used for walking free page lists
254 255 * controls when to split large pages into smaller pages,
255 256 * and when to coalesce smaller pages into larger pages
256 257 */
257 258 typedef struct page_list_walker {
258 259 uint_t plw_colors; /* num of colors for szc */
259 260 uint_t plw_color_mask; /* colors-1 */
260 261 uint_t plw_bin_step; /* next bin: 1 or 2 */
261 262 uint_t plw_count; /* loop count */
262 263 uint_t plw_bin0; /* starting bin */
263 264 uint_t plw_bin_marker; /* bin after initial jump */
264 265 uint_t plw_bin_split_prev; /* last bin we tried to split */
265 266 uint_t plw_do_split; /* set if OK to split */
266 267 uint_t plw_split_next; /* next bin to split */
267 268 uint_t plw_ceq_dif; /* number of different color groups */
268 269 /* to check */
269 270 uint_t plw_ceq_mask[MMU_PAGE_SIZES + 1]; /* color equiv mask */
270 271 uint_t plw_bins[MMU_PAGE_SIZES + 1]; /* num of bins */
271 272 } page_list_walker_t;
272 273
273 274 void page_list_walk_init(uchar_t szc, uint_t flags, uint_t bin,
274 275 int can_split, int use_ceq, page_list_walker_t *plw);
275 276
276 277 uint_t page_list_walk_next_bin(uchar_t szc, uint_t bin,
277 278 page_list_walker_t *plw);
278 279
279 280 extern struct cpu cpus[];
280 281 #define CPU0 cpus
281 282
282 283 extern int mtype_init(vnode_t *, caddr_t, uint_t *, size_t);
283 284 #define MTYPE_INIT(mtype, vp, vaddr, flags, pgsz) \
284 285 (mtype = mtype_init(vp, vaddr, &(flags), pgsz))
285 286
286 287 /*
287 288 * macros to loop through the mtype range (page_get_mnode_{free,cache,any}list,
288 289 * and page_get_contig_pages)
289 290 *
290 291 * MTYPE_START sets the initial mtype. -1 if the mtype range specified does
291 292 * not contain mnode.
292 293 *
293 294 * MTYPE_NEXT sets the next mtype. -1 if there are no more valid
294 295 * mtype in the range.
295 296 */
296 297
297 298 #define MTYPE_START(mnode, mtype, flags) \
↓ open down ↓ |
265 lines elided |
↑ open up ↑ |
298 299 (mtype = mtype_func(mnode, mtype, flags))
299 300
300 301 #define MTYPE_NEXT(mnode, mtype, flags) { \
301 302 if (flags & PGI_MT_RANGE) { \
302 303 mtype = mtype_func(mnode, mtype, flags | PGI_MT_NEXT); \
303 304 } else { \
304 305 mtype = -1; \
305 306 } \
306 307 }
307 308
308 -extern int mtype_pgr_init(int *, page_t *, int, pgcnt_t);
309 -#define MTYPE_PGR_INIT(mtype, flags, pp, mnode, pgcnt) \
310 - (mtype = mtype_pgr_init(&flags, pp, mnode, pgcnt))
309 +extern int mtype_pgr_init(int *, page_t *, pgcnt_t);
310 +#define MTYPE_PGR_INIT(mtype, flags, pp, pgcnt) \
311 + (mtype = mtype_pgr_init(&flags, pp, pgcnt))
311 312
312 313 #define MNODE_PGCNT(mnode) mnode_pgcnt(mnode)
313 314
314 315 extern void mnodetype_2_pfn(int, int, pfn_t *, pfn_t *);
315 316 #define MNODETYPE_2_PFN(mnode, mtype, pfnlo, pfnhi) \
316 317 mnodetype_2_pfn(mnode, mtype, &pfnlo, &pfnhi)
317 318
318 319 #define PC_BIN_MUTEX(mnode, bin, flags) ((flags & PG_FREE_LIST) ? \
319 320 &fpc_mutex[(bin) & (NPC_MUTEX - 1)][mnode] : \
320 321 &cpc_mutex[(bin) & (NPC_MUTEX - 1)][mnode])
321 322
322 323 #define FPC_MUTEX(mnode, i) (&fpc_mutex[i][mnode])
323 324 #define CPC_MUTEX(mnode, i) (&cpc_mutex[i][mnode])
324 325
325 326 #ifdef DEBUG
326 327 #define CHK_LPG(pp, szc) chk_lpg(pp, szc)
327 328 extern void chk_lpg(page_t *, uchar_t);
328 329 #else
329 330 #define CHK_LPG(pp, szc)
330 331 #endif
331 332
332 333 #define FULL_REGION_CNT(rg_szc) \
333 334 (LEVEL_SIZE(rg_szc) >> LEVEL_SHIFT(rg_szc - 1))
334 335
335 336 /* Return the leader for this mapping size */
336 337 #define PP_GROUPLEADER(pp, szc) \
337 338 (&(pp)[-(int)((pp)->p_pagenum & (SZCPAGES(szc)-1))])
338 339
339 340 /* Return the root page for this page based on p_szc */
340 341 #define PP_PAGEROOT(pp) ((pp)->p_szc == 0 ? (pp) : \
341 342 PP_GROUPLEADER((pp), (pp)->p_szc))
342 343
343 344 /*
344 345 * The counter base must be per page_counter element to prevent
345 346 * races when re-indexing, and the base page size element should
346 347 * be aligned on a boundary of the given region size.
347 348 *
348 349 * We also round up the number of pages spanned by the counters
349 350 * for a given region to PC_BASE_ALIGN in certain situations to simplify
350 351 * the coding for some non-performance critical routines.
351 352 */
352 353
353 354 #define PC_BASE_ALIGN ((pfn_t)1 << PAGE_BSZS_SHIFT(MMU_PAGE_SIZES-1))
354 355 #define PC_BASE_ALIGN_MASK (PC_BASE_ALIGN - 1)
355 356
356 357 /*
357 358 * cpu/mmu-dependent vm variables
358 359 */
359 360 extern uint_t mmu_page_sizes;
360 361 extern uint_t mmu_exported_page_sizes;
361 362 /*
362 363 * page sizes that legacy applications can see via getpagesizes(3c).
363 364 * Used to prevent legacy applications from inadvertantly using the
364 365 * 'new' large pagesizes (1g and above).
365 366 */
366 367 extern uint_t mmu_legacy_page_sizes;
367 368
368 369 /* For x86, userszc is the same as the kernel's szc */
369 370 #define USERSZC_2_SZC(userszc) (userszc)
370 371 #define SZC_2_USERSZC(szc) (szc)
371 372
372 373 /*
373 374 * for hw_page_map_t, sized to hold the ratio of large page to base
374 375 * pagesize (1024 max)
375 376 */
376 377 typedef short hpmctr_t;
377 378
378 379 /*
379 380 * get the setsize of the current cpu - assume homogenous for x86
380 381 */
381 382 extern int l2cache_sz, l2cache_linesz, l2cache_assoc;
382 383
383 384 #define L2CACHE_ALIGN l2cache_linesz
384 385 #define L2CACHE_ALIGN_MAX 64
385 386 #define CPUSETSIZE() \
386 387 (l2cache_assoc ? (l2cache_sz / l2cache_assoc) : MMU_PAGESIZE)
387 388
388 389 /*
389 390 * Return the log2(pagesize(szc) / MMU_PAGESIZE) --- or the shift count
390 391 * for the number of base pages in this pagesize
391 392 */
392 393 #define PAGE_BSZS_SHIFT(szc) (LEVEL_SHIFT(szc) - MMU_PAGESHIFT)
393 394
394 395 /*
395 396 * Internal PG_ flags.
396 397 */
397 398 #define PGI_RELOCONLY 0x010000 /* opposite of PG_NORELOC */
398 399 #define PGI_NOCAGE 0x020000 /* cage is disabled */
399 400 #define PGI_PGCPHIPRI 0x040000 /* page_get_contig_page pri alloc */
400 401 #define PGI_PGCPSZC0 0x080000 /* relocate base pagesize page */
401 402
402 403 /*
403 404 * PGI range flags - should not overlap PGI flags
404 405 */
405 406 #define PGI_MT_RANGE0 0x1000000 /* mtype range to 0 */
406 407 #define PGI_MT_RANGE16M 0x2000000 /* mtype range to 16m */
407 408 #define PGI_MT_RANGE4G 0x4000000 /* mtype range to 4g */
408 409 #define PGI_MT_NEXT 0x8000000 /* get next mtype */
409 410 #define PGI_MT_RANGE (PGI_MT_RANGE0 | PGI_MT_RANGE16M | PGI_MT_RANGE4G)
410 411
411 412
412 413 /*
413 414 * Maximum and default values for user heap, stack, private and shared
414 415 * anonymous memory, and user text and initialized data.
415 416 * Used by map_pgsz*() routines.
416 417 */
417 418 extern size_t max_uheap_lpsize;
418 419 extern size_t default_uheap_lpsize;
419 420 extern size_t max_ustack_lpsize;
420 421 extern size_t default_ustack_lpsize;
421 422 extern size_t max_privmap_lpsize;
422 423 extern size_t max_uidata_lpsize;
423 424 extern size_t max_utext_lpsize;
424 425 extern size_t max_shm_lpsize;
425 426 extern size_t mcntl0_lpsize;
426 427
427 428 /*
428 429 * Sanity control. Don't use large pages regardless of user
429 430 * settings if there's less than priv or shm_lpg_min_physmem memory installed.
430 431 * The units for this variable are 8K pages.
431 432 */
432 433 extern pgcnt_t privm_lpg_min_physmem;
433 434 extern pgcnt_t shm_lpg_min_physmem;
434 435
435 436 /*
436 437 * hash as and addr to get a bin.
437 438 */
438 439
439 440 #define AS_2_BIN(as, seg, vp, addr, bin, szc) \
440 441 bin = (((((uintptr_t)(addr) >> PAGESHIFT) + ((uintptr_t)(as) >> 4)) \
441 442 & page_colors_mask) >> \
442 443 (hw_page_array[szc].hp_shift - hw_page_array[0].hp_shift))
443 444
444 445 /*
445 446 * cpu private vm data - accessed thru CPU->cpu_vm_data
446 447 * vc_pnum_memseg: tracks last memseg visited in page_numtopp_nolock()
447 448 * vc_pnext_memseg: tracks last memseg visited in page_nextn()
448 449 * vc_kmptr: orignal unaligned kmem pointer for this vm_cpu_data_t
449 450 * vc_kmsize: orignal kmem size for this vm_cpu_data_t
450 451 */
451 452
452 453 typedef struct {
453 454 struct memseg *vc_pnum_memseg;
454 455 struct memseg *vc_pnext_memseg;
455 456 void *vc_kmptr;
456 457 size_t vc_kmsize;
457 458 } vm_cpu_data_t;
458 459
459 460 /* allocation size to ensure vm_cpu_data_t resides in its own cache line */
460 461 #define VM_CPU_DATA_PADSIZE \
461 462 (P2ROUNDUP(sizeof (vm_cpu_data_t), L2CACHE_ALIGN_MAX))
462 463
463 464 /*
464 465 * When a bin is empty, and we can't satisfy a color request correctly,
465 466 * we scan. If we assume that the programs have reasonable spatial
466 467 * behavior, then it will not be a good idea to use the adjacent color.
467 468 * Using the adjacent color would result in virtually adjacent addresses
468 469 * mapping into the same spot in the cache. So, if we stumble across
469 470 * an empty bin, skip a bunch before looking. After the first skip,
470 471 * then just look one bin at a time so we don't miss our cache on
471 472 * every look. Be sure to check every bin. Page_create() will panic
472 473 * if we miss a page.
473 474 *
474 475 * This also explains the `<=' in the for loops in both page_get_freelist()
475 476 * and page_get_cachelist(). Since we checked the target bin, skipped
476 477 * a bunch, then continued one a time, we wind up checking the target bin
477 478 * twice to make sure we get all of them bins.
478 479 */
479 480 #define BIN_STEP 19
480 481
481 482 #ifdef VM_STATS
482 483 struct vmm_vmstats_str {
483 484 ulong_t pgf_alloc[MMU_PAGE_SIZES]; /* page_get_freelist */
484 485 ulong_t pgf_allocok[MMU_PAGE_SIZES];
485 486 ulong_t pgf_allocokrem[MMU_PAGE_SIZES];
486 487 ulong_t pgf_allocfailed[MMU_PAGE_SIZES];
487 488 ulong_t pgf_allocdeferred;
488 489 ulong_t pgf_allocretry[MMU_PAGE_SIZES];
489 490 ulong_t pgc_alloc; /* page_get_cachelist */
490 491 ulong_t pgc_allocok;
491 492 ulong_t pgc_allocokrem;
492 493 ulong_t pgc_allocokdeferred;
493 494 ulong_t pgc_allocfailed;
494 495 ulong_t pgcp_alloc[MMU_PAGE_SIZES]; /* page_get_contig_pages */
495 496 ulong_t pgcp_allocfailed[MMU_PAGE_SIZES];
496 497 ulong_t pgcp_allocempty[MMU_PAGE_SIZES];
497 498 ulong_t pgcp_allocok[MMU_PAGE_SIZES];
498 499 ulong_t ptcp[MMU_PAGE_SIZES]; /* page_trylock_contig_pages */
499 500 ulong_t ptcpfreethresh[MMU_PAGE_SIZES];
500 501 ulong_t ptcpfailexcl[MMU_PAGE_SIZES];
501 502 ulong_t ptcpfailszc[MMU_PAGE_SIZES];
502 503 ulong_t ptcpfailcage[MMU_PAGE_SIZES];
503 504 ulong_t ptcpok[MMU_PAGE_SIZES];
504 505 ulong_t pgmf_alloc[MMU_PAGE_SIZES]; /* page_get_mnode_freelist */
505 506 ulong_t pgmf_allocfailed[MMU_PAGE_SIZES];
506 507 ulong_t pgmf_allocempty[MMU_PAGE_SIZES];
507 508 ulong_t pgmf_allocok[MMU_PAGE_SIZES];
508 509 ulong_t pgmc_alloc; /* page_get_mnode_cachelist */
509 510 ulong_t pgmc_allocfailed;
510 511 ulong_t pgmc_allocempty;
511 512 ulong_t pgmc_allocok;
512 513 ulong_t pladd_free[MMU_PAGE_SIZES]; /* page_list_add/sub */
513 514 ulong_t plsub_free[MMU_PAGE_SIZES];
514 515 ulong_t pladd_cache;
515 516 ulong_t plsub_cache;
516 517 ulong_t plsubpages_szcbig;
517 518 ulong_t plsubpages_szc0;
518 519 ulong_t pfs_req[MMU_PAGE_SIZES]; /* page_freelist_split */
519 520 ulong_t pfs_demote[MMU_PAGE_SIZES];
520 521 ulong_t pfc_coalok[MMU_PAGE_SIZES][MAX_MNODE_MRANGES];
521 522 ulong_t ppr_reloc[MMU_PAGE_SIZES]; /* page_relocate */
522 523 ulong_t ppr_relocnoroot[MMU_PAGE_SIZES];
523 524 ulong_t ppr_reloc_replnoroot[MMU_PAGE_SIZES];
524 525 ulong_t ppr_relocnolock[MMU_PAGE_SIZES];
525 526 ulong_t ppr_relocnomem[MMU_PAGE_SIZES];
526 527 ulong_t ppr_relocok[MMU_PAGE_SIZES];
527 528 ulong_t ppr_copyfail;
528 529 /* page coalesce counter */
529 530 ulong_t page_ctrs_coalesce[MMU_PAGE_SIZES][MAX_MNODE_MRANGES];
530 531 /* candidates useful */
531 532 ulong_t page_ctrs_cands_skip[MMU_PAGE_SIZES][MAX_MNODE_MRANGES];
532 533 /* ctrs changed after locking */
533 534 ulong_t page_ctrs_changed[MMU_PAGE_SIZES][MAX_MNODE_MRANGES];
534 535 /* page_freelist_coalesce failed */
535 536 ulong_t page_ctrs_failed[MMU_PAGE_SIZES][MAX_MNODE_MRANGES];
536 537 ulong_t page_ctrs_coalesce_all; /* page coalesce all counter */
537 538 ulong_t page_ctrs_cands_skip_all; /* candidates useful for all func */
538 539 ulong_t restrict4gcnt;
539 540 ulong_t unrestrict16mcnt; /* non-DMA 16m allocs allowed */
540 541 ulong_t pgpanicalloc; /* PG_PANIC allocation */
541 542 ulong_t pcf_deny[MMU_PAGE_SIZES]; /* page_chk_freelist */
542 543 ulong_t pcf_allow[MMU_PAGE_SIZES];
543 544 };
544 545 extern struct vmm_vmstats_str vmm_vmstats;
545 546 #endif /* VM_STATS */
546 547
547 548 extern size_t page_ctrs_sz(void);
548 549 extern caddr_t page_ctrs_alloc(caddr_t);
549 550 extern void page_ctr_sub(int, int, page_t *, int);
550 551 extern page_t *page_freelist_split(uchar_t,
551 552 uint_t, int, int, pfn_t, pfn_t, page_list_walker_t *);
552 553 extern page_t *page_freelist_coalesce(int, uchar_t, uint_t, uint_t, int,
553 554 pfn_t);
554 555 extern void page_freelist_coalesce_all(int);
555 556 extern uint_t page_get_pagecolors(uint_t);
556 557 extern void pfnzero(pfn_t, uint_t, uint_t);
557 558
558 559 #ifdef __cplusplus
559 560 }
560 561 #endif
561 562
562 563 #endif /* _VM_DEP_H */
↓ open down ↓ |
242 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX