summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2007-11-26 22:37:35 +0000
committerattilio <attilio@FreeBSD.org>2007-11-26 22:37:35 +0000
commit6fcea2407ce58f08967b0c23794571ed884622b8 (patch)
tree54b27d85fcd529d57c33cc56cba5dec439d40f9b /lib/libc/stdlib/malloc.c
parent315c303950548e58ba5c64e6d3f6de2e88e4da33 (diff)
downloadFreeBSD-src-6fcea2407ce58f08967b0c23794571ed884622b8.zip
FreeBSD-src-6fcea2407ce58f08967b0c23794571ed884622b8.tar.gz
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
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud