]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Merge branch 'upstream'
authorDarik Horn <dajhorn@vanadac.com>
Tue, 11 Sep 2012 21:12:20 +0000 (16:12 -0500)
committerDarik Horn <dajhorn@vanadac.com>
Tue, 11 Sep 2012 21:12:20 +0000 (16:12 -0500)
.gitignore
include/sys/kmem.h
module/spl/spl-condvar.c
module/spl/spl-kmem.c
module/spl/spl-zlib.c
spl_config.h.in [deleted file]

index 868c81917051f409d809fa17de58b7c05db795e1..94308186f4cacf2390e6e25f91fb96c33aa9fccc 100644 (file)
@@ -39,6 +39,7 @@ Makefile.in
 /config.status
 /libtool
 /spl_config.h
+/spl_config.h.in
 /spl.spec
 /spl-modules.spec
 /spl.release
index 116d6db0df222ea28543afb897565592f8dda398..0149e754c33c7ac7031e4f29afb8fd4fba4b550a 100644 (file)
@@ -340,6 +340,7 @@ enum {
        KMC_BIT_KMEM            = 5,    /* Use kmem cache */
        KMC_BIT_VMEM            = 6,    /* Use vmem cache */
        KMC_BIT_OFFSLAB         = 7,    /* Objects not on slab */
+       KMC_BIT_NOEMERGENCY     = 8,    /* Disable emergency objects */
        KMC_BIT_GROWING         = 15,   /* Growing in progress */
        KMC_BIT_REAPING         = 16,   /* Reaping in progress */
        KMC_BIT_DESTROY         = 17,   /* Destroy in progress */
@@ -365,6 +366,7 @@ typedef enum kmem_cbrc {
 #define KMC_KMEM               (1 << KMC_BIT_KMEM)
 #define KMC_VMEM               (1 << KMC_BIT_VMEM)
 #define KMC_OFFSLAB            (1 << KMC_BIT_OFFSLAB)
+#define KMC_NOEMERGENCY                (1 << KMC_BIT_NOEMERGENCY)
 #define KMC_GROWING            (1 << KMC_BIT_GROWING)
 #define KMC_REAPING            (1 << KMC_BIT_REAPING)
 #define KMC_DESTROY            (1 << KMC_BIT_DESTROY)
index 52131c1e8788dfe08cd0ea715e8e8e5aa8ef752a..e9f727d72dbbc13b797df3c53cb7054e4b889489 100644 (file)
@@ -63,7 +63,8 @@ EXPORT_SYMBOL(__cv_init);
 static int
 cv_destroy_wakeup(kcondvar_t *cvp)
 {
-       if ((waitqueue_active(&cvp->cv_event)) ||
+       if ((cvp->cv_mutex != NULL) ||
+           (waitqueue_active(&cvp->cv_event)) ||
            (atomic_read(&cvp->cv_waiters) > 0))
                return 0;
 
@@ -81,9 +82,9 @@ __cv_destroy(kcondvar_t *cvp)
        while (cv_destroy_wakeup(cvp) == 0)
                wait_event_timeout(cvp->cv_destroy, cv_destroy_wakeup(cvp), 1);
 
-       ASSERT(cvp->cv_mutex == NULL);
-       ASSERT(atomic_read(&cvp->cv_waiters) == 0);
-       ASSERT(!waitqueue_active(&cvp->cv_event));
+       ASSERT3P(cvp->cv_mutex, ==, NULL);
+       ASSERT3S(atomic_read(&cvp->cv_waiters), ==, 0);
+       ASSERT3S(waitqueue_active(&cvp->cv_event), ==, 0);
 
        SEXIT;
 }
index e07e08c911086d1dfc3ff9032d7bc90556c9d8ed..eca809c4776a192dbbfc64bb8d1e1e8fa8851e2d 100644 (file)
@@ -1727,8 +1727,13 @@ spl_cache_grow(spl_kmem_cache_t *skc, int flags, void **obj)
         */
        remaining = wait_event_timeout(skc->skc_waitq,
                                       spl_cache_grow_wait(skc), 1);
-       if (remaining == 0)
-               rc = spl_emergency_alloc(skc, flags, obj);
+
+       if (remaining == 0) {
+               if (test_bit(KMC_BIT_NOEMERGENCY, &skc->skc_flags))
+                       rc = -ENOMEM;
+               else
+                       rc = spl_emergency_alloc(skc, flags, obj);
+       }
 
        SRETURN(rc);
 }
index 7bed00ca46495c90b57347fbfab50c25c3ccd8b9..4f88cb4e05db00f9b45db60fefe8201c56fad293 100644 (file)
@@ -205,8 +205,10 @@ spl_zlib_init(void)
        size = MAX(spl_zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL),
            zlib_inflate_workspacesize());
 
-       zlib_workspace_cache = kmem_cache_create("spl_zlib_workspace_cache",
-           size, 0, NULL, NULL, NULL, NULL, NULL, KMC_VMEM);
+       zlib_workspace_cache = kmem_cache_create(
+           "spl_zlib_workspace_cache",
+           size, 0, NULL, NULL, NULL, NULL, NULL,
+           KMC_VMEM | KMC_NOEMERGENCY);
         if (!zlib_workspace_cache)
                SRETURN(1);
 
diff --git a/spl_config.h.in b/spl_config.h.in
deleted file mode 100644 (file)
index 29093c2..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-/* spl_config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Atomic types use spinlocks */
-#undef ATOMIC_SPINLOCK
-
-/* Define to 1 to enable basic kmem accounting */
-#undef DEBUG_KMEM
-
-/* Define to 1 to enable detailed kmem tracking */
-#undef DEBUG_KMEM_TRACKING
-
-/* Define to 1 to enable basic debug logging */
-#undef DEBUG_LOG
-
-/* 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_fsync() wants 2 args */
-#undef HAVE_2ARGS_VFS_FSYNC
-
-/* vfs_unlink() wants 2 args */
-#undef HAVE_2ARGS_VFS_UNLINK
-
-/* zlib_deflate_workspacesize() wants 2 args */
-#undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
-
-/* 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
-
-/* __clear_close_on_exec() is available */
-#undef HAVE_CLEAR_CLOSE_ON_EXEC
-
-/* 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
-
-/* 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
-
-/* invalidate_inodes_check() is available */
-#undef HAVE_INVALIDATE_INODES_CHECK
-
-/* kallsyms_lookup_name() is available */
-#undef HAVE_KALLSYMS_LOOKUP_NAME
-
-/* kern_path_parent() is available */
-#undef HAVE_KERN_PATH_PARENT_HEADER
-
-/* kern_path_parent() is available */
-#undef HAVE_KERN_PATH_PARENT_SYMBOL
-
-/* 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
-
-/* 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
-
-/* __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() is available */
-#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
-
-/* vfs_fsync() is available */
-#undef HAVE_VFS_FSYNC
-
-/* 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
-
-/* 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
-
-/* rwsem_is_locked() acquires sem->wait_lock */
-#undef RWSEM_IS_LOCKED_TAKES_WAIT_LOCK
-
-/* struct rw_semaphore member wait_lock is raw_spinlock_t */
-#undef RWSEM_SPINLOCK_IS_RAW
-
-/* 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