Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jun 2006 18:45:09 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 100162 for review
Message-ID:  <200606271845.k5RIj9bk085837@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=100162

Change 100162 by jhb@jhb_mutex on 2006/06/27 18:44:32

	- Grab Giant around sysinit's as we don't know if they are all
	  safe yet.
	- Actually remove Giant from the kernel linker (grrrr).

Affected files ...

.. //depot/projects/smpng/sys/kern/kern_linker.c#77 edit

Differences ...

==== //depot/projects/smpng/sys/kern/kern_linker.c#77 (text+ko) ====

@@ -62,10 +62,13 @@
 int kld_debug = 0;
 #endif
 
-#define	KLD_LOCK()		do { sx_xlock(&kld_sx); mtx_lock(&Giant); } while (0)
-#define	KLD_UNLOCK()		do { mtx_unlock(&Giant); sx_xunlock(&kld_sx); } while (0)
+#define	KLD_LOCK()		sx_xlock(&kld_sx)
+#define	KLD_UNLOCK()		sx_xunlock(&kld_sx)
 #define	KLD_LOCKED()		sx_xlocked(&kld_sx)
-#define	KLD_LOCK_ASSERT()	do { if (!cold) sx_assert(&kld_sx, SX_XLOCKED); } while (0)
+#define	KLD_LOCK_ASSERT() do {						\
+	if (!cold)							\
+		sx_assert(&kld_sx, SX_XLOCKED);				\
+} while (0)
 
 /*
  * static char *linker_search_path(const char *name, struct mod_depend
@@ -212,6 +215,7 @@
 	 * Traverse the (now) ordered list of system initialization tasks.
 	 * Perform each task, and continue on to the next task.
 	 */
+	mtx_lock(&Giant);
 	for (sipp = start; sipp < stop; sipp++) {
 		if ((*sipp)->subsystem == SI_SUB_DUMMY)
 			continue;	/* skip dummy task(s) */
@@ -219,6 +223,7 @@
 		/* Call function */
 		(*((*sipp)->func)) ((*sipp)->udata);
 	}
+	mtx_unlock(&Giant);
 }
 
 static void
@@ -256,6 +261,7 @@
 	 * Traverse the (now) ordered list of system initialization tasks.
 	 * Perform each task, and continue on to the next task.
 	 */
+	mtx_lock(&Giant);
 	for (sipp = start; sipp < stop; sipp++) {
 		if ((*sipp)->subsystem == SI_SUB_DUMMY)
 			continue;	/* skip dummy task(s) */
@@ -263,6 +269,7 @@
 		/* Call function */
 		(*((*sipp)->func)) ((*sipp)->udata);
 	}
+	mtx_unlock(&Giant);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606271845.k5RIj9bk085837>