From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 13 08:23:20 2003 Return-Path: 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 07DCC37B401; Sun, 13 Jul 2003 08:23:20 -0700 (PDT) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A7B843F3F; Sun, 13 Jul 2003 08:23:19 -0700 (PDT) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id 3FE783ABB4D; Sun, 13 Jul 2003 17:28:46 +0200 (CEST) Date: Sun, 13 Jul 2003 17:28:46 +0200 From: Pawel Jakub Dawidek To: freebsd-hackers@freebsd.org Message-ID: <20030713152846.GT4973@garage.freebsd.pl> References: <20030629071211.GR7587@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="+xp03240ql3JIIXA" Content-Disposition: inline In-Reply-To: <20030629071211.GR7587@garage.freebsd.pl> X-PGP-Key-URL: http://garage.freebsd.pl/jules.asc X-OS: FreeBSD 4.8-RELEASE i386 X-URL: http://garage.freebsd.pl User-Agent: Mutt/1.5.1i cc: abial@freebsd.org Subject: Re: Sysctls and mutexes. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2003 15:23:20 -0000 --+xp03240ql3JIIXA Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 29, 2003 at 09:12:11AM +0200, Pawel Jakub Dawidek wrote: +> I want to discuss two things about sysctls. [...] +> 2. Secound thing. I'm wondering if there is no need to and one more field +> to those macros: mutex that protects given value. Then standard funct= ions +> sysctl_handle_*() could use those mutexes when accessing to those val= ues. +>=20 +> Look at sysctl creation in /sys/dev/sound/pcm/mixer.c in function +> mixer_hwvol_init() or at sysctls in /sys/kern/kern_jail.c and many others +> as I susspect. +>=20 +> There is no need to break anything. We could create for now new macros: +> SYSCTL_ADD_INT_MTX(), etc. that will create int sysctl, but with informa= tion +> about its mutex. We should also teach sysctl_handle_int and friends how = to +> lock those mutexes and that they should ignore locking when this field i= s NULL. Ok, I've prepared a patch for this: http://www.freebsd.org/cgi/query-pr.cgi?pr=3D54439 Could someone review it, please? --=20 Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net --+xp03240ql3JIIXA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBPxF6rj/PhmMH/Mf1AQHTlgP8D+XJlX8qkK2NF84rZRVrWhnaBFhnBnMj 5IYbIf8kv4ZfCgGRiE88cAMAIe+kG2m9vza7MSck6tFl0C9Xrkf2Je5UpquyMYk8 fJPg79I2OtSoq4/FRz9naB0T6Utxk30cCeQbMhnzuNT9U/xsNqc7Gx+P8k6i8/Rp T7s4i28dt3A= =9Wxh -----END PGP SIGNATURE----- --+xp03240ql3JIIXA--