mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
By default disable extra KMEM and MUTEX debugging to aid performance.
They can easily be re-enabled when new stability issues are uncovered. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@105 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
This commit is contained in:
@@ -378,7 +378,9 @@ __kmem_cache_alloc(kmem_cache_t *cache, gfp_t flags)
|
||||
restart:
|
||||
rc = kmem_cache_alloc(cache, flags);
|
||||
if ((rc == NULL) && (flags & KM_SLEEP)) {
|
||||
#ifdef DEBUG_KMEM
|
||||
atomic64_inc(&kmem_cache_alloc_failed);
|
||||
#endif /* DEBUG_KMEM */
|
||||
GOTO(restart, rc);
|
||||
}
|
||||
|
||||
@@ -428,7 +430,9 @@ kmem_init(void)
|
||||
RETURN(0);
|
||||
}
|
||||
|
||||
static char *sprintf_addr(kmem_debug_t *kd, char *str, int len, int min)
|
||||
#ifdef DEBUG_KMEM
|
||||
static char *
|
||||
sprintf_addr(kmem_debug_t *kd, char *str, int len, int min)
|
||||
{
|
||||
int size = ((len - 1) < kd->kd_size) ? (len - 1) : kd->kd_size;
|
||||
int i, flag = 1;
|
||||
@@ -468,6 +472,7 @@ static char *sprintf_addr(kmem_debug_t *kd, char *str, int len, int min)
|
||||
|
||||
return str;
|
||||
}
|
||||
#endif /* DEBUG_KMEM */
|
||||
|
||||
void
|
||||
kmem_fini(void)
|
||||
|
||||
@@ -88,6 +88,12 @@ __spl_mutex_init(kmutex_t *mp, char *name, int type, void *ibc)
|
||||
return;
|
||||
}
|
||||
|
||||
/* XXX - This appears to be a much more contended lock than I
|
||||
* would have expected. To run with this debugging enabled and
|
||||
* get reasonable performance we may need to be more clever and
|
||||
* do something like hash the mutex ptr on to one of several
|
||||
* lists to ease this single point of contention.
|
||||
*/
|
||||
spin_lock(&mutex_stats_lock);
|
||||
list_add_tail(&mp->km_list, &mutex_stats_list);
|
||||
spin_unlock(&mutex_stats_lock);
|
||||
|
||||
@@ -325,6 +325,7 @@ proc_console_backoff(struct ctl_table *table, int write, struct file *filp,
|
||||
RETURN(rc);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_KMEM
|
||||
static int
|
||||
proc_doatomic64(struct ctl_table *table, int write, struct file *filp,
|
||||
void __user *buffer, size_t *lenp, loff_t *ppos)
|
||||
@@ -349,6 +350,7 @@ proc_doatomic64(struct ctl_table *table, int write, struct file *filp,
|
||||
|
||||
RETURN(rc);
|
||||
}
|
||||
#endif /* DEBUG_KMEM */
|
||||
|
||||
static int
|
||||
proc_dohostid(struct ctl_table *table, int write, struct file *filp,
|
||||
@@ -829,7 +831,9 @@ proc_init(void)
|
||||
|
||||
RETURN(rc);
|
||||
out2:
|
||||
#ifdef DEBUG_MUTEX
|
||||
remove_proc_entry("stats_per", proc_sys_spl_mutex);
|
||||
#endif /* DEBUG_MUTEX */
|
||||
out:
|
||||
unregister_sysctl_table(spl_header);
|
||||
#endif /* CONFIG_SYSCTL */
|
||||
@@ -843,7 +847,9 @@ proc_fini(void)
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
ASSERT(spl_header != NULL);
|
||||
#ifdef DEBUG_MUTEX
|
||||
remove_proc_entry("stats_per", proc_sys_spl_mutex);
|
||||
#endif /* DEBUG_MUTEX */
|
||||
unregister_sysctl_table(spl_header);
|
||||
#endif
|
||||
EXIT;
|
||||
|
||||
Reference in New Issue
Block a user