Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/uma.h
Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | #define UMA_ZONE_VM 0x0080 /* | ||||
* Used for internal vm datastructures | * Used for internal vm datastructures | ||||
* only. | * only. | ||||
*/ | */ | ||||
#define UMA_ZONE_HASH 0x0100 /* | #define UMA_ZONE_HASH 0x0100 /* | ||||
* Use a hash table instead of caching | * Use a hash table instead of caching | ||||
* information in the vm_page. | * information in the vm_page. | ||||
*/ | */ | ||||
#define UMA_ZONE_SECONDARY 0x0200 /* Zone is a Secondary Zone */ | #define UMA_ZONE_SECONDARY 0x0200 /* Zone is a Secondary Zone */ | ||||
#define UMA_ZONE_REFCNT 0x0400 /* Allocate refcnts in slabs */ | /* 0x0400 Unused */ | ||||
#define UMA_ZONE_MAXBUCKET 0x0800 /* Use largest buckets */ | #define UMA_ZONE_MAXBUCKET 0x0800 /* Use largest buckets */ | ||||
#define UMA_ZONE_CACHESPREAD 0x1000 /* | #define UMA_ZONE_CACHESPREAD 0x1000 /* | ||||
* Spread memory start locations across | * Spread memory start locations across | ||||
* all possible cache lines. May | * all possible cache lines. May | ||||
* require many virtually contiguous | * require many virtually contiguous | ||||
* backend pages and can fail early. | * backend pages and can fail early. | ||||
*/ | */ | ||||
#define UMA_ZONE_VTOSLAB 0x2000 /* Zone uses vtoslab for lookup. */ | #define UMA_ZONE_VTOSLAB 0x2000 /* Zone uses vtoslab for lookup. */ | ||||
#define UMA_ZONE_NODUMP 0x4000 /* | #define UMA_ZONE_NODUMP 0x4000 /* | ||||
* Zone's pages will not be included in | * Zone's pages will not be included in | ||||
* mini-dumps. | * mini-dumps. | ||||
*/ | */ | ||||
#define UMA_ZONE_PCPU 0x8000 /* | #define UMA_ZONE_PCPU 0x8000 /* | ||||
* Allocates mp_ncpus slabs sized to | * Allocates mp_ncpus slabs sized to | ||||
* sizeof(struct pcpu). | * sizeof(struct pcpu). | ||||
*/ | */ | ||||
/* | /* | ||||
* These flags are shared between the keg and zone. In zones wishing to add | * These flags are shared between the keg and zone. In zones wishing to add | ||||
* new kegs these flags must be compatible. Some are determined based on | * new kegs these flags must be compatible. Some are determined based on | ||||
* physical parameters of the request and may not be provided by the consumer. | * physical parameters of the request and may not be provided by the consumer. | ||||
*/ | */ | ||||
#define UMA_ZONE_INHERIT \ | #define UMA_ZONE_INHERIT \ | ||||
(UMA_ZONE_OFFPAGE | UMA_ZONE_MALLOC | UMA_ZONE_NOFREE | \ | (UMA_ZONE_OFFPAGE | UMA_ZONE_MALLOC | UMA_ZONE_NOFREE | \ | ||||
UMA_ZONE_HASH | UMA_ZONE_REFCNT | UMA_ZONE_VTOSLAB | UMA_ZONE_PCPU) | UMA_ZONE_HASH | UMA_ZONE_VTOSLAB | UMA_ZONE_PCPU) | ||||
/* Definitions for align */ | /* Definitions for align */ | ||||
#define UMA_ALIGN_PTR (sizeof(void *) - 1) /* Alignment fit for ptr */ | #define UMA_ALIGN_PTR (sizeof(void *) - 1) /* Alignment fit for ptr */ | ||||
#define UMA_ALIGN_LONG (sizeof(long) - 1) /* "" long */ | #define UMA_ALIGN_LONG (sizeof(long) - 1) /* "" long */ | ||||
#define UMA_ALIGN_INT (sizeof(int) - 1) /* "" int */ | #define UMA_ALIGN_INT (sizeof(int) - 1) /* "" int */ | ||||
#define UMA_ALIGN_SHORT (sizeof(short) - 1) /* "" short */ | #define UMA_ALIGN_SHORT (sizeof(short) - 1) /* "" short */ | ||||
#define UMA_ALIGN_CHAR (sizeof(char) - 1) /* "" char */ | #define UMA_ALIGN_CHAR (sizeof(char) - 1) /* "" char */ | ||||
#define UMA_ALIGN_CACHE (0 - 1) /* Cache line size align */ | #define UMA_ALIGN_CACHE (0 - 1) /* Cache line size align */ | ||||
▲ Show 20 Lines • Show All 317 Lines • ▼ Show 20 Lines | |||||
* itemcnt The number of items to reserve | * itemcnt The number of items to reserve | ||||
* | * | ||||
* Returns: | * Returns: | ||||
* Nothing | * Nothing | ||||
* | * | ||||
* NOTE: This is blocking and should only be done at startup | * NOTE: This is blocking and should only be done at startup | ||||
*/ | */ | ||||
void uma_prealloc(uma_zone_t zone, int itemcnt); | void uma_prealloc(uma_zone_t zone, int itemcnt); | ||||
/* | |||||
* Used to lookup the reference counter allocated for an item | |||||
* from a UMA_ZONE_REFCNT zone. For UMA_ZONE_REFCNT zones, | |||||
* reference counters are allocated for items and stored in | |||||
* the underlying slab header. | |||||
* | |||||
* Arguments: | |||||
* zone The UMA_ZONE_REFCNT zone to which the item belongs. | |||||
* item The address of the item for which we want a refcnt. | |||||
* | |||||
* Returns: | |||||
* A pointer to a uint32_t reference counter. | |||||
*/ | |||||
uint32_t *uma_find_refcnt(uma_zone_t zone, void *item); | |||||
/* | /* | ||||
* Used to determine if a fixed-size zone is exhausted. | * Used to determine if a fixed-size zone is exhausted. | ||||
* | * | ||||
* Arguments: | * Arguments: | ||||
* zone The zone to check | * zone The zone to check | ||||
* | * | ||||
* Returns: | * Returns: | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |