diff options
author | rwatson <rwatson@FreeBSD.org> | 2014-05-02 07:57:40 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2014-05-02 07:57:40 +0000 |
commit | 7ca3cc4389bc98a48e1c007ab40dfa0dafd6943b (patch) | |
tree | b8cc9d270a7c30d10e6e2ea33e21e72c8d06aa7a /sys/kern | |
parent | 382c3dae477fc5ca49cea9603cc1591fe2591140 (diff) | |
download | FreeBSD-src-7ca3cc4389bc98a48e1c007ab40dfa0dafd6943b.zip FreeBSD-src-7ca3cc4389bc98a48e1c007ab40dfa0dafd6943b.tar.gz |
Garbage collect mtxpool_lockbuilder, the mutex pool historically used
for lockmgr and sx interlocks, but unused since optimised versions of
those sleep locks were introduced. This will save a (quite) small
amount of memory in all kernel configurations. The sleep mutex pool is
retained as it is used for 'struct bio' and several other consumers.
Discussed with: jhb
MFC after: 3 days
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_mtxpool.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/sys/kern/kern_mtxpool.c b/sys/kern/kern_mtxpool.c index 23b41bb..0c6f95b 100644 --- a/sys/kern/kern_mtxpool.c +++ b/sys/kern/kern_mtxpool.c @@ -59,9 +59,6 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_MTXPOOL, "mtx_pool", "mutex pool"); /* Pool sizes must be a power of two */ -#ifndef MTX_POOL_LOCKBUILDER_SIZE -#define MTX_POOL_LOCKBUILDER_SIZE 128 -#endif #ifndef MTX_POOL_SLEEP_SIZE #define MTX_POOL_SLEEP_SIZE 128 #endif @@ -78,18 +75,12 @@ struct mtx_pool { struct mtx mtx_pool_ary[1]; }; -static struct mtx_pool_lockbuilder { - struct mtxpool_header mtx_pool_header; - struct mtx mtx_pool_ary[MTX_POOL_LOCKBUILDER_SIZE]; -} lockbuilder_pool; - #define mtx_pool_size mtx_pool_header.mtxpool_size #define mtx_pool_mask mtx_pool_header.mtxpool_mask #define mtx_pool_shift mtx_pool_header.mtxpool_shift #define mtx_pool_next mtx_pool_header.mtxpool_next struct mtx_pool *mtxpool_sleep; -struct mtx_pool *mtxpool_lockbuilder; #if UINTPTR_MAX == UINT64_MAX /* 64 bits */ # define POINTER_BITS 64 @@ -166,15 +157,6 @@ mtx_pool_destroy(struct mtx_pool **poolp) } static void -mtx_pool_setup_static(void *dummy __unused) -{ - mtx_pool_initialize((struct mtx_pool *)&lockbuilder_pool, - "lockbuilder mtxpool", MTX_POOL_LOCKBUILDER_SIZE, - MTX_DEF | MTX_NOWITNESS | MTX_QUIET); - mtxpool_lockbuilder = (struct mtx_pool *)&lockbuilder_pool; -} - -static void mtx_pool_setup_dynamic(void *dummy __unused) { mtxpool_sleep = mtx_pool_create("sleep mtxpool", @@ -202,17 +184,5 @@ mtx_pool_alloc(struct mtx_pool *pool) return (&pool->mtx_pool_ary[i]); } -/* - * The lockbuilder pool must be initialized early because the lockmgr - * and sx locks depend on it. The sx locks are used in the kernel - * memory allocator. The lockmgr subsystem is initialized by - * SYSINIT(..., SI_SUB_LOCKMGR, ...). - * - * We can't call malloc() to dynamically allocate the sleep pool - * until after kmeminit() has been called, which is done by - * SYSINIT(..., SI_SUB_KMEM, ...). - */ -SYSINIT(mtxpooli1, SI_SUB_MTX_POOL_STATIC, SI_ORDER_FIRST, - mtx_pool_setup_static, NULL); SYSINIT(mtxpooli2, SI_SUB_MTX_POOL_DYNAMIC, SI_ORDER_FIRST, mtx_pool_setup_dynamic, NULL); |