From owner-freebsd-hackers@FreeBSD.ORG Fri May 8 21:41:19 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 569D01065670 for ; Fri, 8 May 2009 21:41:19 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id D8B638FC08 for ; Fri, 8 May 2009 21:41:18 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id A2AD31CCA7; Fri, 8 May 2009 23:41:17 +0200 (CEST) Date: Fri, 8 May 2009 23:41:17 +0200 From: Ed Schouten To: vasanth raonaik Message-ID: <20090508214117.GY58540@hoeg.nl> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wrbmJCjDMpeEYJph" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Cc: FreeBSD Hackers , jt@0xabadba.be Subject: Re: concurrent sysctl implementation 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: Fri, 08 May 2009 21:41:19 -0000 --wrbmJCjDMpeEYJph Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, * vasanth raonaik wrote: > Hello Jt, >=20 > I am a newbee in this alias. I am having a very basic question. It would = be > really good if you could give me some of this information. > Could you please elaborate on what is the current architecture of sysctl > implementation and How the concurrency would benefit us. Right now sysctl is synchronized using the sysctl lock. The problem is that certain sysctls just block for a very long time (especially some of the GEOM ones). We also call sysctl when we execute new processes, to obtain a random number for the stack protector. This means we have quite a lot of contention on it. This lock needs to be there, because sysctls can be added and removed on demand. I think I discussed this with John Baldwin (right?) and I think we also have the issue that we cannot allow an unbounded amount of concurrent calls to sysctl, because sysctl wires memory. A solution would be to solve it as follows: - Use a semaphore, initialized to some insane high value to put an upper limit on the amount of concurrent sysctl calls. I'm not sure whether this is really needed. Maybe this issue is not as serious as we think it is. - Use an rw/rm/sxlock to protect the sysctl tree, but only pick up the lock when we traverse parts of the sysctl tree that has dynamically created entries. --=20 Ed Schouten WWW: http://80386.nl/ --wrbmJCjDMpeEYJph Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkoEpv0ACgkQ52SDGA2eCwUhWQCeNfDTUrL1RV9JgxoWHfNDPeEP UwYAnRjuuIZe2F1m9EW5dZz8+pgwTxBT =wI4p -----END PGP SIGNATURE----- --wrbmJCjDMpeEYJph--