diff options
author | markj <markj@FreeBSD.org> | 2013-10-08 12:56:46 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2013-10-08 12:56:46 +0000 |
commit | 4e3872abc7d06e32c81c7d991a15245489dfa749 (patch) | |
tree | 0ac019beee24414f3072bb5d72839a91ed0b4571 /sys/cddl/contrib/opensolaris/uts | |
parent | 66c01d36f385e2199625a2464868668ab1a69ba8 (diff) | |
download | FreeBSD-src-4e3872abc7d06e32c81c7d991a15245489dfa749.zip FreeBSD-src-4e3872abc7d06e32c81c7d991a15245489dfa749.tar.gz |
Initialize and free the DTrace taskqueue in the dtrace module load/unload
handlers rather than in the dtrace device open/close methods. The current
approach can cause a panic if the device is closed which the taskqueue
thread is active, or if a kernel module containing a provider is unloaded
while retained enablings are present and the dtrace device isn't opened.
Submitted by: gibbs (original version)
Reviewed by: gibbs
Approved by: re (glebius)
MFC after: 2 weeks
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index babc42c..dae6dba 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -15751,10 +15751,6 @@ dtrace_open(struct cdev *dev, int oflags, int devtype, struct thread *td) #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_dtr(void *data) (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); |