mirror_zfs/module/spl
Brian Behlendorf 4d54fdee1d Reimplement mutexs for Linux lock profiling/analysis
For a generic explanation of why mutexs needed to be reimplemented
to work with the kernel lock profiling see commits:
  e811949a57 and
  d28db80fd0

The specific changes made to the mutex implemetation are as follows.
The Linux mutex structure is now directly embedded in the kmutex_t.
This allows a kmutex_t to be directly case to a mutex struct and
passed directly to the Linux primative.

Just like with the rwlocks it is critical that these functions be
implemented as '#defines to ensure the location information is
preserved.  The preprocessor can then do a direct replacement of
the Solaris primative with the linux primative.

Just as with the rwlocks we need to track the lock owner.  Here
things get a little more interesting because depending on your
kernel version, and how you've built your kernel Linux may already
do this for you.  If your running a 2.6.29 or newer kernel on a
SMP system the lock owner will be tracked.  This was added to Linux
to support adaptive mutexs, more on that shortly.  Alternately, your
kernel might track the lock owner if you've set CONFIG_DEBUG_MUTEXES
in the kernel build.  If neither of the above things is true for
your kernel the kmutex_t type will include and track the lock owner
to ensure correct behavior.  This is all handled by a new autoconf
check called SPL_AC_MUTEX_OWNER.

Concerning adaptive mutexs these are a very recent development and
they did not make it in to either the latest FC11 of SLES11 kernels.
Ideally, I'd love to see this kernel change appear in one of these
distros because it does help performance.  From Linux kernel commit:
  0d66bf6d3514b35eb6897629059443132992dbd7
  "Testing with Ingo's test-mutex application...
  gave a 345% boost for VFS scalability on my testbox"
However, if you don't want to backport this change yourself you
can still simply export the task_curr() symbol.  The kmutex_t
implementation will use this symbol when it's available to
provide it's own adaptive mutexs.

Finally, DEBUG_MUTEX support was removed including the proc handlers.
This was done because now that we are cleanly integrated with the
kernel profiling all this information and much much more is available
in debug kernel builds.  This code was now redundant.

Update mutexs validated on:
    - SLES10   (ppc64)
    - SLES11   (x86_64)
    - CHAOS4.2 (x86_64)
    - RHEL5.3  (x86_64)
    - RHEL6    (x86_64)
    - FC11     (x86_64)
2009-09-25 14:47:01 -07:00
..
Makefile.in Add basic credential support and splat tests. 2009-07-27 17:18:59 -07:00
spl-atomic.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-condvar.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-cred.c Remove get/put_task_struct as they are not available for SLES11 2009-07-28 15:04:21 -07:00
spl-debug.c Add basic credential support and splat tests. 2009-07-27 17:18:59 -07:00
spl-err.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-generic.c Update rwlocks to track owner to ensure correct semantics 2009-09-25 14:14:35 -07:00
spl-kmem.c Update global_page_state() support for 2.6.29 kernels. 2009-07-28 15:06:42 -07:00
spl-kobj.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-kstat.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-module.c Positive Solaris ioctl return codes need to be negated for use by libc 2009-07-23 16:14:52 -07:00
spl-mutex.c Reimplement mutexs for Linux lock profiling/analysis 2009-09-25 14:47:01 -07:00
spl-proc.c Reimplement mutexs for Linux lock profiling/analysis 2009-09-25 14:47:01 -07:00
spl-rwlock.c Update rwlocks to track owner to ensure correct semantics 2009-09-25 14:14:35 -07:00
spl-taskq.c Add basic support for TASKQ_THREADS_CPU_PCT taskq flag which is 2009-07-09 10:07:52 -07:00
spl-thread.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-time.c Prevent integer overflow after ~164 days of uptime. 2009-07-14 15:23:25 -07:00
spl-vnode.c The HAVE_PATH_IN_NAMEIDATA compat macros should have been used here. 2009-07-22 14:28:19 -07:00
spl-xdr.c Minor bug fix in XDR code introduced in last minute change before landing. 2009-03-11 16:27:35 -07:00