Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Dec 2008 17:02:30 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Ivan Voras <ivoras@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: MAXFILES in subr_param.c
Message-ID:  <87bpvkdqex.fsf@kobe.laptop>
In-Reply-To: <ghog9e$r4e$1@ger.gmane.org> (Ivan Voras's message of "Wed, 10 Dec 2008 14:30:24 %2B0100")
References:  <ghjt9l$hg3$1@ger.gmane.org> <863agws2bv.fsf@ds4.des.no> <ghog9e$r4e$1@ger.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 10 Dec 2008 14:30:24 +0100, Ivan Voras <ivoras@freebsd.org> 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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87bpvkdqex.fsf>