summaryrefslogtreecommitdiffstats
path: root/sys/vm/uma_int.h
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-09-19 06:26:45 +0000
committerjeff <jeff@FreeBSD.org>2003-09-19 06:26:45 +0000
commitb8696d32c35433fa31e94d7981e55d921d362f36 (patch)
tree959b898cffd6289100d88f14df3b9529896e58ed /sys/vm/uma_int.h
parent757174bbed77fe17ef6e55e0404b18f4dee68f85 (diff)
downloadFreeBSD-src-b8696d32c35433fa31e94d7981e55d921d362f36.zip
FreeBSD-src-b8696d32c35433fa31e94d7981e55d921d362f36.tar.gz
- Initialize a pool of bucket zones so that we waste less space on zones that
don't cache as many items. - Introduce the bucket_alloc(), bucket_free() functions to wrap bucket allocation. These functions select the appropriate bucket zone to allocate from or free to. - Rename ub_ptr to ub_cnt to reflect a change in its use. ub_cnt now reflects the count of free items in the bucket. This gets rid of many unnatural subtractions by 1 throughout the code. - Add ub_entries which reflects the number of entries possibly held in a bucket.
Diffstat (limited to 'sys/vm/uma_int.h')
-rw-r--r--sys/vm/uma_int.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/vm/uma_int.h b/sys/vm/uma_int.h
index 3554f0f..f7550a7 100644
--- a/sys/vm/uma_int.h
+++ b/sys/vm/uma_int.h
@@ -173,18 +173,11 @@ struct uma_hash {
* Structures for per cpu queues.
*/
-/*
- * This size was chosen so that the struct bucket size is roughly
- * 128 * sizeof(void *). This is exactly true for x86, and for alpha
- * it will would be 32bits smaller if it didn't have alignment adjustments.
- */
-
-#define UMA_BUCKET_SIZE 125
-
struct uma_bucket {
LIST_ENTRY(uma_bucket) ub_link; /* Link into the zone */
- int16_t ub_ptr; /* Pointer to current item */
- void *ub_bucket[UMA_BUCKET_SIZE]; /* actual allocation storage */
+ int16_t ub_cnt; /* Count of free items. */
+ int16_t ub_entries; /* Max items. */
+ void *ub_bucket[]; /* actual allocation storage */
};
typedef struct uma_bucket * uma_bucket_t;
OpenPOWER on IntegriCloud