summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_thread.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-07-07 23:05:27 +0000
committerpeter <peter@FreeBSD.org>2002-07-07 23:05:27 +0000
commitb73c441dad47d23a66fa7545b63e35e625225808 (patch)
tree74cd2868c7e5812fca8fc59540abac90c945c633 /sys/kern/kern_thread.c
parent9c4815fb2170a6fe82ab28145f6a5d1f8741df10 (diff)
downloadFreeBSD-src-b73c441dad47d23a66fa7545b63e35e625225808.zip
FreeBSD-src-b73c441dad47d23a66fa7545b63e35e625225808.tar.gz
Collect all the (now equivalent) pmap_new_proc/pmap_dispose_proc/
pmap_swapin_proc/pmap_swapout_proc functions from the MD pmap code and use a single equivalent MI version. There are other cleanups needed still. While here, use the UMA zone hooks to keep a cache of preinitialized proc structures handy, just like the thread system does. This eliminates one dependency on 'struct proc' being persistent even after being freed. There are some comments about things that can be factored out into ctor/dtor functions if it is worth it. For now they are mostly just doing statistics to get a feel of how it is working.
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r--sys/kern/kern_thread.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 751dd70..ee7a252 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -97,6 +97,16 @@ thread_ctor(void *mem, int size, void *arg)
(unsigned)RANGEOF(struct thread, td_startzero, td_endzero));
td->td_state = TDS_NEW;
td->td_flags |= TDF_UNBOUND;
+#if 0
+ /*
+ * Maybe move these here from process creation, but maybe not.
+ * Moving them here takes them away from their "natural" place
+ * in the fork process.
+ */
+ /* XXX td_contested does not appear to be initialized for threads! */
+ LIST_INIT(&td->td_contested);
+ callout_init(&td->td_slpcallout, 1);
+#endif
cached_threads--; /* XXXSMP */
active_threads++; /* XXXSMP */
}
OpenPOWER on IntegriCloud