From owner-p4-projects@FreeBSD.ORG Sat Apr 22 02:48:55 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5A7EF16A405; Sat, 22 Apr 2006 02:48:55 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 217B416A402 for ; Sat, 22 Apr 2006 02:48:55 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF71F43D45 for ; Sat, 22 Apr 2006 02:48:54 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k3M2msdf085646 for ; Sat, 22 Apr 2006 02:48:54 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3M2msiZ085643 for perforce@freebsd.org; Sat, 22 Apr 2006 02:48:54 GMT (envelope-from jb@freebsd.org) Date: Sat, 22 Apr 2006 02:48:54 GMT Message-Id: <200604220248.k3M2msiZ085643@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 95853 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Apr 2006 02:48:55 -0000 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); }