summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-05-09 21:21:33 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-05-09 21:21:33 +0000
commit5c2bb9b2c314bcac7579b13a99127eb7050a7b90 (patch)
tree6edcab31dbab47846d89fe03349c8a5c0a2b25c3 /include
parent04a479f7066ccdaa23a6546955303b172f4a6909 (diff)
Stability hack. Under Solaris when KM_SLEEP is set kmem_cache_alloc()
may not fail. To get this behavior I'd added a retry to the shim layer even though it is abusive to the VM, at least it should prevent the crash. Additionally I added a proc counter so I can easily check how often this is happening. It should be fairly rare, but likely will get worse and worse the longer the machine has been up. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@104 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include')
-rw-r--r--include/sys/kmem.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/sys/kmem.h b/include/sys/kmem.h
index d67e4f2a2..1dfc0bf1e 100644
--- a/include/sys/kmem.h
+++ b/include/sys/kmem.h
@@ -32,7 +32,9 @@ extern atomic64_t kmem_alloc_used;
extern unsigned long kmem_alloc_max;
extern atomic64_t vmem_alloc_used;
extern unsigned long vmem_alloc_max;
+
extern int kmem_warning_flag;
+extern atomic64_t kmem_cache_alloc_failed;
#define KMEM_HASH_BITS 10
#define KMEM_TABLE_SIZE (1 << KMEM_HASH_BITS)
@@ -351,11 +353,9 @@ __kmem_cache_create(char *name, size_t size, size_t align,
kmem_reclaim_t reclaim,
void *priv, void *vmp, int flags);
-int
-extern __kmem_cache_destroy(kmem_cache_t *cache);
-
-void
-extern __kmem_reap(void);
+extern int __kmem_cache_destroy(kmem_cache_t *cache);
+extern void *__kmem_cache_alloc(kmem_cache_t *cache, gfp_t flags);
+extern void __kmem_reap(void);
int kmem_init(void);
void kmem_fini(void);
@@ -363,7 +363,7 @@ void kmem_fini(void);
#define kmem_cache_create(name,size,align,ctor,dtor,rclm,priv,vmp,flags) \
__kmem_cache_create(name,size,align,ctor,dtor,rclm,priv,vmp,flags)
#define kmem_cache_destroy(cache) __kmem_cache_destroy(cache)
-#define kmem_cache_alloc(cache, flags) kmem_cache_alloc(cache, flags)
+#define kmem_cache_alloc(cache, flags) __kmem_cache_alloc(cache, flags)
#define kmem_cache_free(cache, ptr) kmem_cache_free(cache, ptr)
#define kmem_cache_reap_now(cache) kmem_cache_shrink(cache)
#define kmem_reap() __kmem_reap()