diff options
author | jhb <jhb@FreeBSD.org> | 2007-03-31 23:23:42 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2007-03-31 23:23:42 +0000 |
commit | b0b93a3c55b874a04a163db8dcf6af0b7e28b2e4 (patch) | |
tree | 6f71182be4d218a6130d92f4c3455591243f0019 /sys/conf/options | |
parent | 7f18b608045d45d3d89e8cbaa7710fcbbc4d7eab (diff) | |
download | FreeBSD-src-b0b93a3c55b874a04a163db8dcf6af0b7e28b2e4.zip FreeBSD-src-b0b93a3c55b874a04a163db8dcf6af0b7e28b2e4.tar.gz |
Optimize sx locks to use simple atomic operations for the common cases of
obtaining and releasing shared and exclusive locks. The algorithms for
manipulating the lock cookie are very similar to that rwlocks. This patch
also adds support for exclusive locks using the same algorithm as mutexes.
A new sx_init_flags() function has been added so that optional flags can be
specified to alter a given locks behavior. The flags include SX_DUPOK,
SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature
to the similar flags for mutexes.
Adaptive spinning on select locks may be enabled by enabling the
ADAPTIVE_SX kernel option. Only locks initialized with the SX_ADAPTIVESPIN
flag via sx_init_flags() will adaptively spin.
The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock()
are now performed inline in non-debug kernels. As a result, <sys/sx.h> now
requires <sys/lock.h> to be included prior to <sys/sx.h>.
The new kernel option SX_NOINLINE can be used to disable the aforementioned
inlining in non-debug kernels.
The size of struct sx has changed, so the kernel ABI is probably greatly
disturbed.
MFC after: 1 month
Submitted by: attilio
Tested by: kris, pjd
Diffstat (limited to 'sys/conf/options')
-rw-r--r-- | sys/conf/options | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/conf/options b/sys/conf/options index 7197ba2..c9eadb1 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -59,6 +59,7 @@ NO_SYSCTL_DESCR opt_global.h # Miscellaneous options. ADAPTIVE_GIANT opt_adaptive_mutexes.h +ADAPTIVE_SX ALQ AUDIT opt_global.h CODA_COMPAT_5 opt_coda.h @@ -555,6 +556,7 @@ MSIZE opt_global.h REGRESSION opt_global.h RESTARTABLE_PANICS opt_global.h RWLOCK_NOINLINE opt_global.h +SX_NOINLINE opt_global.h VFS_BIO_DEBUG opt_global.h # These are VM related options |