From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 10 15:02:41 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 AC688106564A; Wed, 10 Dec 2008 15:02:41 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 288E18FC08; Wed, 10 Dec 2008 15:02:40 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl22-219.kln.forthnet.gr [77.49.149.219]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mBAF2Usq015035 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 10 Dec 2008 17:02:35 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mBAF2U2Y085546; Wed, 10 Dec 2008 17:02:30 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mBAF2UwR085545; Wed, 10 Dec 2008 17:02:30 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Ivan Voras References: <863agws2bv.fsf@ds4.des.no> Date: Wed, 10 Dec 2008 17:02:30 +0200 In-Reply-To: (Ivan Voras's message of "Wed, 10 Dec 2008 14:30:24 +0100") Message-ID: <87bpvkdqex.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mBAF2Usq015035 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.858, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.54, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-hackers@freebsd.org 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 15:02:41 -0000 On Wed, 10 Dec 2008 14:30:24 +0100, Ivan Voras wrote: >>> Also, it looks like MAXFILES is used only once, and in a bit funny way: >>> >>> 238 maxfiles = MAXFILES; >>> 239 TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); >>> 240 maxprocperuid = (maxproc * 9) / 10; >>> 241 maxfilesperproc = (maxfiles * 9) / 10; >> >> 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. It doesn't add noise :-) It's arguably a code quality and `documentation' feature. It provides a human-readable, useful name to the "magic" value (maxproc * 2). If we decide to bump the default to (maxproc * 10) sometime later, we won't have to grovel through the entire src/sys/tree and look for maxproc instances that need updating.