summaryrefslogtreecommitdiffstats
path: root/sys/conf/options
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-01-27 23:13:26 +0000
committerjhb <jhb@FreeBSD.org>2006-01-27 23:13:26 +0000
commitbf16c5039031e715ae5703268aa1687778a05e47 (patch)
tree8668cae30688a7758d1778375d322def630558d9 /sys/conf/options
parentd9899f5d164d9d5e2f142fe5bb2dfa0d389e57b4 (diff)
downloadFreeBSD-src-bf16c5039031e715ae5703268aa1687778a05e47.zip
FreeBSD-src-bf16c5039031e715ae5703268aa1687778a05e47.tar.gz
Add a basic reader/writer lock implementation to the kernel. This
implementation is by no means perfect as far as some of the algorithms that it uses and the fact that it is missing some functionality (try locks and upgrades/downgrades are not there yet), however it does seem to work in my local testing. There is more detail in the comments in the code, but the short version follows. A reader/writer lock is very much like a regular mutex: it cannot be held across a voluntary sleep; it can be acquired in an interrupt thread; if the lock is held by a writer then the priority of any threads that block on the lock will be lent to the owner; the simple case lock operations all are done in a single atomic op. It also shares some similiarities with sx locks: it supports reader/writer semantics (multiple readers, but single writers); readers are allowed to recurse, but writers are not. We can extend this implementation further by either improving algorithms or adding new functionality, but this should at least give us a base to work with now. Reviewed by: arch (in theory) Tested on: i386 (4 cpu box with a kernel module that used 4 threads that randomly chose between read locks and write locks that ran w/o panicing for over a day solid. It usually panic'd within a few seconds when there were bugs during testing. :) The kernel module source is available on request.)
Diffstat (limited to 'sys/conf/options')
-rw-r--r--sys/conf/options1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/conf/options b/sys/conf/options
index 41b67d1..494256f 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -513,6 +513,7 @@ MUTEX_PROFILING opt_global.h
MSIZE opt_global.h
REGRESSION opt_global.h
RESTARTABLE_PANICS opt_global.h
+RWLOCK_NOINLINE opt_global.h
VFS_BIO_DEBUG opt_global.h
# These are VM related options
OpenPOWER on IntegriCloud