From owner-freebsd-arch@FreeBSD.ORG Tue Apr 1 04:26:23 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 001D537B401 for ; Tue, 1 Apr 2003 04:26:22 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9EBCB43F75 for ; Tue, 1 Apr 2003 04:26:21 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id WAA00610; Tue, 1 Apr 2003 22:25:58 +1000 Date: Tue, 1 Apr 2003 22:25:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Poul-Henning Kamp In-Reply-To: <31464.1049185350@critter.freebsd.dk> Message-ID: <20030401222002.S22396@gamplex.bde.org> References: <31464.1049185350@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: #include and X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2003 12:26:23 -0000 On Tue, 1 Apr 2003, Poul-Henning Kamp wrote: > As we progress down the path of SMPng we will need to include > and in more and more files. > > The current score, not counting nested include cases, they currently > are included approx 16% and 19% of all .c files under /sys. > > My present predicament is that I will probably put a mutex in the > bio queue which is defined in , and so far, I've found > 20 .c files where I need to add and and > I am not yet at a point where LINT compiles. > > Do we have a plan for these in the future ? I can see three obvious > options: We've mostly followed this plan for the last 23 months: % RCS file: /home/ncvs/src/sys/sys/_mutex.h,v % Working file: _mutex.h % head: 1.9 % ... % ---------------------------- % revision 1.1 % date: 2001/05/01 08:13:17; author: markm; state: Exp; % Undo part of the tangle of having sys/lock.h and sys/mutex.h included in % other "system" header files. % % Also help the deprecation of lockmgr.h by making it a sub-include of % sys/lock.h and removing sys/lockmgr.h form kernel .c files. % % Sort sys/*.h includes where possible in affected files. % % OK'ed by: bde (with reservations) % ---------------------------- *.h should include and its prerequisite if any mutexes are declared, and *.c should include and its prerequisite if any mutext is used (other than to assign it). *.h may hide some of the details using macros like PROC_LOCK(), but should not include primary headers like to do so. Bruce