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