Date: Mon, 24 Dec 2018 23:52:35 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342400 - head/sys/kern Message-ID: <201812242352.wBONqZ5h005804@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Mon Dec 24 23:52:35 2018 New Revision: 342400 URL: https://svnweb.freebsd.org/changeset/base/342400 Log: 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 Modified: head/sys/kern/kern_mtxpool.c Modified: head/sys/kern/kern_mtxpool.c ============================================================================== --- head/sys/kern/kern_mtxpool.c Mon Dec 24 23:28:11 2018 (r342399) +++ head/sys/kern/kern_mtxpool.c Mon Dec 24 23:52:35 2018 (r342400) @@ -62,14 +62,14 @@ static MALLOC_DEFINE(M_MTXPOOL, "mtx_pool", "mutex poo /* 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 {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812242352.wBONqZ5h005804>