aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_mtxpool.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2018-12-24 23:52:35 +0000
committerAlexander Motin <mav@FreeBSD.org>2018-12-24 23:52:35 +0000
commitabeb9f61f997ba6b1015ce6346109e606944a214 (patch)
treecec66c2646c60e4bce4c0fe79bf1eb30a852f1db /sys/kern/kern_mtxpool.c
parent511662d083ea24a689361e8338cb28e9d09b97f6 (diff)
downloadsrc-abeb9f61f997ba6b1015ce6346109e606944a214.tar.gz
src-abeb9f61f997ba6b1015ce6346109e606944a214.zip
Increase MTX_POOL_SLEEP_SIZE from 128 to 1024.
This value remained unchanged for 15 years, and now this bump reduces lock spinning in GEOM and BIO layers while doing ~1.6M IOPS to 4 NVMe on 72-core system from ~25% to ~5% by the cost of additional 28KB RAM. While there, align struct mtx_pool fields to cache lines. MFC after: 1 month
Notes
Notes: svn path=/head/; revision=342400
Diffstat (limited to 'sys/kern/kern_mtxpool.c')
-rw-r--r--sys/kern/kern_mtxpool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_mtxpool.c b/sys/kern/kern_mtxpool.c
index c220f3ef4cda..72bf0f92ed80 100644
--- a/sys/kern/kern_mtxpool.c
+++ b/sys/kern/kern_mtxpool.c
@@ -62,14 +62,14 @@ static MALLOC_DEFINE(M_MTXPOOL, "mtx_pool", "mutex pool");
/* Pool sizes must be a power of two */
#ifndef MTX_POOL_SLEEP_SIZE
-#define MTX_POOL_SLEEP_SIZE 128
+#define MTX_POOL_SLEEP_SIZE 1024
#endif
struct mtxpool_header {
int mtxpool_size;
int mtxpool_mask;
int mtxpool_shift;
- int mtxpool_next;
+ int mtxpool_next __aligned(CACHE_LINE_SIZE);
};
struct mtx_pool {