Date: Tue, 18 Apr 2006 18:27:54 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern kern_rwlock.c Message-ID: <200604181827.k3IIRsrG093179@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
jhb 2006-04-18 18:27:54 UTC FreeBSD src repository Modified files: sys/kern kern_rwlock.c Log: Adaptively spin before blocking on the turnstile if an rwlock is write locked. In general the adaptive spinning is similar to the same code for mutexes with some extra trickiness in rw_wunlock_hard(). Specifically, even though both wait bits might be set and we might have a turnstile with at least one waiting thread, there might not be any threads blocked on the queue we are not waking up (they might all be spinning), and we should only preserve the waiting flag for the queue we aren't waking up if there are in fact threads blocked on that queue. Secondly, there might not be any threads blocked on the queue we have chosen to waken threads from (there might only be threads blocked on the other queue and the threads for this queue are all spinning) in which case we disown the turnstile instead of doing a braodcast and unpend. Revision Changes Path 1.7 +88 -7 src/sys/kern/kern_rwlock.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604181827.k3IIRsrG093179>