summaryrefslogtreecommitdiffstats
path: root/module/spl/spl-kmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/spl/spl-kmem.c')
-rw-r--r--module/spl/spl-kmem.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c
index e0d551041..1fdb61e6f 100644
--- a/module/spl/spl-kmem.c
+++ b/module/spl/spl-kmem.c
@@ -27,7 +27,6 @@
#include <sys/kmem.h>
#include <sys/vmem.h>
#include <linux/mm.h>
-#include <linux/ratelimit.h>
/*
* As a general rule kmem_alloc() allocations should be small, preferably
@@ -135,12 +134,6 @@ strfree(char *str)
EXPORT_SYMBOL(strfree);
/*
- * Limit the number of large allocation stack traces dumped to not more than
- * 5 every 60 seconds to prevent denial-of-service attacks from debug code.
- */
-DEFINE_RATELIMIT_STATE(kmem_alloc_ratelimit_state, 60 * HZ, 5);
-
-/*
* General purpose unified implementation of kmem_alloc(). It is an
* amalgamation of Linux and Illumos allocator design. It should never be
* exported to ensure that code using kmem_alloc()/kmem_zalloc() remains
@@ -160,7 +153,7 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
* through the vmem_alloc()/vmem_zalloc() interfaces.
*/
if ((spl_kmem_alloc_warn > 0) && (size > spl_kmem_alloc_warn) &&
- !(flags & KM_VMEM) && __ratelimit(&kmem_alloc_ratelimit_state)) {
+ !(flags & KM_VMEM)) {
printk(KERN_WARNING
"Large kmem_alloc(%lu, 0x%x), please file an issue at:\n"
"https://github.com/zfsonlinux/zfs/issues/new\n",
@@ -207,14 +200,6 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
continue;
}
- if (unlikely(__ratelimit(&kmem_alloc_ratelimit_state))) {
- printk(KERN_WARNING
- "Possible memory allocation deadlock: "
- "size=%lu lflags=0x%x",
- (unsigned long)size, lflags);
- dump_stack();
- }
-
/*
* Use cond_resched() instead of congestion_wait() to avoid
* deadlocking systems where there are no block devices.
@@ -535,9 +520,12 @@ spl_kmem_fini_tracking(struct list_head *list, spinlock_t *lock)
int
spl_kmem_init(void)
{
+
#ifdef DEBUG_KMEM
kmem_alloc_used_set(0);
+
+
#ifdef DEBUG_KMEM_TRACKING
spl_kmem_init_tracking(&kmem_list, &kmem_lock, KMEM_TABLE_SIZE);
#endif /* DEBUG_KMEM_TRACKING */