summaryrefslogtreecommitdiffstats
path: root/sys/vm/uma_int.h
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-04-08 02:42:55 +0000
committerjeff <jeff@FreeBSD.org>2002-04-08 02:42:55 +0000
commit7ab1f0e075fd4a046eaf9156daf820ea760f6b1c (patch)
tree4f0fa9107e7d3afec037de685131976ceca43cda /sys/vm/uma_int.h
parent34ccfc8f98ff0cc009136e7e9dc31fbc3244cb1d (diff)
downloadFreeBSD-src-7ab1f0e075fd4a046eaf9156daf820ea760f6b1c.zip
FreeBSD-src-7ab1f0e075fd4a046eaf9156daf820ea760f6b1c.tar.gz
Rework most of the bucket allocation and free code so that per cpu locks are
never held across blocking operations. Also, fix two other lock order reversals that were exposed by jhb's witness change. The free path previously had a bug that would cause it to skip the free bucket list in some cases and go straight to allocating a new bucket. This has been fixed as well. These changes made the bucket handling code much cleaner and removed quite a few lock operations. This should be marginally faster now. It is now possible to call malloc w/o Giant and avoid any witness warnings. This still isn't entirely safe though because malloc_type statistics are not protected by any lock.
Diffstat (limited to 'sys/vm/uma_int.h')
-rw-r--r--sys/vm/uma_int.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/uma_int.h b/sys/vm/uma_int.h
index 282b958..16c02a2 100644
--- a/sys/vm/uma_int.h
+++ b/sys/vm/uma_int.h
@@ -199,7 +199,6 @@ typedef struct uma_bucket * uma_bucket_t;
struct uma_cache {
struct mtx uc_lock; /* Spin lock on this cpu's bucket */
- int uc_count; /* Highest value ub_ptr can have */
uma_bucket_t uc_freebucket; /* Bucket we're freeing to */
uma_bucket_t uc_allocbucket; /* Bucket to allocate from */
u_int64_t uc_allocs; /* Count of allocations */
@@ -257,6 +256,8 @@ struct uma_zone {
u_int64_t uz_oallocs; /* old allocs count */
u_int64_t uz_wssize; /* Working set size */
int uz_recurse; /* Allocation recursion count */
+ uint16_t uz_fills; /* Outstanding bucket fills */
+ uint16_t uz_count; /* Highest value ub_ptr can have */
/*
* This HAS to be the last item because we adjust the zone size
* based on NCPU and then allocate the space for the zones.
OpenPOWER on IntegriCloud