Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/uma_int.h
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | #define PRINT_UMA_ZFLAGS "\20" \ | ||||
"\13NOBUCKET" \ | "\13NOBUCKET" \ | ||||
"\12SECONDARY" \ | "\12SECONDARY" \ | ||||
"\11NOTPAGE" \ | "\11NOTPAGE" \ | ||||
"\10VM" \ | "\10VM" \ | ||||
"\7MTXCLASS" \ | "\7MTXCLASS" \ | ||||
"\6NOFREE" \ | "\6NOFREE" \ | ||||
"\5MALLOC" \ | "\5MALLOC" \ | ||||
"\4NOTOUCH" \ | "\4NOTOUCH" \ | ||||
"\2ZINIT" | "\2ZINIT" | ||||
markj: This needs to be updated with the new SMR flag. | |||||
/* | /* | ||||
* Hash table for freed address -> slab translation. | * Hash table for freed address -> slab translation. | ||||
* | * | ||||
* Only zones with memory not touchable by the allocator use the | * Only zones with memory not touchable by the allocator use the | ||||
* hash table. Otherwise slabs are found with vtoslab(). | * hash table. Otherwise slabs are found with vtoslab(). | ||||
*/ | */ | ||||
#define UMA_HASH_SIZE_INIT 32 | #define UMA_HASH_SIZE_INIT 32 | ||||
Show All 29 Lines | |||||
/* | /* | ||||
* The uma_bucket structure is used to queue and manage buckets divorced | * The uma_bucket structure is used to queue and manage buckets divorced | ||||
* from per-cpu caches. They are loaded into uma_cache_bucket structures | * from per-cpu caches. They are loaded into uma_cache_bucket structures | ||||
* for use. | * for use. | ||||
*/ | */ | ||||
struct uma_bucket { | struct uma_bucket { | ||||
TAILQ_ENTRY(uma_bucket) ub_link; /* Link into the zone */ | TAILQ_ENTRY(uma_bucket) ub_link; /* Link into the zone */ | ||||
int16_t ub_cnt; /* Count of items in bucket. */ | int16_t ub_cnt; /* Count of items in bucket. */ | ||||
int16_t ub_entries; /* Max items. */ | int16_t ub_entries; /* Max items. */ | ||||
uint32_t ub_seq; /* SMR sequence number. */ | |||||
void *ub_bucket[]; /* actual allocation storage */ | void *ub_bucket[]; /* actual allocation storage */ | ||||
}; | }; | ||||
typedef struct uma_bucket * uma_bucket_t; | typedef struct uma_bucket * uma_bucket_t; | ||||
/* | /* | ||||
* The uma_cache_bucket structure is statically allocated on each per-cpu | * The uma_cache_bucket structure is statically allocated on each per-cpu | ||||
* cache. Its use reduces branches and cache misses in the fast path. | * cache. Its use reduces branches and cache misses in the fast path. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | |||||
struct uma_zone { | struct uma_zone { | ||||
/* Offset 0, used in alloc/free fast/medium fast path and const. */ | /* Offset 0, used in alloc/free fast/medium fast path and const. */ | ||||
uma_keg_t uz_keg; /* This zone's keg if !CACHE */ | uma_keg_t uz_keg; /* This zone's keg if !CACHE */ | ||||
struct uma_zone_domain *uz_domain; /* per-domain buckets */ | struct uma_zone_domain *uz_domain; /* per-domain buckets */ | ||||
uint32_t uz_flags; /* Flags inherited from kegs */ | uint32_t uz_flags; /* Flags inherited from kegs */ | ||||
uint32_t uz_size; /* Size inherited from kegs */ | uint32_t uz_size; /* Size inherited from kegs */ | ||||
uma_ctor uz_ctor; /* Constructor for each allocation */ | uma_ctor uz_ctor; /* Constructor for each allocation */ | ||||
uma_dtor uz_dtor; /* Destructor */ | uma_dtor uz_dtor; /* Destructor */ | ||||
uint64_t uz_spare0; | struct smr *uz_smr; /* Safe memory reclaim context. */ | ||||
uint64_t uz_max_items; /* Maximum number of items to alloc */ | uint64_t uz_max_items; /* Maximum number of items to alloc */ | ||||
uint32_t uz_sleepers; /* Threads sleeping on limit */ | uint32_t uz_sleepers; /* Threads sleeping on limit */ | ||||
uint16_t uz_bucket_size; /* Number of items in full bucket */ | uint16_t uz_bucket_size; /* Number of items in full bucket */ | ||||
uint16_t uz_bucket_size_max; /* Maximum number of bucket items */ | uint16_t uz_bucket_size_max; /* Maximum number of bucket items */ | ||||
/* Offset 64, used in bucket replenish. */ | /* Offset 64, used in bucket replenish. */ | ||||
uma_import uz_import; /* Import new memory to cache. */ | uma_import uz_import; /* Import new memory to cache. */ | ||||
uma_release uz_release; /* Release memory from cache. */ | uma_release uz_release; /* Release memory from cache. */ | ||||
Show All 28 Lines | struct uma_zone { | ||||
uint64_t uz_sleeps; /* Total number of alloc sleeps */ | uint64_t uz_sleeps; /* Total number of alloc sleeps */ | ||||
uint64_t uz_xdomain; /* Total number of cross-domain frees */ | uint64_t uz_xdomain; /* Total number of cross-domain frees */ | ||||
volatile uint64_t uz_items; /* Total items count & sleepers */ | volatile uint64_t uz_items; /* Total items count & sleepers */ | ||||
char *uz_ctlname; /* sysctl safe name string. */ | char *uz_ctlname; /* sysctl safe name string. */ | ||||
struct sysctl_oid *uz_oid; /* sysctl oid pointer. */ | struct sysctl_oid *uz_oid; /* sysctl oid pointer. */ | ||||
int uz_namecnt; /* duplicate name count. */ | int uz_namecnt; /* duplicate name count. */ | ||||
/* | /* | ||||
Done Inline ActionsThis should moved to consume one of the spare pointers in the read-only section. jeff: This should moved to consume one of the spare pointers in the read-only section. | |||||
* This HAS to be the last item because we adjust the zone size | * This HAS to be the last item because we adjust the zone size | ||||
* based on NCPU and then allocate the space for the zones. | * based on NCPU and then allocate the space for the zones. | ||||
*/ | */ | ||||
struct uma_cache uz_cpu[]; /* Per cpu caches */ | struct uma_cache uz_cpu[]; /* Per cpu caches */ | ||||
/* uz_domain follows here. */ | /* uz_domain follows here. */ | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |
This needs to be updated with the new SMR flag.