Print this page
8115 parallel zfs mount
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/vm/seg_kmem.h
+++ new/usr/src/uts/common/vm/seg_kmem.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 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 * Copyright 2016 Joyent, Inc.
25 + * Copyright 2017 RackTop Systems.
25 26 */
26 27
27 28 #ifndef _VM_SEG_KMEM_H
28 29 #define _VM_SEG_KMEM_H
29 30
30 31
31 32 #ifdef __cplusplus
32 33 extern "C" {
33 34 #endif
34 35
35 36 #include <sys/types.h>
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
36 37 #include <sys/vnode.h>
37 38 #include <sys/vmem.h>
38 39 #include <vm/as.h>
39 40 #include <vm/seg.h>
40 41 #include <vm/page.h>
41 42
42 43 /*
43 44 * VM - Kernel Segment Driver
44 45 */
45 46
46 -#if defined(_KERNEL)
47 +#if defined(_KERNEL) || defined(_FAKE_KERNEL)
47 48
48 49 extern char *kernelheap; /* start of primary kernel heap */
49 50 extern char *ekernelheap; /* end of primary kernel heap */
50 51 extern char *heap_lp_base; /* start of kernel large page heap arena */
51 52 extern char *heap_lp_end; /* end of kernel large page heap arena */
52 53 extern struct seg kvseg; /* primary kernel heap segment */
53 54 extern struct seg kvseg_core; /* "core" kernel heap segment */
54 55 extern struct seg kzioseg; /* Segment for zio mappings */
55 56 extern vmem_t *heap_lp_arena; /* kernel large page heap arena */
56 57 extern vmem_t *heap_arena; /* primary kernel heap arena */
57 58 extern vmem_t *hat_memload_arena; /* HAT translation arena */
58 59 extern struct seg kvseg32; /* 32-bit kernel heap segment */
59 60 extern vmem_t *heap32_arena; /* 32-bit kernel heap arena */
60 61 extern vmem_t *heaptext_arena; /* kernel text arena, from heap */
61 62 extern struct as kas; /* kernel address space */
62 63 extern int segkmem_reloc; /* enable/disable segkmem relocatable pages */
63 64 extern vmem_t *static_arena; /* arena for caches to import static memory */
64 65 extern vmem_t *static_alloc_arena; /* arena for allocating static memory */
65 66 extern vmem_t *zio_arena; /* arena for zio caches */
66 67 extern vmem_t *zio_alloc_arena; /* arena for zio caches */
67 68 extern struct vnode kvps[];
68 69 /*
69 70 * segkmem page vnodes
70 71 */
71 72 #define kvp (kvps[KV_KVP])
72 73 #define zvp (kvps[KV_ZVP])
73 74 #if defined(__sparc)
74 75 #define mpvp (kvps[KV_MPVP])
75 76 #define promvp (kvps[KV_PROMVP])
76 77 #endif /* __sparc */
77 78
78 79 extern int segkmem_create(struct seg *);
79 80 extern page_t *segkmem_page_create(void *, size_t, int, void *);
80 81 extern void *segkmem_xalloc(vmem_t *, void *, size_t, int, uint_t,
81 82 page_t *(*page_create_func)(void *, size_t, int, void *), void *);
82 83 extern void *segkmem_alloc(vmem_t *, size_t, int);
83 84 extern void *segkmem_alloc_permanent(vmem_t *, size_t, int);
84 85 extern void segkmem_free(vmem_t *, void *, size_t);
85 86 extern void segkmem_xfree(vmem_t *, void *, size_t, void (*)(page_t *));
86 87
87 88 extern void *boot_alloc(void *, size_t, uint_t);
88 89 extern void boot_mapin(caddr_t addr, size_t size);
89 90 extern void kernelheap_init(void *, void *, char *, void *, void *);
90 91 extern void segkmem_gc(void);
91 92
92 93 extern void *segkmem_zio_alloc(vmem_t *, size_t, int);
93 94 extern int segkmem_zio_create(struct seg *);
94 95 extern void segkmem_zio_free(vmem_t *, void *, size_t);
95 96 extern void segkmem_zio_init(void *, size_t);
96 97
97 98 /*
98 99 * Flags for segkmem_xalloc().
99 100 *
100 101 * SEGKMEM_SHARELOCKED requests pages which are locked SE_SHARED to be
101 102 * returned rather than unlocked which is now the default. Note that
102 103 * memory returned by SEGKMEM_SHARELOCKED cannot be freed by segkmem_free().
103 104 * This is a hack for seg_dev that should be cleaned up in the future.
104 105 */
105 106 #define SEGKMEM_SHARELOCKED 0x20000
106 107
107 108 /*
108 109 * Large page for kmem caches support
109 110 */
110 111 typedef struct segkmem_lpcb {
111 112 kmutex_t lp_lock;
112 113 kcondvar_t lp_cv;
113 114 uint_t lp_wait;
114 115 uint_t lp_uselp;
115 116 ulong_t lp_throttle;
116 117
117 118 /* stats */
118 119 uint64_t sleep_allocs_failed;
119 120 uint64_t nosleep_allocs_failed;
120 121 uint64_t allocs_throttled;
121 122 uint64_t allocs_limited;
122 123 uint64_t alloc_bytes_failed;
123 124 } segkmem_lpcb_t;
124 125
125 126 extern void *segkmem_alloc_lp(vmem_t *, size_t *, size_t, int);
126 127 extern void segkmem_free_lp(vmem_t *, void *, size_t);
127 128 extern int segkmem_lpsetup();
128 129 extern void segkmem_heap_lp_init(void);
129 130
130 131 extern size_t segkmem_lpsize;
131 132 extern int segkmem_lpszc;
↓ open down ↓ |
75 lines elided |
↑ open up ↑ |
132 133 extern size_t segkmem_heaplp_quantum;
133 134 extern size_t segkmem_kmemlp_max;
134 135
135 136 #define SEGKMEM_USE_LARGEPAGES (segkmem_lpsize > PAGESIZE)
136 137
137 138 #define IS_KMEM_VA_LARGEPAGE(vaddr) \
138 139 (((vaddr) >= heap_lp_base) && ((vaddr) < heap_lp_end))
139 140
140 141 extern struct seg_ops segkmem_ops;
141 142
142 -#endif /* _KERNEL */
143 +#endif /* _KERNEL || _FAKE_KERNEL */
143 144
144 145 #ifdef __cplusplus
145 146 }
146 147 #endif
147 148
148 149 #endif /* _VM_SEG_KMEM_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX