From: Linus Torvalds (torvalds@klaava.Helsinki.FI)
Date: 04/21/93


From: torvalds@klaava.Helsinki.FI (Linus Torvalds)
Subject: Re: Q: ext2fs read/write speed
Date: Wed, 21 Apr 1993 10:58:50 GMT

In article <SHEM.93Apr21095311@ranganathan.oulu.fi> shem@phoenix.oulu.fi writes:
>In article <SCT.93Apr20222112@damsay.dcs.ed.ac.uk> sct@dcs.ed.ac.uk (Stephen Tweedie) writes:
>
> This is only a problem when the amount of data you are accessing is
> too great to fit into the buffer cache. If you have enough memory,
> Linux will cache up to 6MB of the most recently accessed data.
>
>Hm. Why only 6M? I upgraded to 16M and noticed that buffer cache won't
>grow larger than 6144K. Is there a reason to this and can I configure
>the kernel to use more memory in caching?

The only reason is an 'if'-statement in fs/buffer.c that checks for the
limit: removing that check will make linux use all free memory for
buffer cache if you wish (this was the original behaviour for the first
releases of the dynamic code). The 6MB limit is totally arbitrary, and
is just what I consider "reasonable" - the reason for any limit at all
is that it seems there usually isn't any performance increase with much
larger buffers, and the time to do syncs (both implicit and explicit)
can be irritatingly long with a truly big buffer cache. I haven't done
any actual benchmarks, so if somebody feels like testing it out, please
do..

                Linus