From 844e14d34c660ae3316c0898ce66c64964f2c540 Mon Sep 17 00:00:00 2001 From: Peter Holm Date: Tue, 20 Aug 2013 11:06:56 +0000 Subject: [PATCH] Added sysctl to turn off calls to vmem_check(). Sponsored by: EMC / Isilon storage division Discussed with: jeff --- sys/kern/subr_vmem.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_vmem.c b/sys/kern/subr_vmem.c index fc431e642798..f3f3eecee93d 100644 --- a/sys/kern/subr_vmem.c +++ b/sys/kern/subr_vmem.c @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -167,6 +168,9 @@ struct vmem_btag { #define BT_END(bt) ((bt)->bt_start + (bt)->bt_size - 1) #if defined(DIAGNOSTIC) +static int enable_vmem_check = 1; +SYSCTL_INT(_debug, OID_AUTO, vmem_check, CTLFLAG_RW, + &enable_vmem_check, 0, "Enable vmem check"); static void vmem_check(vmem_t *); #endif @@ -720,9 +724,11 @@ vmem_periodic(void *unused, int pending) LIST_FOREACH(vm, &vmem_list, vm_alllist) { #ifdef DIAGNOSTIC /* Convenient time to verify vmem state. */ - VMEM_LOCK(vm); - vmem_check(vm); - VMEM_UNLOCK(vm); + if (enable_vmem_check == 1) { + VMEM_LOCK(vm); + vmem_check(vm); + VMEM_UNLOCK(vm); + } #endif desired = 1 << flsl(vm->vm_nbusytag); desired = MIN(MAX(desired, VMEM_HASHSIZE_MIN),