From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:33:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C91F24C; Mon, 17 Feb 2014 13:33:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D89411E5; Mon, 17 Feb 2014 13:33:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDXhsH063394; Mon, 17 Feb 2014 13:33:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDXgIs063390; Mon, 17 Feb 2014 13:33:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171333.s1HDXgIs063390@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r262053 - in stable/9/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:33:43 -0000 Author: avg Date: Mon Feb 17 13:33:42 2014 New Revision: 262053 URL: http://svnweb.freebsd.org/changeset/base/262053 Log: MFC r256148: Initialize and free the DTrace taskqueue in the dtrace module load/unload handlers Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/9/sys/cddl/dev/dtrace/dtrace_load.c stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:29:48 2014 (r262052) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:33:42 2014 (r262053) @@ -15754,10 +15754,6 @@ dtrace_open(struct cdev *dev, int oflags #else devfs_set_cdevpriv(state, dtrace_dtr); #endif - /* This code actually belongs in dtrace_attach() */ - if (dtrace_opens == 1) - dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, - 1, INT_MAX, 0); #endif mutex_exit(&cpu_lock); @@ -15842,11 +15838,6 @@ dtrace_close(struct cdev *dev, int flags (void) kdi_dtrace_set(KDI_DTSET_DTRACE_DEACTIVATE); #else --dtrace_opens; - /* This code actually belongs in dtrace_detach() */ - if ((dtrace_opens == 0) && (dtrace_taskq != NULL)) { - taskq_destroy(dtrace_taskq); - dtrace_taskq = NULL; - } #endif mutex_exit(&dtrace_lock); Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:29:48 2014 (r262052) +++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:33:42 2014 (r262053) @@ -56,6 +56,8 @@ dtrace_load(void *dummy) /* Hang our hook for exceptions. */ dtrace_invop_init(); + dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, 0, 0, 0); + /* Register callbacks for linker file load and unload events. */ dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY); Modified: stable/9/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:29:48 2014 (r262052) +++ stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:33:42 2014 (r262053) @@ -127,6 +127,8 @@ dtrace_unload() mutex_destroy(&dtrace_errlock); #endif + taskq_destroy(dtrace_taskq); + /* Reset our hook for exceptions. */ dtrace_invop_uninit();