Deleted Added
full compact
1/*
2 * Copyright (c) 2002, Jeffrey Roberson <jroberson@chesapeake.net>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/vm/uma_int.h 99072 2002-06-29 17:26:22Z julian $
27 *
28 */
29
30/*
31 *
32 * Jeff Roberson <jroberson@chesapeake.net>
33 *
34 * This file includes definitions, structures, prototypes, and inlines that

--- 63 unchanged lines hidden (view full) ---

98 * |slab header| |
99 * |___________|---*
100 *
101 */
102
103#ifndef VM_UMA_INT_H
104#define VM_UMA_INT_H
105
106#include <sys/mutex.h>
107
108#define UMA_SLAB_SIZE PAGE_SIZE /* How big are our slabs? */
109#define UMA_SLAB_MASK (PAGE_SIZE - 1) /* Mask to get back to the page */
110#define UMA_SLAB_SHIFT PAGE_SHIFT /* Number of bits PAGE_MASK */
111
112#define UMA_BOOT_PAGES 30 /* Number of pages allocated for startup */
113#define UMA_WORKING_TIME 20 /* Seconds worth of items to keep */
114
115

--- 54 unchanged lines hidden (view full) ---

170SLIST_HEAD(slabhead, uma_slab);
171
172struct uma_hash {
173 struct slabhead *uh_slab_hash; /* Hash table for slabs */
174 int uh_hashsize; /* Current size of the hash table */
175 int uh_hashmask; /* Mask used during hashing */
176};
177
178extern struct uma_hash *mallochash;
179
180/*
181 * Structures for per cpu queues.
182 */
183
184/*
185 * This size was chosen so that the struct bucket size is roughly
186 * 128 * sizeof(void *). This is exactly true for x86, and for alpha
187 * it will would be 32bits smaller if it didn't have alignment adjustments.

--- 81 unchanged lines hidden (view full) ---

269
270#define UMA_ZFLAG_OFFPAGE 0x0001 /* Struct slab/freelist off page */
271#define UMA_ZFLAG_PRIVALLOC 0x0002 /* Zone has supplied it's own alloc */
272#define UMA_ZFLAG_INTERNAL 0x0004 /* Internal zone, no offpage no PCPU */
273#define UMA_ZFLAG_MALLOC 0x0008 /* Zone created by malloc */
274#define UMA_ZFLAG_NOFREE 0x0010 /* Don't free data from this zone */
275#define UMA_ZFLAG_FULL 0x0020 /* This zone reached uz_maxpages */
276#define UMA_ZFLAG_BUCKETCACHE 0x0040 /* Only allocate buckets from cache */
277
278/* This lives in uflags */
279#define UMA_ZONE_INTERNAL 0x1000 /* Internal zone for uflags */
280
281/* Internal prototypes */
282static __inline uma_slab_t hash_sfind(struct uma_hash *hash, u_int8_t *data);
283void *uma_large_malloc(int size, int wait);
284void uma_large_free(uma_slab_t slab);

--- 56 unchanged lines hidden (view full) ---

341
342 SLIST_FOREACH(slab, &hash->uh_slab_hash[hval], us_hlink) {
343 if ((u_int8_t *)slab->us_data == data)
344 return (slab);
345 }
346 return (NULL);
347}
348
349
350#endif /* VM_UMA_INT_H */