From owner-p4-projects@FreeBSD.ORG Tue Jun 27 18:45:09 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BE49016A52E; Tue, 27 Jun 2006 18:45:09 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99CD116A524 for ; Tue, 27 Jun 2006 18:45:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F0D643DC1 for ; Tue, 27 Jun 2006 18:45:09 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5RIj9NR085840 for ; Tue, 27 Jun 2006 18:45:09 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5RIj9bk085837 for perforce@freebsd.org; Tue, 27 Jun 2006 18:45:09 GMT (envelope-from jhb@freebsd.org) Date: Tue, 27 Jun 2006 18:45:09 GMT Message-Id: <200606271845.k5RIj9bk085837@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 100162 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2006 18:45:09 -0000 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