changeset 4036:9db83fcc6245

5078264 assertion failure: proc_pageout != NULL, file: ../../common/vm/vm_page.c
author praks
date Sun, 15 Apr 2007 10:15:53 -0700
parents 4874e0752050
children 9f7507400a7b
files usr/src/uts/common/disp/thread.c usr/src/uts/common/os/main.c
diffstat 2 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/disp/thread.c	Sat Apr 14 18:08:01 2007 -0700
+++ b/usr/src/uts/common/disp/thread.c	Sun Apr 15 10:15:53 2007 -0700
@@ -123,6 +123,8 @@
  */
 static void *tsd_realloc(void *, size_t, size_t);
 
+void thread_reaper(void);
+
 /*ARGSUSED*/
 static int
 turnstile_constructor(void *buf, void *cdrarg, int kmflags)
@@ -268,6 +270,13 @@
 	CALLB_CPR_INIT_SAFE(tp, "idle");
 
 	/*
+	 * Create the thread_reaper daemon. From this point on, exited
+	 * threads will get reaped.
+	 */
+	(void) thread_create(NULL, 0, (void (*)())thread_reaper,
+	    NULL, 0, &p0, TS_RUN, minclsyspri);
+
+	/*
 	 * Finish initializing the kernel memory allocator now that
 	 * thread_create() is available.
 	 */
--- a/usr/src/uts/common/os/main.c	Sat Apr 14 18:08:01 2007 -0700
+++ b/usr/src/uts/common/os/main.c	Sun Apr 15 10:15:53 2007 -0700
@@ -352,7 +352,6 @@
 	int		(**initptr)();
 	extern void	sched();
 	extern void	fsflush();
-	extern void	thread_reaper();
 	extern int	(*init_tbl[])();
 	extern int	(*mp_init_tbl[])();
 	extern id_t	syscid, defaultcid;
@@ -386,6 +385,11 @@
 	 */
 	lgrp_setup();
 
+	/*
+	 * Once 'startup()' completes, the thread_reaper() daemon would be
+	 * created(in thread_init()). After that, it is safe to create threads
+	 * that could exit. These exited threads will get reaped.
+	 */
 	startup();
 	segkmem_gc();
 	callb_init();
@@ -572,10 +576,6 @@
 	 * Create system threads (threads are associated with p0)
 	 */
 
-	/* create thread_reaper daemon */
-	(void) thread_create(NULL, 0, (void (*)())thread_reaper,
-	    NULL, 0, &p0, TS_RUN, minclsyspri);
-
 	/* create module uninstall daemon */
 	/* BugID 1132273. If swapping over NFS need a bigger stack */
 	(void) thread_create(NULL, 0, (void (*)())mod_uninstall_daemon,