Date: Mon, 26 Nov 2007 22:37:35 +0000 (UTC) From: Attilio Rao <attilio@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern kern_mutex.c kern_rwlock.c Message-ID: <200711262237.lAQMbZrj052708@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
attilio 2007-11-26 22:37:35 UTC FreeBSD src repository Modified files: sys/kern kern_mutex.c kern_rwlock.c Log: Simplify the adaptive spinning algorithm in rwlock and mutex: currently, before to spin the turnstile spinlock is acquired and the waiters flag is set. This is not strictly necessary, so just spin before to acquire the spinlock and to set the flags. This will simplify a lot other functions too, as now we have the waiters flag set only if there are actually waiters. This should make wakeup/sleeping couplet faster under intensive mutex workload. This also fixes a bug in rw_try_upgrade() in the adaptive case, where turnstile_lookup() will recurse on the ts_lock lock that will never be really released [1]. [1] Reported by: jeff with Nokia help Tested by: pho, kris (earlier, bugged version of rwlock part) Discussed with: jhb [2], jeff MFC after: 1 week [2] John had a similar patch about 6.x and/or 7.x about mutexes probabilly Revision Changes Path 1.201 +41 -29 src/sys/kern/kern_mutex.c 1.32 +72 -112 src/sys/kern/kern_rwlock.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711262237.lAQMbZrj052708>