Date: Sat, 22 Apr 2006 02:48:54 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 95853 for review Message-ID: <200604220248.k3M2msiZ085643@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95853 Change 95853 by jb@jb_freebsd2 on 2006/04/22 02:48:24 Use the custom mutex implementation. Use our you-beaut-vmem-smoke-and-mirrors hack. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_load.c#4 edit .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_unload.c#4 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_load.c#4 (text+ko) ==== @@ -41,8 +41,8 @@ * XXX This is a short term hack to avoid having to comment * out lots and lots of lock/unlock calls. */ - mtx_init(&cpu_lock,"XXX hack",NULL,MTX_RECURSE | MTX_NOWITNESS); - mtx_init(&mod_lock,"XXX hack",NULL,MTX_RECURSE | MTX_NOWITNESS); + dtrace_mutex_init(&cpu_lock,"XXX cpu_lock hack"); + dtrace_mutex_init(&mod_lock,"XXX mod_lock hack"); /* * Initialise the mutexes without 'witness' because the dtrace @@ -52,9 +52,9 @@ * low memory situation. And that low memory situation might be * the very problem we are trying to trace. */ - mtx_init(&dtrace_lock,"dtrace probe state",NULL,MTX_RECURSE | MTX_NOWITNESS); - mtx_init(&dtrace_provider_lock,"dtrace provider state",NULL,MTX_RECURSE | MTX_NOWITNESS); - mtx_init(&dtrace_meta_lock,"dtrace meta-provider state",NULL,MTX_RECURSE | MTX_NOWITNESS); + dtrace_mutex_init(&dtrace_lock,"dtrace probe state"); + dtrace_mutex_init(&dtrace_provider_lock,"dtrace provider state"); + dtrace_mutex_init(&dtrace_meta_lock,"dtrace meta-provider state"); /* Create the /dev/dtrace entry. */ dtrace_dev = make_dev(&dtrace_cdevsw, DTRACE_MINOR, UID_ROOT, @@ -105,12 +105,14 @@ register_cpu_setup_func((cpu_setup_func_t *)dtrace_cpu_setup, NULL); ASSERT(MUTEX_HELD(&cpu_lock)); +#endif dtrace_arena = vmem_create("dtrace", (void *)1, UINT32_MAX, 1, NULL, NULL, NULL, 0, VM_SLEEP | VMC_IDENTIFIER); dtrace_minor = vmem_create("dtrace_minor", (void *)DTRACEMNRN_CLONE, UINT32_MAX - DTRACEMNRN_CLONE, 1, NULL, NULL, NULL, 0, VM_SLEEP | VMC_IDENTIFIER); +#ifdef DOODAD dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, 1, INT_MAX, 0); ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_unload.c#4 (text+ko) ==== @@ -108,9 +108,9 @@ #ifdef DOODAD kmem_cache_destroy(dtrace_state_cache); +#endif vmem_destroy(dtrace_minor); vmem_destroy(dtrace_arena); -#endif if (dtrace_toxrange != NULL) { free(dtrace_toxrange, M_DTRACE); @@ -130,8 +130,8 @@ ASSERT(dtrace_opens == 0); ASSERT(dtrace_retained == NULL); - mtx_unlock(&dtrace_lock); - mtx_unlock(&dtrace_provider_lock); + mutex_exit(&dtrace_lock); + mutex_exit(&dtrace_provider_lock); /* * We don't destroy the task queue until after we have dropped our @@ -149,13 +149,13 @@ /* Destroy the /dev/dtrace entry. */ destroy_dev(dtrace_dev); - mtx_destroy(&dtrace_meta_lock); - mtx_destroy(&dtrace_provider_lock); - mtx_destroy(&dtrace_lock); + dtrace_mutex_destroy(&dtrace_meta_lock); + dtrace_mutex_destroy(&dtrace_provider_lock); + dtrace_mutex_destroy(&dtrace_lock); /* XXX Hack */ - mtx_destroy(&cpu_lock); - mtx_destroy(&mod_lock); + dtrace_mutex_destroy(&cpu_lock); + dtrace_mutex_destroy(&mod_lock); return (error); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604220248.k3M2msiZ085643>