On Sat, Nov 10, 2012 at 9:24 AM, Ian Lepore
<free...@damnhippie.dyndns.org> wrote:
> On Sat, 2012-11-10 at 08:38 -0800, Alfred Perlstein wrote:
>> On 11/10/12 8:25 AM, Eitan Adler wrote:
>> > On 10 November 2012 11:19, Alfred Perlstein <bri...@mu.org> wrote:
>> >> Please consult the svn log for this file, it's relatively clear
>> just in the
>> >> commit logs/comments.  Grep for 384/512 and look around.
>> > Can this reasoning be added as a comment? I did grep for 384 in the
>> log, but
>> > a) I didn't find the answer
>> > b) one shouldn't have to.
>> >
>> >
>> It probably could be added, but then a bunch of other people would
>> complain about the comment being too wordy or "not in English".
>
> The fact that such a thing could happen explains much about the current
> state of the code.  An outsider could easily come to the conclusion that
> the FreeBSD motto is something along the lines of "It should be as hard
> to read as it was to write."

Don't forget to explain that you get 1 maxusers per 2MB of physical
memory which turns into 64 x 2k clusters and a whole series of side
effects.

Wouldn't it be nice if we could write "By default, mbuf clusters are
capped at 6% of physical ram or 6% of kernel address space, whichever
is smaller" ?

That's a little easier than trying to explain
maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE)
if (maxusers > 384)
maxusers = 384 + ((maxusers - 384) / 8);
nmbclusters = 1024 + maxusers * 64;


I'd sure prefer to explain:

/* pick smaller of kva pages or physical pages */
if ((physpages / 16) < (kvapages / 16))
nmbclusters = physpages / 16;
else
nmbclusters = kvapages / 16;


Leave maxusers for calculating maxproc.


-- 
Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
"All of this is for nothing if we don't go to the stars" - JMS/B5
"If Java had true garbage collection, most programs would delete
themselves upon execution." -- Robert Sewell
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to