summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_thread.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2007-07-27 09:21:18 +0000
committerattilio <attilio@FreeBSD.org>2007-07-27 09:21:18 +0000
commitc2dedaa0a97d92108e28cc25b06bf5442d7488e9 (patch)
tree5ce631f90c03f140488b25b2b959bec880345b06 /sys/kern/kern_thread.c
parentfec5a725735c325ad4cc919954caed39059983c6 (diff)
downloadFreeBSD-src-c2dedaa0a97d92108e28cc25b06bf5442d7488e9.zip
FreeBSD-src-c2dedaa0a97d92108e28cc25b06bf5442d7488e9.tar.gz
Actually, upcalls cannot be freed while destroying the thread because we
should call uma_zfree() with various spinlock helds. Rearranging the code would not help here because we cannot break atomicity respect prcess spinlock, so the only one choice we have is to defer the operation. In order to do this use a global queue synchronized through the kse_lock spinlock which is freed at any thread_alloc() / thread_wait() through a call to thread_reap(). Note that this approach is not ideal as we should want a per-process list of zombie upcalls, but it follows initial guidelines of KSE authors. Tested by: jkim, pav Approved by: jeff, julian Approved by: re
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r--sys/kern/kern_thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index e06d18c..f12e724 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -299,6 +299,9 @@ thread_reap(void)
td_first = td_next;
}
}
+#ifdef KSE
+ upcall_reap();
+#endif
}
/*
OpenPOWER on IntegriCloud