OpenZFS on Linux and FreeBSD
Go to file
Brian Behlendorf 5e9b5d832b Use Linux atomic primitives by default.
Previously Solaris style atomic primitives were implemented simply by
wrapping the desired operation in a global spinlock.  This was easy to
implement at the time when I wasn't 100% sure I could safely layer the
Solaris atomic primatives on the Linux counterparts.  It however was
likely not good for performance.

After more investigation however it does appear the Solaris primitives
can be layered on Linux's fairly safely.  The Linux atomic_t type really
just wraps a long so we can simply cast the Solaris unsigned value to
either a atomic_t or atomic64_t.  The only lingering problem for both
implementations is that Solaris provides no atomic read function.  This
means reading a 64-bit value on a 32-bit arch can (and will) result in
word breaking.  I was very concerned about this initially, but upon
further reflection it is a limitation of the Solaris API.  So really
we are just being bug-for-bug compatible here.

With this change the default implementation is layered on top of Linux
atomic types.  However, because we're assuming a lot about the internal
implementation of those types I've made it easy to fall-back to the
generic approach.  Simply build with --enable-atomic_spinlocks if
issues are encountered with the new implementation.
2009-10-30 10:55:25 -07:00
cmd Simplify rpm build rules, added config/rpm.am. 2009-07-01 14:37:44 -07:00
config Use Linux atomic primitives by default. 2009-10-30 10:55:25 -07:00
include Use Linux atomic primitives by default. 2009-10-30 10:55:25 -07:00
lib Simplify rpm build rules, added config/rpm.am. 2009-07-01 14:37:44 -07:00
module Use Linux atomic primitives by default. 2009-10-30 10:55:25 -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
COPYING Go through and add a header with the proper UCRL number. 2008-05-26 04:38:26 +00:00
ChangeLog Tag spl-0.4.5. 2009-08-04 12:22:33 -07: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
META Tag spl-0.4.5. 2009-08-04 12:22:33 -07: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
autogen.sh Packaging improvements for RHEL and SLES 2009-06-16 10:44:59 -07:00
configure Use Linux atomic primitives by default. 2009-10-30 10:55:25 -07:00
configure.ac Simplify rpm build rules, added config/rpm.am. 2009-07-01 14:37:44 -07:00
spl-modules.spec.in Remove usage of the __id_u macro for portability. 2009-10-05 12:51:58 -07:00
spl.spec.in Remove usage of the __id_u macro for portability. 2009-10-05 12:51:58 -07:00
spl_config.h.in Use Linux atomic primitives by default. 2009-10-30 10:55:25 -07:00
spl_unconfig.h Allow spl_config.h to be included by dependant packages 2009-03-17 14:55:59 -07:00