From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 27 04:05:19 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 53CB916A400 for ; Tue, 27 Mar 2007 04:05:19 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 3E5B813C458 for ; Tue, 27 Mar 2007 04:05:19 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 23D541A4D93; Mon, 26 Mar 2007 21:05:19 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id F1815513EB; Tue, 27 Mar 2007 00:05:17 -0400 (EDT) Date: Tue, 27 Mar 2007 00:05:17 -0400 From: Kris Kennaway To: Ed Schouten Message-ID: <20070327040517.GB47764@xor.obsecurity.org> References: <20070304141136.GA4935@stud.fit.vutbr.cz> <20070304175550.GA18397@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k1lZvvs/B4yU6o8G" Content-Disposition: inline In-Reply-To: <20070304175550.GA18397@hoeg.nl> User-Agent: Mutt/1.4.2.2i Cc: Divacky Roman , hackers@freebsd.org Subject: Re: investigation of Giant usage in kernel 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: Tue, 27 Mar 2007 04:05:19 -0000 --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 04, 2007 at 06:55:50PM +0100, Ed Schouten wrote: > Hello, >=20 > I took a grep on the kernel source and took a look to Giant usage as > well. I too have a question about locking in uipc_domain.c: >=20 > The file has a mutex, dom_mtx, which protects the 'domain list lock', > which could be declared static by the way. The strange thing is that it > isn't used to lock the domain list lock in any way. It is only used to > lock the domain_init_status variable. Wouldn't it be better to rename it > to something better? >=20 > The pf_proto_register() routine locks and unlocks Giant. It looks like > s/Giant/dom_mtx/ would be enough to remove the usage of Giant from > uipc_domain.c. This one doesn't seem to be a big deal because protocol registration is unlikely to happen in a critical path. i.e. a one-time Giant acquisition is completely irrelevant, it's the acquisitions that might happen hundreds or thousands of times a second in certain operational conditions that matter. I have updated the wiki with what seems to be a more or less complete list of the remaining Giant instances in the kernel: http://wiki.freebsd.org/SMPTODO Apart from some subsystems (ttys are the main one), and excluding the items that are being actively worked on (e.g. CAM), there is not much Giant left. Kris --k1lZvvs/B4yU6o8G Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGCJf9Wry0BWjoQKURArXTAKC5LPaJxFvOKAFe4HUaeOPO9F16FwCfb32G FQ7PY86X2IUNaSTx0FsQMkY= =QgAK -----END PGP SIGNATURE----- --k1lZvvs/B4yU6o8G--