From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 10 13:30:40 2008 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 CBF541065672 for ; Wed, 10 Dec 2008 13:30:40 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 53AE88FC1E for ; Wed, 10 Dec 2008 13:30:40 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LAP97-0005lw-Lt for freebsd-hackers@freebsd.org; Wed, 10 Dec 2008 13:30:33 +0000 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Dec 2008 13:30:33 +0000 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Dec 2008 13:30:33 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Wed, 10 Dec 2008 14:30:24 +0100 Lines: 65 Message-ID: References: <863agws2bv.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig6EC81F27CD3BD473BFC4B047" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.18 (X11/20081125) In-Reply-To: <863agws2bv.fsf@ds4.des.no> X-Enigmail-Version: 0.95.0 Sender: news Subject: Re: MAXFILES in subr_param.c 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: Wed, 10 Dec 2008 13:30:40 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig6EC81F27CD3BD473BFC4B047 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Dag-Erling Sm=C3=B8rgrav wrote: > Ivan Voras writes: >> I'm looking at kern/subr_param.c: >> >> 72 #ifndef MAXFILES >> 73 #define MAXFILES (maxproc * 2) >> 74 #endif >> >> Shouldn't this be at least maxproc*3, for stdin,out,err for every proc= ? >=20 > Even maxproc * 3 won't be enough, unless none of your processes actuall= y > do anything.=20 > It's just an arbitrary value, based on the assumption that > you will never have maxproc concurrent processes anyway. Ok. >=20 >> Also, it looks like MAXFILES is used only once, and in a bit funny way= : >> >> 238 maxfiles =3D MAXFILES; >> 239 TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); >> 240 maxprocperuid =3D (maxproc * 9) / 10; >> 241 maxfilesperproc =3D (maxfiles * 9) / 10; >=20 > What's funny about it? MAXFILES is a macro used only once, where it resolves to (maxproc*2). It's not technically incorrect, but it looks like it adds noise. >> Historical reasons? >=20 > To a certain degree, yes; MAXFILES used to be a static limit which you > could only change in your kernel config. It is now a loader tunable > (though you can still change the default in your kernel config), so the= > MAXFILES macro was replaced with a maxfiles variable wherever it is > used, and the former is now only used to initialize the latter. Ok. --------------enig6EC81F27CD3BD473BFC4B047 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJP8RyldnAQVacBcgRAiifAKCSk5SrKVscHd7LyeT5D4P++Vpj3gCgtaob 5Zzgh2vQiBDT+DONfM7eKck= =BZWx -----END PGP SIGNATURE----- --------------enig6EC81F27CD3BD473BFC4B047--