Go to file
Brian Behlendorf 058de03caa Clear cv->cv_mutex when not in use
For debugging purposes the condition varaibles keep track of the
mutex used during a wait.  The idea is to validate that all callers
always use the same mutex.  Unfortunately, we have seen cases where
the caller reuses the condition variable with a different mutex but
in a way which is known to be safe.  My reading of the man pages
suggests you should not do this and always cv_destroy()/cv_init()
a new mutex.  However, there is overhead in doing this and it does
appear to be allowed under Solaris.

To accomidate this behavior cv_wait_common() and __cv_timedwait()
have been modified to clear the associated mutex when the last
waiter is dropped.  This ensures that while the condition variable
is in use the incorrect mutex case is detected.  It also allows the
condition variable to be safely recycled without requiring the
overhead of a cv_destroy()/cv_init() as long as it isn't currently
in use.

Finally, spin lock cv->cv_lock was removed because it is not required.
When the condition variable is used properly the caller will always
be holding the mutex so the spin lock is redundant.  The lock was
originally added because I expected to need to protect more than
just the cv->cv_mutex.  It turns out that was not the case.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-11-29 11:02:34 -08:00
cmd Support custom build directories 2010-09-05 21:49:05 -07:00
config Linux 2.6.36 compat, fs_struct->lock type change 2010-11-09 13:29:47 -08:00
include Clear cv->cv_mutex when not in use 2010-11-29 11:02:34 -08:00
lib Support custom build directories 2010-09-05 21:49:05 -07:00
module Clear cv->cv_mutex when not in use 2010-11-29 11:02:34 -08:00
patches Reimplement rwlocks for Linux lock profiling/analysis. 2009-09-18 16:09:47 -07:00
scripts Support custom build directories 2010-09-05 21:49:05 -07:00
.gitignore Ignore unsigned module build products 2010-03-11 14:29:17 -08:00
AUTHORS Public Release Prep 2010-05-17 15:18:00 -07:00
autogen.sh Public Release Prep 2010-05-17 15:18:00 -07:00
ChangeLog Prep for spl-0.5.0 tag 2010-08-13 09:33:50 -07:00
configure Linux 2.6.36 compat, fs_struct->lock type change 2010-11-09 13:29:47 -08:00
configure.ac Support custom build directories 2010-09-05 21:49:05 -07:00
COPYING Public Release Prep 2010-05-17 15:18:00 -07:00
DISCLAIMER Public Release Prep 2010-05-17 15:18:00 -07:00
INSTALL Public Release Prep 2010-05-17 15:18:00 -07:00
Makefile.am Support custom build directories 2010-09-05 21:49:05 -07:00
Makefile.in Support custom build directories 2010-09-05 21:49:05 -07:00
META Prep for 0.5.2 tag 2010-11-05 11:52:46 -07:00
README.markdown Fix markdown rendering 2010-09-15 09:05:34 -07:00
spl_config.h.in Linux 2.6.36 compat, fs_struct->lock type change 2010-11-09 13:29:47 -08:00
spl-modules.spec.in Minor spec file cleanup for RHEL6 package dependency. 2010-05-21 11:53:49 -07:00
spl.spec.in Remove usage of the __id_u macro for portability. 2009-10-05 12:51:58 -07:00

The Solaris Porting Layer (SPL) is a Linux kernel module which provides many of the Solaris kernel APIs. This shim layer makes it possible to run Solaris kernel code in the Linux kernel with relatively minimal modification. This can be particularly useful when you want to track upstream Solaris development closely and dont want the overhead of maintaining a large patch which converts Solaris primitives to Linux primitives.

To build packages for your distribution:

$ ./configure
$ make pkg

Full documentation for building, configuring, and using the SPL can be found at: http://zfsonlinux.org