mirror_zfs/spl_config.h.in
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

241 lines
5.4 KiB
C

/* spl_config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 to enable callb debugging */
#undef DEBUG_CALLB
/* Define to 1 to enable kmem debugging */
#undef DEBUG_KMEM
/* Define to 1 to enable kstat debugging */
#undef DEBUG_KSTAT
/* Define to 1 to enable mutex debugging */
#undef DEBUG_MUTEX
/* register_sysctl_table() wants 2 args */
#undef HAVE_2ARGS_REGISTER_SYSCTL
/* vfs_unlink() wants 2 args */
#undef HAVE_2ARGS_VFS_UNLINK
/* INIT_WORK wants 3 args */
#undef HAVE_3ARGS_INIT_WORK
/* on_each_cpu wants 3 args */
#undef HAVE_3ARGS_ON_EACH_CPU
/* vfs_rename() wants 4 args */
#undef HAVE_4ARGS_VFS_RENAME
/* device_create wants 5 args */
#undef HAVE_5ARGS_DEVICE_CREATE
/* kernel defines atomic64_t */
#undef HAVE_ATOMIC64_T
/* class_device_create() is available */
#undef HAVE_CLASS_DEVICE_CREATE
/* struct cred exists */
#undef HAVE_CRED_STRUCT
/* unnumbered sysctl support exists */
#undef HAVE_CTL_UNNUMBERED
/* device_create() is available */
#undef HAVE_DEVICE_CREATE
/* div64_64() is available */
#undef HAVE_DIV64_64
/* div64_u64() is available */
#undef HAVE_DIV64_U64
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* linux/fdtable.h exists */
#undef HAVE_FDTABLE_HEADER
/* files_fdtable() is available */
#undef HAVE_FILES_FDTABLE
/* first_online_pgdat() is available */
#undef HAVE_FIRST_ONLINE_PGDAT
/* fls64() is available */
#undef HAVE_FLS64
/* get_vmalloc_info() is available */
#undef HAVE_GET_VMALLOC_INFO
/* get_zone_counts() is available */
#undef HAVE_GET_ZONE_COUNTS
/* global_page_state() is available */
#undef HAVE_GLOBAL_PAGE_STATE
/* groups_search() is available */
#undef HAVE_GROUPS_SEARCH
/* init_utsname() is available */
#undef HAVE_INIT_UTSNAME
/* struct inode has i_mutex */
#undef HAVE_INODE_I_MUTEX
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* kallsyms_lookup_name() is available */
#undef HAVE_KALLSYMS_LOOKUP_NAME
/* kmalloc_node() is available */
#undef HAVE_KMALLOC_NODE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* monotonic_clock() is available */
#undef HAVE_MONOTONIC_CLOCK
/* mutex_lock_nested() is available */
#undef HAVE_MUTEX_LOCK_NESTED
/* next_online_pgdat() is available */
#undef HAVE_NEXT_ONLINE_PGDAT
/* next_zone() is available */
#undef HAVE_NEXT_ZONE
/* struct path used in struct nameidata */
#undef HAVE_PATH_IN_NAMEIDATA
/* pgdat helpers are available */
#undef HAVE_PGDAT_HELPERS
/* pgdat_list is available */
#undef HAVE_PGDAT_LIST
/* __put_task_struct() is available */
#undef HAVE_PUT_TASK_STRUCT
/* set_normalized_timespec() is available as export */
#undef HAVE_SET_NORMALIZED_TIMESPEC_EXPORT
/* set_normalized_timespec() is available as inline */
#undef HAVE_SET_NORMALIZED_TIMESPEC_INLINE
/* set_shrinker() available */
#undef HAVE_SET_SHRINKER
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* task_curr() exported */
#undef HAVE_TASK_CURR
/* timespec_sub() is available */
#undef HAVE_TIMESPEC_SUB
/* linux/uaccess.h exists */
#undef HAVE_UACCESS_HEADER
/* kernel defines uintptr_t */
#undef HAVE_UINTPTR_T
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Page state NR_ACTIVE is available */
#undef HAVE_ZONE_STAT_ITEM_NR_ACTIVE
/* Page state NR_ACTIVE_ANON is available */
#undef HAVE_ZONE_STAT_ITEM_NR_ACTIVE_ANON
/* Page state NR_ACTIVE_FILE is available */
#undef HAVE_ZONE_STAT_ITEM_NR_ACTIVE_FILE
/* Page state NR_FREE_PAGES is available */
#undef HAVE_ZONE_STAT_ITEM_NR_FREE_PAGES
/* Page state NR_INACTIVE is available */
#undef HAVE_ZONE_STAT_ITEM_NR_INACTIVE
/* Page state NR_INACTIVE_ANON is available */
#undef HAVE_ZONE_STAT_ITEM_NR_INACTIVE_ANON
/* Page state NR_INACTIVE_FILE is available */
#undef HAVE_ZONE_STAT_ITEM_NR_INACTIVE_FILE
/* get_zone_counts() is needed */
#undef NEED_GET_ZONE_COUNTS
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define the project alias string. */
#undef SPL_META_ALIAS
/* Define the project author. */
#undef SPL_META_AUTHOR
/* Define the project release date. */
#undef SPL_META_DATA
/* Define the libtool library 'age' version information. */
#undef SPL_META_LT_AGE
/* Define the libtool library 'current' version information. */
#undef SPL_META_LT_CURRENT
/* Define the libtool library 'revision' version information. */
#undef SPL_META_LT_REVISION
/* Define the project name. */
#undef SPL_META_NAME
/* Define the project release. */
#undef SPL_META_RELEASE
/* Define the project version. */
#undef SPL_META_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
#include <spl_unconfig.h>