mirror_zfs/spl_config.h.in

297 lines
6.8 KiB
C
Raw Normal View History

/* spl_config.h.in. Generated from configure.ac by autoheader. */
/* Atomic types use spinlocks */
#undef ATOMIC_SPINLOCK
Autoconf --enable-debug-* cleanup Cleanup the --enable-debug-* configure options, this has been pending for quite some time and I am glad I finally got to it. To summerize: 1) All SPL_AC_DEBUG_* macros were updated to be a more autoconf friendly. This mainly involved shift to the GNU approved usage of AC_ARG_ENABLE and ensuring AS_IF is used rather than directly using an if [ test ] construct. 2) --enable-debug-kmem=yes by default. This simply enabled keeping a running tally of total memory allocated and freed and reporting a memory leak if there was one at module unload. Additionally, it ensure /proc/spl/kmem/slab will exist by default which is handy. The overhead is low for this and it should not impact performance. 3) --enable-debug-kmem-tracking=no by default. This option was added to provide a configure option to enable to detailed memory allocation tracking. This support was always there but you had to know where to turn it on. By default this support is disabled because it is known to badly hurt performence, however it is invaluable when chasing a memory leak. 4) --enable-debug-kstat removed. After further reflection I can't see why you would ever really want to turn this support off. It is now always on which had the nice side effect of simplifying the proc handling code in spl-proc.c. We can now always assume the top level directory will be there. 5) --enable-debug-callb removed. This never really did anything, it was put in provisionally because it might have been needed. It turns out it was not so I am just removing it to prevent confusion.
2009-10-30 23:58:51 +03:00
/* Define to 1 to enable basic kmem accounting */
#undef DEBUG_KMEM
Autoconf --enable-debug-* cleanup Cleanup the --enable-debug-* configure options, this has been pending for quite some time and I am glad I finally got to it. To summerize: 1) All SPL_AC_DEBUG_* macros were updated to be a more autoconf friendly. This mainly involved shift to the GNU approved usage of AC_ARG_ENABLE and ensuring AS_IF is used rather than directly using an if [ test ] construct. 2) --enable-debug-kmem=yes by default. This simply enabled keeping a running tally of total memory allocated and freed and reporting a memory leak if there was one at module unload. Additionally, it ensure /proc/spl/kmem/slab will exist by default which is handy. The overhead is low for this and it should not impact performance. 3) --enable-debug-kmem-tracking=no by default. This option was added to provide a configure option to enable to detailed memory allocation tracking. This support was always there but you had to know where to turn it on. By default this support is disabled because it is known to badly hurt performence, however it is invaluable when chasing a memory leak. 4) --enable-debug-kstat removed. After further reflection I can't see why you would ever really want to turn this support off. It is now always on which had the nice side effect of simplifying the proc handling code in spl-proc.c. We can now always assume the top level directory will be there. 5) --enable-debug-callb removed. This never really did anything, it was put in provisionally because it might have been needed. It turns out it was not so I am just removing it to prevent confusion.
2009-10-30 23:58:51 +03:00
/* Define to 1 to enable detailed kmem tracking */
#undef DEBUG_KMEM_TRACKING
/* invalidate_inodes() wants 2 args */
#undef HAVE_2ARGS_INVALIDATE_INODES
/* register_sysctl_table() wants 2 args */
#undef HAVE_2ARGS_REGISTER_SYSCTL
/* set_fs_pwd() wants 2 args */
#undef HAVE_2ARGS_SET_FS_PWD
/* vfs_unlink() wants 2 args */
#undef HAVE_2ARGS_VFS_UNLINK
/* zlib_deflate_workspacesize() wants 2 args */
#undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
/* file_fsync() wants 3 args */
#undef HAVE_3ARGS_FILE_FSYNC
/* INIT_WORK wants 3 args */
#undef HAVE_3ARGS_INIT_WORK
/* on_each_cpu wants 3 args */
#undef HAVE_3ARGS_ON_EACH_CPU
/* shrinker callback wants 3 args */
#undef HAVE_3ARGS_SHRINKER_CALLBACK
/* vfs_rename() wants 4 args */
#undef HAVE_4ARGS_VFS_RENAME
/* device_create wants 5 args */
#undef HAVE_5ARGS_DEVICE_CREATE
/* proc_handler() wants 5 args */
#undef HAVE_5ARGS_PROC_HANDLER
/* kernel defines atomic64_cmpxchg */
#undef HAVE_ATOMIC64_CMPXCHG
/* kernel defines atomic64_t */
#undef HAVE_ATOMIC64_T
/* kernel defines atomic64_xchg */
#undef HAVE_ATOMIC64_XCHG
/* class_device_create() is available */
#undef HAVE_CLASS_DEVICE_CREATE
/* struct cred exists */
#undef HAVE_CRED_STRUCT
/* struct ctl_table has ctl_name */
#undef HAVE_CTL_NAME
/* unnumbered sysctl support exists */
#undef HAVE_CTL_UNNUMBERED
/* device_create() is available */
#undef HAVE_DEVICE_CREATE
/* 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
/* struct fs_struct uses spinlock_t */
#undef HAVE_FS_STRUCT_SPINLOCK
Linux VM Integration Cleanup Remove all instances of functions being reimplemented in the SPL. When the prototypes are available in the linux headers but the function address itself is not exported use kallsyms_lookup_name() to find the address. The function name itself can them become a define which calls a function pointer. This is preferable to reimplementing the function in the SPL because it ensures we get the correct version of the function for the running kernel. This is actually pretty safe because the prototype is defined in the headers so we know we are calling the function properly. This patch also includes a rhel5 kernel patch we exports the needed symbols so we don't need to use kallsyms_lookup_name(). There are autoconf checks to detect if the symbol is exported and if so to use it directly. We should add patches for stock upstream kernels as needed if for no other reason than so we can easily track which additional symbols we needed exported. Those patches can also be used by anyone willing to rebuild their kernel, but this should not be a requirement. The rhel5 version of the export-symbols patch has been applied to the chaos kernel. Additional fixes: 1) Implement vmem_size() function using get_vmalloc_info() 2) SPL_CHECK_SYMBOL_EXPORT macro updated to use $LINUX_OBJ instead of $LINUX because Module.symvers is a build product. When $LINUX_OBJ != $LINUX we will not properly detect exported symbols. 3) SPL_LINUX_COMPILE_IFELSE macro updated to add include2 and $LINUX/include search paths to allow proper compilation when the kernel target build directory is not the source directory.
2009-02-26 00:20:40 +03:00
/* 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
/* invalidate_inodes() is available */
#undef HAVE_INVALIDATE_INODES
Linux VM Integration Cleanup Remove all instances of functions being reimplemented in the SPL. When the prototypes are available in the linux headers but the function address itself is not exported use kallsyms_lookup_name() to find the address. The function name itself can them become a define which calls a function pointer. This is preferable to reimplementing the function in the SPL because it ensures we get the correct version of the function for the running kernel. This is actually pretty safe because the prototype is defined in the headers so we know we are calling the function properly. This patch also includes a rhel5 kernel patch we exports the needed symbols so we don't need to use kallsyms_lookup_name(). There are autoconf checks to detect if the symbol is exported and if so to use it directly. We should add patches for stock upstream kernels as needed if for no other reason than so we can easily track which additional symbols we needed exported. Those patches can also be used by anyone willing to rebuild their kernel, but this should not be a requirement. The rhel5 version of the export-symbols patch has been applied to the chaos kernel. Additional fixes: 1) Implement vmem_size() function using get_vmalloc_info() 2) SPL_CHECK_SYMBOL_EXPORT macro updated to use $LINUX_OBJ instead of $LINUX because Module.symvers is a build product. When $LINUX_OBJ != $LINUX we will not properly detect exported symbols. 3) SPL_LINUX_COMPILE_IFELSE macro updated to add include2 and $LINUX/include search paths to allow proper compilation when the kernel target build directory is not the source directory.
2009-02-26 00:20:40 +03:00
/* kallsyms_lookup_name() is available */
#undef HAVE_KALLSYMS_LOOKUP_NAME
/* kern_path_parent() is available */
#undef HAVE_KERN_PATH_PARENT
/* kmalloc_node() is available */
#undef HAVE_KMALLOC_NODE
/* kvasprintf() is available */
#undef HAVE_KVASPRINTF
/* 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
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: e811949a57044d60d12953c5c3b808a79a7d36ef and d28db80fd0fd4fd63aec09037c44408e51a222d6 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-26 01:47:01 +04:00
/* struct mutex has owner */
#undef HAVE_MUTEX_OWNER
/* struct mutex owner is a task_struct */
#undef HAVE_MUTEX_OWNER_TASK_STRUCT
/* 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
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-19 03:09:47 +04:00
/* __put_task_struct() is available */
#undef HAVE_PUT_TASK_STRUCT
/* set_fs_pwd() is available */
#undef HAVE_SET_FS_PWD
/* 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
/* struct shrink_control exists */
#undef HAVE_SHRINK_CONTROL_STRUCT
/* shrink_dcache_memory() is available */
#undef HAVE_SHRINK_DCACHE_MEMORY
/* shrink_icache_memory() is available */
#undef HAVE_SHRINK_ICACHE_MEMORY
/* 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
/* user_path_dir() is available */
#undef HAVE_USER_PATH_DIR
/* 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
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* get_zone_counts() is needed */
#undef NEED_GET_ZONE_COUNTS
FC10/i686 Compatibility Update (2.6.27.19-170.2.35.fc10.i686) In the interests of portability I have added a FC10/i686 box to my list of development platforms. The hope is this will allow me to keep current with upstream kernel API changes, and at the same time ensure I don't accidentally break x86 support. This patch resolves all remaining issues observed under that environment. 1) SPL_AC_ZONE_STAT_ITEM_FIA autoconf check added. As of 2.6.21 the kernel added a clean API for modules to get the global count for free, inactive, and active pages. The SPL attempts to detect if this API is available and directly map spl_global_page_state() to global_page_state(). If the full API is not available then spl_global_page_state() is implemented as a thin layer to get these values via get_zone_counts() if that symbol is available. 2) New kmem:vmem_size regression test added to validate correct vmem_size() functionality. The test case acquires the current global vmem state, allocates from the vmem region, then verifies the allocation is correctly reflected in the vmem_size() stats. 3) Change splat_kmem_cache_thread_test() to always use KMC_KMEM based memory. On x86 systems with limited virtual address space failures resulted due to exhaustig the address space. The tests really need to problem exhausting all memory on the system thus we need to use the physical address space. 4) Change kmem:slab_lock to cap it's memory usage at availrmem instead of using the native linux nr_free_pages(). This provides additional test coverage of the SPL Linux VM integration. 5) Change kmem:slab_overcommit to perform allocation of 256K instead of 1M. On x86 based systems it is not possible to create a kmem backed slab with entires of that size. To compensate for this the number of allocations performed in increased by 4x. 6) Additional autoconf documentation for proposed upstream API changes to make additional symbols available to modules. 7) Console error messages added when spl_kallsyms_lookup_name() fails to locate an expected symbol. This causes the module to fail to load and we need to know exactly which symbol was not available.
2009-03-17 22:16:31 +03:00
/* 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
Correctly handle rwsem_is_locked() behavior A race condition in rwsem_is_locked() was fixed in Linux 2.6.33 and the fix was backported to RHEL5 as of kernel 2.6.18-190.el5. Details can be found here: https://bugzilla.redhat.com/show_bug.cgi?id=526092 The race condition was fixed in the kernel by acquiring the semaphore's wait_lock inside rwsem_is_locked(). The SPL worked around the race condition by acquiring the wait_lock before calling that function, but with the fix in place it must not do that. This commit implements an autoconf test to detect whether the fixed version of rwsem_is_locked() is present. The previous version of rwsem_is_locked() was an inline static function while the new version is exported as a symbol which we can check for in module.symvers. Depending on the result we correctly implement the needed compatibility macros for proper spinlock handling. Finally, we do the right thing with spin locks in RW_*_HELD() by using the new compatibility macros. We only only acquire the semaphore's wait_lock if it is calling a rwsem_is_locked() that does not itself try to acquire the lock. Some new overhead and a small harmless race is introduced by this change. This is because RW_READ_HELD() and RW_WRITE_HELD() now acquire and release the wait_lock twice: once for the call to rwsem_is_locked() and once for the call to rw_owner(). This can't be avoided if calling a rwsem_is_locked() that takes the wait_lock, as it will in more recent kernels. The other case which only occurs in legacy kernels could be optimized by taking the lock only once, as was done prior to this commit. However, I decided that the performance gain probably wasn't significant enough to justify the messy special cases required. The function spl_rw_get_owner() was only used to enable the afore-mentioned optimization. Since it is no longer used, I removed it. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-08-10 22:01:46 +04:00
/* rwsem_is_locked() acquires sem->wait_lock */
#undef RWSEM_IS_LOCKED_TAKES_WAIT_LOCK
2008-11-27 00:26:05 +03:00
/* 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