Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/uma_int.h
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | |||||
struct uma_hash { | struct uma_hash { | ||||
struct slabhashhead *uh_slab_hash; /* Hash table for slabs */ | struct slabhashhead *uh_slab_hash; /* Hash table for slabs */ | ||||
u_int uh_hashsize; /* Current size of the hash table */ | u_int uh_hashsize; /* Current size of the hash table */ | ||||
u_int uh_hashmask; /* Mask used during hashing */ | u_int uh_hashmask; /* Mask used during hashing */ | ||||
}; | }; | ||||
/* | /* | ||||
* align field or structure to cache line | * Align field or structure to cache 'sector' in intel terminology. This | ||||
* is more efficient with adjacent line prefetch. | |||||
*/ | */ | ||||
#if defined(__amd64__) || defined(__powerpc64__) | #if defined(__amd64__) || defined(__powerpc64__) | ||||
#define UMA_ALIGN __aligned(128) | #define UMA_SUPER_ALIGN (CACHE_LINE_SIZE * 2) | ||||
#else | #else | ||||
#define UMA_ALIGN __aligned(CACHE_LINE_SIZE) | #define UMA_SUPER_ALIGN CACHE_LINE_SIZE | ||||
#endif | #endif | ||||
#define UMA_ALIGN __aligned(UMA_SUPER_ALIGN) | |||||
/* | /* | ||||
* 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 */ | ||||
▲ Show 20 Lines • Show All 343 Lines • ▼ Show 20 Lines | |||||
#define UZ_ITEMS_COUNT(x) ((x) & UZ_ITEMS_COUNT_MASK) | #define UZ_ITEMS_COUNT(x) ((x) & UZ_ITEMS_COUNT_MASK) | ||||
#define UZ_ITEMS_SLEEPERS(x) ((x) >> UZ_ITEMS_SLEEPER_SHIFT) | #define UZ_ITEMS_SLEEPERS(x) ((x) >> UZ_ITEMS_SLEEPER_SHIFT) | ||||
#define UZ_ITEMS_SLEEPER (1LL << UZ_ITEMS_SLEEPER_SHIFT) | #define UZ_ITEMS_SLEEPER (1LL << UZ_ITEMS_SLEEPER_SHIFT) | ||||
#define ZONE_ASSERT_COLD(z) \ | #define ZONE_ASSERT_COLD(z) \ | ||||
KASSERT(uma_zone_get_allocs((z)) == 0, \ | KASSERT(uma_zone_get_allocs((z)) == 0, \ | ||||
("zone %s initialization after use.", (z)->uz_name)) | ("zone %s initialization after use.", (z)->uz_name)) | ||||
#undef UMA_ALIGN | #undef UMA_ALIGN | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* Internal prototypes */ | /* Internal prototypes */ | ||||
static __inline uma_slab_t hash_sfind(struct uma_hash *hash, uint8_t *data); | static __inline uma_slab_t hash_sfind(struct uma_hash *hash, uint8_t *data); | ||||
/* Lock Macros */ | /* Lock Macros */ | ||||
#define KEG_LOCKPTR(k, d) (struct mtx *)&(k)->uk_domain[(d)].ud_lock | #define KEG_LOCKPTR(k, d) (struct mtx *)&(k)->uk_domain[(d)].ud_lock | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |