Date: Tue, 16 Mar 2004 14:19:00 +0900 From: Seigo Tanimura <tanimura@tanimura.dyndns.org> To: arch@FreeBSD.org Cc: Seigo Tanimura <tanimura@tanimura.dyndns.org> Subject: Is MTX_CONTESTED evil? Message-ID: <200403160519.i2G5J0V6023193@urban>
next in thread | raw e-mail | index | archive | help
_mtx_unlock_sleep() currently wakes up only one thread being blocked, and leaves MTX_CONTESTED on a mutex. According to Solaris Internals, that strategy adds an overhead to check for MTX_CONTESTED on a mutex, even though it is not held by any thread. The thread waken up cannot grab the mutex immediately by _obtain_lock() and have to go through _mtx_lock_sleep(). The penalty tends to be large for a mutex with a high contention, and we have at least one of such a mutex - Giant. What would it be like if we axed MTX_CONTEST and let _mtx_unlock_sleep() wake up all of the blocked threads? -- Seigo Tanimura <tanimura@tanimura.dyndns.org> <tanimura@FreeBSD.org>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403160519.i2G5J0V6023193>