From owner-p4-projects@FreeBSD.ORG Thu Aug 27 08:13:22 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 344511065693; Thu, 27 Aug 2009 08:13:22 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED242106568B for ; Thu, 27 Aug 2009 08:13:21 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DC70D8FC2D for ; Thu, 27 Aug 2009 08:13:21 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n7R8DLDW093563 for ; Thu, 27 Aug 2009 08:13:21 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n7R8DLfx093561 for perforce@freebsd.org; Thu, 27 Aug 2009 08:13:21 GMT (envelope-from zec@fer.hr) Date: Thu, 27 Aug 2009 08:13:21 GMT Message-Id: <200908270813.n7R8DLfx093561@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 167873 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: Thu, 27 Aug 2009 08:13:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=167873 Change 167873 by zec@zec_tpx32 on 2009/08/27 08:13:11 Push VNET_SYSINIT locking inside vnet_sysinit() and vnet_sysuninit() functions. Suggested by: jhb Affected files ... .. //depot/projects/vimage-commit2/src/sys/net/vnet.c#7 edit Differences ... ==== //depot/projects/vimage-commit2/src/sys/net/vnet.c#7 (text+ko) ==== @@ -247,9 +247,7 @@ /* Initialize / attach vnet module instances. */ CURVNET_SET_QUIET(vnet); - VNET_SYSINIT_RLOCK(); vnet_sysinit(); - VNET_SYSINIT_RUNLOCK(); CURVNET_RESTORE(); VNET_LIST_WLOCK(); @@ -282,9 +280,7 @@ if_vmove(ifp, ifp->if_home_vnet); } - VNET_SYSINIT_RLOCK(); vnet_sysuninit(); - VNET_SYSINIT_RUNLOCK(); CURVNET_RESTORE(); /* @@ -607,10 +603,11 @@ { struct vnet_sysinit *vs; - sx_assert(&vnet_sysinit_sxlock, SA_LOCKED); + VNET_SYSINIT_RLOCK(); TAILQ_FOREACH(vs, &vnet_constructors, link) { vs->func(vs->arg); } + VNET_SYSINIT_RUNLOCK(); } /* @@ -623,11 +620,12 @@ { struct vnet_sysinit *vs; - sx_assert(&vnet_sysinit_sxlock, SA_LOCKED); + VNET_SYSINIT_RLOCK(); TAILQ_FOREACH_REVERSE(vs, &vnet_destructors, vnet_sysuninit_head, link) { vs->func(vs->arg); } + VNET_SYSINIT_RUNLOCK(); } #ifdef DDB