Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/uma_int.h
Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | struct uma_keg { | ||||
const char *uk_name; /* Name of creating zone. */ | const char *uk_name; /* Name of creating zone. */ | ||||
LIST_ENTRY(uma_keg) uk_link; /* List of all kegs */ | LIST_ENTRY(uma_keg) uk_link; /* List of all kegs */ | ||||
/* Must be last, variable sized. */ | /* Must be last, variable sized. */ | ||||
struct uma_domain uk_domain[]; /* Keg's slab lists. */ | struct uma_domain uk_domain[]; /* Keg's slab lists. */ | ||||
}; | }; | ||||
typedef struct uma_keg * uma_keg_t; | typedef struct uma_keg * uma_keg_t; | ||||
#ifdef _KERNEL | |||||
/* | /* | ||||
* Free bits per-slab. | * Free bits per-slab. | ||||
*/ | */ | ||||
#define SLAB_MAX_SETSIZE (PAGE_SIZE / UMA_SMALLEST_UNIT) | #define SLAB_MAX_SETSIZE (PAGE_SIZE / UMA_SMALLEST_UNIT) | ||||
#define SLAB_MIN_SETSIZE _BITSET_BITS | #define SLAB_MIN_SETSIZE _BITSET_BITS | ||||
BITSET_DEFINE(slabbits, SLAB_MAX_SETSIZE); | BITSET_DEFINE(slabbits, SLAB_MAX_SETSIZE); | ||||
BITSET_DEFINE(noslabbits, 0); | BITSET_DEFINE(noslabbits, 0); | ||||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
static inline int | static inline int | ||||
slab_item_index(uma_slab_t slab, uma_keg_t keg, void *item) | slab_item_index(uma_slab_t slab, uma_keg_t keg, void *item) | ||||
{ | { | ||||
uintptr_t data; | uintptr_t data; | ||||
data = (uintptr_t)slab_data(slab, keg); | data = (uintptr_t)slab_data(slab, keg); | ||||
return (((uintptr_t)item - data) / keg->uk_rsize); | return (((uintptr_t)item - data) / keg->uk_rsize); | ||||
} | } | ||||
#endif /* _KERNEL */ | |||||
TAILQ_HEAD(uma_bucketlist, uma_bucket); | TAILQ_HEAD(uma_bucketlist, uma_bucket); | ||||
struct uma_zone_domain { | struct uma_zone_domain { | ||||
struct uma_bucketlist uzd_buckets; /* full buckets */ | struct uma_bucketlist uzd_buckets; /* full buckets */ | ||||
long uzd_nitems; /* total item count */ | long uzd_nitems; /* total item count */ | ||||
long uzd_imax; /* maximum item count this period */ | long uzd_imax; /* maximum item count this period */ | ||||
long uzd_imin; /* minimum item count this period */ | long uzd_imin; /* minimum item count this period */ | ||||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |