Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/uma_int.h
Show First 20 Lines • Show All 297 Lines • ▼ Show 20 Lines | |||||
struct uma_klink { | struct uma_klink { | ||||
LIST_ENTRY(uma_klink) kl_link; | LIST_ENTRY(uma_klink) kl_link; | ||||
uma_keg_t kl_keg; | uma_keg_t kl_keg; | ||||
}; | }; | ||||
typedef struct uma_klink *uma_klink_t; | typedef struct uma_klink *uma_klink_t; | ||||
struct uma_zone_domain { | struct uma_zone_domain { | ||||
LIST_HEAD(,uma_bucket) uzd_buckets; /* full buckets */ | LIST_HEAD(,uma_bucket) uzd_buckets; /* full buckets */ | ||||
long uzd_nitems; /* total item count */ | |||||
long uzd_imax; /* maximum item count this period */ | |||||
long uzd_imin; /* minimum item count this period */ | |||||
long uzd_wss; /* working set size estimate */ | |||||
}; | }; | ||||
typedef struct uma_zone_domain * uma_zone_domain_t; | typedef struct uma_zone_domain * uma_zone_domain_t; | ||||
/* | /* | ||||
* Zone management structure | * Zone management structure | ||||
* | * | ||||
* TODO: Optimize for cache line size | * TODO: Optimize for cache line size | ||||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | #define ZONE_LOCK_INIT(z, lc) \ | ||||
do { \ | do { \ | ||||
if ((lc)) \ | if ((lc)) \ | ||||
mtx_init(&(z)->uz_lock, (z)->uz_name, \ | mtx_init(&(z)->uz_lock, (z)->uz_name, \ | ||||
(z)->uz_name, MTX_DEF | MTX_DUPOK); \ | (z)->uz_name, MTX_DEF | MTX_DUPOK); \ | ||||
else \ | else \ | ||||
mtx_init(&(z)->uz_lock, (z)->uz_name, \ | mtx_init(&(z)->uz_lock, (z)->uz_name, \ | ||||
"UMA zone", MTX_DEF | MTX_DUPOK); \ | "UMA zone", MTX_DEF | MTX_DUPOK); \ | ||||
} while (0) | } while (0) | ||||
#define ZONE_LOCK(z) mtx_lock((z)->uz_lockptr) | #define ZONE_LOCK(z) mtx_lock((z)->uz_lockptr) | ||||
#define ZONE_TRYLOCK(z) mtx_trylock((z)->uz_lockptr) | #define ZONE_TRYLOCK(z) mtx_trylock((z)->uz_lockptr) | ||||
#define ZONE_UNLOCK(z) mtx_unlock((z)->uz_lockptr) | #define ZONE_UNLOCK(z) mtx_unlock((z)->uz_lockptr) | ||||
#define ZONE_LOCK_FINI(z) mtx_destroy(&(z)->uz_lock) | #define ZONE_LOCK_FINI(z) mtx_destroy(&(z)->uz_lock) | ||||
#define ZONE_LOCK_ASSERT(z) mtx_assert((z)->uz_lockptr, MA_OWNED) | |||||
/* | /* | ||||
* Find a slab within a hash table. This is used for OFFPAGE zones to lookup | * Find a slab within a hash table. This is used for OFFPAGE zones to lookup | ||||
* the slab structure. | * the slab structure. | ||||
* | * | ||||
* Arguments: | * Arguments: | ||||
* hash The hash table to search. | * hash The hash table to search. | ||||
* data The base page of the item. | * data The base page of the item. | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |