Date: Sat, 24 Jan 2004 17:59:27 -0800 (PST) From: Robert Watson <rwatson@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/sys _mutex.h src/sys/kern kern_mutex.c Message-ID: <200401250159.i0P1xR4i039361@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
rwatson 2004/01/24 17:59:27 PST FreeBSD src repository Modified files: sys/sys _mutex.h sys/kern kern_mutex.c Log: Add some basic support for measuring sleep mutex contention to the mutex profiling code. As with existing mutex profiling, measurement is done with respect to mtx_lock() instances in the code, as opposed to specific mutexes. In particular, measure two things: (1) Lock contention. How often did this mtx_lock() call get made and have to sleep (or almost sleep) waiting for the lock. This helps identify the "victims" of contention. (2) Hold contention. How often, while the lock was held by a thread as a result of this mtx_lock(), did another thread try to acquire the same mutex. This helps identify the causes of contention. I'm currently exploring adding measurement of "time waited for the lock", but the current implementation has proven useful to me so far so I figured I'd commit it so others could try it out. Note that this increases the size of mutexes when MUTEX_PROFILING is enabled, so you might find you need to further bump UMA_BOOT_PAGES. Fixes welcome. The once over: des, others Revision Changes Path 1.134 +33 -5 src/sys/kern/kern_mutex.c 1.11 +9 -0 src/sys/sys/_mutex.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401250159.i0P1xR4i039361>