Go to file
Brian Behlendorf e811949a57 Reimplement rwlocks for Linux lock profiling/analysis.
It turns out that the previous rwlock implementation worked well but
did not integrate properly with the upstream kernel lock profiling/
analysis tools.  This is a major problem since it would be awfully
nice to be able to use the automatic lock checker and profiler.

The problem is that the upstream lock tools use the pre-processor
to create a lock class for each uniquely named locked.  Since the
rwsem was embedded in a wrapper structure the name was always the
same.  The effect was that we only ended up with one lock class for
the entire SPL which caused the lock dependency checker to flag
nearly everything as a possible deadlock.

The solution was to directly map a krwlock to a Linux rwsem using
a typedef there by eliminating the wrapper structure.  This was not
done initially because the rwsem implementation is specific to the arch.
To fully implement the Solaris krwlock API using only the provided rwsem
API is not possible.  It can only be done by directly accessing some of
the internal data member of the rwsem structure.

For example, the Linux API provides a different function for dropping
a reader vs writer lock.  Whereas the Solaris API uses the same function
and the caller does not pass in what type of lock it is.  This means to
properly drop the lock we need to determine if the lock is currently a
reader or writer lock.  Then we need to call the proper Linux API function.
Unfortunately, there is no provided API for this so we must extracted this
information directly from arch specific lock implementation.  This is
all do able, and what I did, but it does complicate things considerably.

The good news is that in addition to the profiling benefits of this
change.  We may see performance improvements due to slightly reduced
overhead when creating rwlocks and manipulating them.

The only function I was forced to sacrafice was rw_owner() because this
information is simply not stored anywhere in the rwsem.  Luckily this
appears not to be a commonly used function on Solaris, and it is my
understanding it is mainly used for debugging anyway.

In addition to the core rwlock changes, extensive updates were made to
the rwlock regression tests.  Each class of test was extended to provide
more API coverage and to be more rigerous in checking for misbehavior.

This is a pretty significant change and with that in mind I have been
careful to validate it on several platforms before committing.  The full
SPLAT regression test suite was run numberous times on all of the following
platforms.  This includes various kernels ranging from 2.6.16 to 2.6.29.

- SLES10   (ppc64)
- SLES11   (x86_64)
- CHAOS4.2 (x86_64)
- RHEL5.3  (x86_64)
- RHEL6    (x86_64)
- FC11     (x86_64)
2009-09-18 16:09:47 -07:00
cmd Simplify rpm build rules, added config/rpm.am. 2009-07-01 14:37:44 -07:00
config Reimplement rwlocks for Linux lock profiling/analysis. 2009-09-18 16:09:47 -07:00
include Reimplement rwlocks for Linux lock profiling/analysis. 2009-09-18 16:09:47 -07:00
lib Simplify rpm build rules, added config/rpm.am. 2009-07-01 14:37:44 -07:00
module Reimplement rwlocks for Linux lock profiling/analysis. 2009-09-18 16:09:47 -07:00
patches Reimplement rwlocks for Linux lock profiling/analysis. 2009-09-18 16:09:47 -07:00
scripts Simplify rpm build rules, added config/rpm.am. 2009-07-01 14:37:44 -07:00
AUTHORS Prep for spl-0.4.3 tag. 2009-03-20 14:48:30 -07:00
autogen.sh Packaging improvements for RHEL and SLES 2009-06-16 10:44:59 -07:00
ChangeLog Tag spl-0.4.5. 2009-08-04 12:22:33 -07:00
configure Reimplement rwlocks for Linux lock profiling/analysis. 2009-09-18 16:09:47 -07:00
configure.ac Simplify rpm build rules, added config/rpm.am. 2009-07-01 14:37:44 -07:00
COPYING Go through and add a header with the proper UCRL number. 2008-05-26 04:38:26 +00:00
DISCLAIMER Go through and add a header with the proper UCRL number. 2008-05-26 04:38:26 +00:00
INSTALL Trivial commit to remove whitespace 2008-07-09 19:11:29 +00:00
Makefile.am Simplify rpm build rules, added config/rpm.am. 2009-07-01 14:37:44 -07:00
Makefile.in Simplify rpm build rules, added config/rpm.am. 2009-07-01 14:37:44 -07:00
META Tag spl-0.4.5. 2009-08-04 12:22:33 -07:00
spl_config.h.in Reimplement rwlocks for Linux lock profiling/analysis. 2009-09-18 16:09:47 -07:00
spl_unconfig.h Allow spl_config.h to be included by dependant packages 2009-03-17 14:55:59 -07:00
spl-modules.spec.in Various spec file tweaks to handle rpm building of several distros. 2009-08-14 14:09:16 -07:00
spl.spec.in Simplify rpm build rules, added config/rpm.am. 2009-07-01 14:37:44 -07:00