From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 29 18:59:19 2005 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.org Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 701FD16A41F for ; Thu, 29 Sep 2005 18:59:19 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4492A43D6D for ; Thu, 29 Sep 2005 18:59:07 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from [10.50.41.233] (Not Verified[10.50.41.233]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Thu, 29 Sep 2005 15:15:03 -0400 From: John Baldwin To: "Poul-Henning Kamp" Date: Thu, 29 Sep 2005 14:55:58 -0400 User-Agent: KMail/1.8 References: <15314.1128017679@critter.freebsd.dk> In-Reply-To: <15314.1128017679@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509291455.59914.jhb@FreeBSD.org> Cc: freebsd-hackers@FreeBSD.org, Divacky Roman , Stanislav Sedov Subject: Re: dev_lock() question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2005 18:59:19 -0000 On Thursday 29 September 2005 02:14 pm, Poul-Henning Kamp wrote: > In message <200509291408.18098.jhb@FreeBSD.org>, John Baldwin writes: > >Actually, you would think that it could be initialized either via an early > >SYSINIT() or in the init_mutexes() function in kern_mutex.c and thus not > > need the early check and avoid penalizing dev_lock(). > > > >phk, how early his dev_lock needed? > > Far too early due to console madness (in syscons I belive). So would mutex_init() work? It's called very early in the MD startup code right after things like curthread are initialized. If dev_lock() is called before mutex_init() it can't work right anyway as mtx_init() doesn't work until then. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org