Lines Matching refs:extent
12 extent_lock(tsdn_t *tsdn, extent_t *extent) { in extent_lock() argument
13 assert(extent != NULL); in extent_lock()
14 mutex_pool_lock(tsdn, &extent_mutex_pool, (uintptr_t)extent); in extent_lock()
18 extent_unlock(tsdn_t *tsdn, extent_t *extent) { in extent_unlock() argument
19 assert(extent != NULL); in extent_unlock()
20 mutex_pool_unlock(tsdn, &extent_mutex_pool, (uintptr_t)extent); in extent_unlock()
38 extent_arena_get(const extent_t *extent) { in extent_arena_get() argument
39 unsigned arena_ind = (unsigned)((extent->e_bits & in extent_arena_get()
53 extent_szind_get_maybe_invalid(const extent_t *extent) { in extent_szind_get_maybe_invalid() argument
54 szind_t szind = (szind_t)((extent->e_bits & EXTENT_BITS_SZIND_MASK) >> in extent_szind_get_maybe_invalid()
61 extent_szind_get(const extent_t *extent) { in extent_szind_get() argument
62 szind_t szind = extent_szind_get_maybe_invalid(extent); in extent_szind_get()
68 extent_usize_get(const extent_t *extent) { in extent_usize_get() argument
69 return sz_index2size(extent_szind_get(extent)); in extent_usize_get()
73 extent_sn_get(const extent_t *extent) { in extent_sn_get() argument
74 return (size_t)((extent->e_bits & EXTENT_BITS_SN_MASK) >> in extent_sn_get()
79 extent_state_get(const extent_t *extent) { in extent_state_get() argument
80 return (extent_state_t)((extent->e_bits & EXTENT_BITS_STATE_MASK) >> in extent_state_get()
85 extent_zeroed_get(const extent_t *extent) { in extent_zeroed_get() argument
86 return (bool)((extent->e_bits & EXTENT_BITS_ZEROED_MASK) >> in extent_zeroed_get()
91 extent_committed_get(const extent_t *extent) { in extent_committed_get() argument
92 return (bool)((extent->e_bits & EXTENT_BITS_COMMITTED_MASK) >> in extent_committed_get()
97 extent_dumpable_get(const extent_t *extent) { in extent_dumpable_get() argument
98 return (bool)((extent->e_bits & EXTENT_BITS_DUMPABLE_MASK) >> in extent_dumpable_get()
103 extent_slab_get(const extent_t *extent) { in extent_slab_get() argument
104 return (bool)((extent->e_bits & EXTENT_BITS_SLAB_MASK) >> in extent_slab_get()
109 extent_nfree_get(const extent_t *extent) { in extent_nfree_get() argument
110 assert(extent_slab_get(extent)); in extent_nfree_get()
111 return (unsigned)((extent->e_bits & EXTENT_BITS_NFREE_MASK) >> in extent_nfree_get()
116 extent_base_get(const extent_t *extent) { in extent_base_get() argument
117 assert(extent->e_addr == PAGE_ADDR2BASE(extent->e_addr) || in extent_base_get()
118 !extent_slab_get(extent)); in extent_base_get()
119 return PAGE_ADDR2BASE(extent->e_addr); in extent_base_get()
123 extent_addr_get(const extent_t *extent) { in extent_addr_get() argument
124 assert(extent->e_addr == PAGE_ADDR2BASE(extent->e_addr) || in extent_addr_get()
125 !extent_slab_get(extent)); in extent_addr_get()
126 return extent->e_addr; in extent_addr_get()
130 extent_size_get(const extent_t *extent) { in extent_size_get() argument
131 return (extent->e_size_esn & EXTENT_SIZE_MASK); in extent_size_get()
135 extent_esn_get(const extent_t *extent) { in extent_esn_get() argument
136 return (extent->e_size_esn & EXTENT_ESN_MASK); in extent_esn_get()
140 extent_bsize_get(const extent_t *extent) { in extent_bsize_get() argument
141 return extent->e_bsize; in extent_bsize_get()
145 extent_before_get(const extent_t *extent) { in extent_before_get() argument
146 return (void *)((uintptr_t)extent_base_get(extent) - PAGE); in extent_before_get()
150 extent_last_get(const extent_t *extent) { in extent_last_get() argument
151 return (void *)((uintptr_t)extent_base_get(extent) + in extent_last_get()
152 extent_size_get(extent) - PAGE); in extent_last_get()
156 extent_past_get(const extent_t *extent) { in extent_past_get() argument
157 return (void *)((uintptr_t)extent_base_get(extent) + in extent_past_get()
158 extent_size_get(extent)); in extent_past_get()
162 extent_slab_data_get(extent_t *extent) { in extent_slab_data_get() argument
163 assert(extent_slab_get(extent)); in extent_slab_data_get()
164 return &extent->e_slab_data; in extent_slab_data_get()
168 extent_slab_data_get_const(const extent_t *extent) { in extent_slab_data_get_const() argument
169 assert(extent_slab_get(extent)); in extent_slab_data_get_const()
170 return &extent->e_slab_data; in extent_slab_data_get_const()
174 extent_prof_tctx_get(const extent_t *extent) { in extent_prof_tctx_get() argument
175 return (prof_tctx_t *)atomic_load_p(&extent->e_prof_tctx, in extent_prof_tctx_get()
180 extent_arena_set(extent_t *extent, arena_t *arena) { in extent_arena_set() argument
183 extent->e_bits = (extent->e_bits & ~EXTENT_BITS_ARENA_MASK) | in extent_arena_set()
188 extent_addr_set(extent_t *extent, void *addr) { in extent_addr_set() argument
189 extent->e_addr = addr; in extent_addr_set()
193 extent_addr_randomize(UNUSED tsdn_t *tsdn, extent_t *extent, size_t alignment) { in extent_addr_randomize() argument
194 assert(extent_base_get(extent) == extent_addr_get(extent)); in extent_addr_randomize()
206 &extent_arena_get(extent)->offset_state, in extent_addr_randomize()
211 extent->e_addr = (void *)((uintptr_t)extent->e_addr + in extent_addr_randomize()
213 assert(ALIGNMENT_ADDR2BASE(extent->e_addr, alignment) == in extent_addr_randomize()
214 extent->e_addr); in extent_addr_randomize()
219 extent_size_set(extent_t *extent, size_t size) { in extent_size_set() argument
221 extent->e_size_esn = size | (extent->e_size_esn & ~EXTENT_SIZE_MASK); in extent_size_set()
225 extent_esn_set(extent_t *extent, size_t esn) { in extent_esn_set() argument
226 extent->e_size_esn = (extent->e_size_esn & ~EXTENT_ESN_MASK) | (esn & in extent_esn_set()
231 extent_bsize_set(extent_t *extent, size_t bsize) { in extent_bsize_set() argument
232 extent->e_bsize = bsize; in extent_bsize_set()
236 extent_szind_set(extent_t *extent, szind_t szind) { in extent_szind_set() argument
238 extent->e_bits = (extent->e_bits & ~EXTENT_BITS_SZIND_MASK) | in extent_szind_set()
243 extent_nfree_set(extent_t *extent, unsigned nfree) { in extent_nfree_set() argument
244 assert(extent_slab_get(extent)); in extent_nfree_set()
245 extent->e_bits = (extent->e_bits & ~EXTENT_BITS_NFREE_MASK) | in extent_nfree_set()
250 extent_nfree_inc(extent_t *extent) { in extent_nfree_inc() argument
251 assert(extent_slab_get(extent)); in extent_nfree_inc()
252 extent->e_bits += ((uint64_t)1U << EXTENT_BITS_NFREE_SHIFT); in extent_nfree_inc()
256 extent_nfree_dec(extent_t *extent) { in extent_nfree_dec() argument
257 assert(extent_slab_get(extent)); in extent_nfree_dec()
258 extent->e_bits -= ((uint64_t)1U << EXTENT_BITS_NFREE_SHIFT); in extent_nfree_dec()
262 extent_sn_set(extent_t *extent, size_t sn) { in extent_sn_set() argument
263 extent->e_bits = (extent->e_bits & ~EXTENT_BITS_SN_MASK) | in extent_sn_set()
268 extent_state_set(extent_t *extent, extent_state_t state) { in extent_state_set() argument
269 extent->e_bits = (extent->e_bits & ~EXTENT_BITS_STATE_MASK) | in extent_state_set()
274 extent_zeroed_set(extent_t *extent, bool zeroed) { in extent_zeroed_set() argument
275 extent->e_bits = (extent->e_bits & ~EXTENT_BITS_ZEROED_MASK) | in extent_zeroed_set()
280 extent_committed_set(extent_t *extent, bool committed) { in extent_committed_set() argument
281 extent->e_bits = (extent->e_bits & ~EXTENT_BITS_COMMITTED_MASK) | in extent_committed_set()
286 extent_dumpable_set(extent_t *extent, bool dumpable) { in extent_dumpable_set() argument
287 extent->e_bits = (extent->e_bits & ~EXTENT_BITS_DUMPABLE_MASK) | in extent_dumpable_set()
292 extent_slab_set(extent_t *extent, bool slab) { in extent_slab_set() argument
293 extent->e_bits = (extent->e_bits & ~EXTENT_BITS_SLAB_MASK) | in extent_slab_set()
298 extent_prof_tctx_set(extent_t *extent, prof_tctx_t *tctx) { in extent_prof_tctx_set() argument
299 atomic_store_p(&extent->e_prof_tctx, tctx, ATOMIC_RELEASE); in extent_prof_tctx_set()
303 extent_init(extent_t *extent, arena_t *arena, void *addr, size_t size, in extent_init() argument
308 extent_arena_set(extent, arena); in extent_init()
309 extent_addr_set(extent, addr); in extent_init()
310 extent_size_set(extent, size); in extent_init()
311 extent_slab_set(extent, slab); in extent_init()
312 extent_szind_set(extent, szind); in extent_init()
313 extent_sn_set(extent, sn); in extent_init()
314 extent_state_set(extent, state); in extent_init()
315 extent_zeroed_set(extent, zeroed); in extent_init()
316 extent_committed_set(extent, committed); in extent_init()
317 extent_dumpable_set(extent, dumpable); in extent_init()
318 ql_elm_new(extent, ql_link); in extent_init()
320 extent_prof_tctx_set(extent, NULL); in extent_init()
325 extent_binit(extent_t *extent, void *addr, size_t bsize, size_t sn) { in extent_binit() argument
326 extent_arena_set(extent, NULL); in extent_binit()
327 extent_addr_set(extent, addr); in extent_binit()
328 extent_bsize_set(extent, bsize); in extent_binit()
329 extent_slab_set(extent, false); in extent_binit()
330 extent_szind_set(extent, NSIZES); in extent_binit()
331 extent_sn_set(extent, sn); in extent_binit()
332 extent_state_set(extent, extent_state_active); in extent_binit()
333 extent_zeroed_set(extent, true); in extent_binit()
334 extent_committed_set(extent, true); in extent_binit()
335 extent_dumpable_set(extent, true); in extent_binit()
354 extent_list_append(extent_list_t *list, extent_t *extent) { in extent_list_append() argument
355 ql_tail_insert(list, extent, ql_link); in extent_list_append()
359 extent_list_prepend(extent_list_t *list, extent_t *extent) { in extent_list_prepend() argument
360 ql_head_insert(list, extent, ql_link); in extent_list_prepend()
371 extent_list_remove(extent_list_t *list, extent_t *extent) { in extent_list_remove() argument
372 ql_remove(list, extent, ql_link); in extent_list_remove()