Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/uma_int.h
Show First 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | struct uma_cache { | ||||
uint64_t uc_frees; /* Count of frees */ | uint64_t uc_frees; /* Count of frees */ | ||||
} UMA_ALIGN; | } UMA_ALIGN; | ||||
typedef struct uma_cache * uma_cache_t; | typedef struct uma_cache * uma_cache_t; | ||||
LIST_HEAD(slabhead, uma_slab); | LIST_HEAD(slabhead, uma_slab); | ||||
/* | /* | ||||
* The cache structure pads perfectly into 64 bytes so we use spare | |||||
* bits from the embedded cache buckets to store information from the zone | |||||
* and keep all fast-path allocations accessing a single per-cpu line. | |||||
*/ | |||||
static inline void | |||||
cache_set_uz_flags(uma_cache_t cache, uint32_t flags) | |||||
{ | |||||
cache->uc_freebucket.ucb_spare = flags; | |||||
} | |||||
static inline void | |||||
cache_set_uz_size(uma_cache_t cache, uint32_t size) | |||||
{ | |||||
cache->uc_allocbucket.ucb_spare = size; | |||||
} | |||||
static inline uint32_t | |||||
cache_uz_flags(uma_cache_t cache) | |||||
{ | |||||
return (cache->uc_freebucket.ucb_spare); | |||||
} | |||||
static inline uint32_t | |||||
cache_uz_size(uma_cache_t cache) | |||||
{ | |||||
return (cache->uc_allocbucket.ucb_spare); | |||||
} | |||||
/* | |||||
* Per-domain slab lists. Embedded in the kegs. | * Per-domain slab lists. Embedded in the kegs. | ||||
*/ | */ | ||||
struct uma_domain { | struct uma_domain { | ||||
struct slabhead ud_part_slab; /* partially allocated slabs */ | struct slabhead ud_part_slab; /* partially allocated slabs */ | ||||
struct slabhead ud_free_slab; /* completely unallocated slabs */ | struct slabhead ud_free_slab; /* completely unallocated slabs */ | ||||
struct slabhead ud_full_slab; /* fully allocated slabs */ | struct slabhead ud_full_slab; /* fully allocated slabs */ | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | struct uma_zone { | ||||
struct uma_cache uz_cpu[]; /* Per cpu caches */ | struct uma_cache uz_cpu[]; /* Per cpu caches */ | ||||
/* uz_domain follows here. */ | /* uz_domain follows here. */ | ||||
}; | }; | ||||
/* | /* | ||||
* These flags must not overlap with the UMA_ZONE flags specified in uma.h. | * These flags must not overlap with the UMA_ZONE flags specified in uma.h. | ||||
*/ | */ | ||||
#define UMA_ZFLAG_CTORDTOR 0x01000000 /* Zone has ctor/dtor set. */ | |||||
#define UMA_ZFLAG_LIMIT 0x02000000 /* Zone has limit set. */ | |||||
#define UMA_ZFLAG_CACHE 0x04000000 /* uma_zcache_create()d it */ | #define UMA_ZFLAG_CACHE 0x04000000 /* uma_zcache_create()d it */ | ||||
#define UMA_ZFLAG_RECLAIMING 0x08000000 /* Running zone_reclaim(). */ | #define UMA_ZFLAG_RECLAIMING 0x08000000 /* Running zone_reclaim(). */ | ||||
#define UMA_ZFLAG_BUCKET 0x10000000 /* Bucket zone. */ | #define UMA_ZFLAG_BUCKET 0x10000000 /* Bucket zone. */ | ||||
#define UMA_ZFLAG_INTERNAL 0x20000000 /* No offpage no PCPU. */ | #define UMA_ZFLAG_INTERNAL 0x20000000 /* No offpage no PCPU. */ | ||||
#define UMA_ZFLAG_TRASH 0x40000000 /* Add trash ctor/dtor. */ | #define UMA_ZFLAG_TRASH 0x40000000 /* Add trash ctor/dtor. */ | ||||
#define UMA_ZFLAG_CACHEONLY 0x80000000 /* Don't ask VM for buckets. */ | #define UMA_ZFLAG_CACHEONLY 0x80000000 /* Don't ask VM for buckets. */ | ||||
#define UMA_ZFLAG_INHERIT \ | #define UMA_ZFLAG_INHERIT \ | ||||
(UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY | UMA_ZFLAG_BUCKET) | (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY | UMA_ZFLAG_BUCKET) | ||||
#define PRINT_UMA_ZFLAGS "\20" \ | #define PRINT_UMA_ZFLAGS "\20" \ | ||||
"\40CACHEONLY" \ | "\40CACHEONLY" \ | ||||
"\37TRASH" \ | "\37TRASH" \ | ||||
"\36INTERNAL" \ | "\36INTERNAL" \ | ||||
"\35BUCKET" \ | "\35BUCKET" \ | ||||
"\34RECLAIMING" \ | "\34RECLAIMING" \ | ||||
"\33CACHE" \ | "\33CACHE" \ | ||||
"\32LIMIT" \ | |||||
"\31CTORDTOR" \ | |||||
"\22MINBUCKET" \ | "\22MINBUCKET" \ | ||||
"\21NUMA" \ | "\21NUMA" \ | ||||
"\20PCPU" \ | "\20PCPU" \ | ||||
"\17NODUMP" \ | "\17NODUMP" \ | ||||
"\16VTOSLAB" \ | "\16VTOSLAB" \ | ||||
"\15CACHESPREAD" \ | "\15CACHESPREAD" \ | ||||
"\14MAXBUCKET" \ | "\14MAXBUCKET" \ | ||||
"\13NOBUCKET" \ | "\13NOBUCKET" \ | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |