svn commit: r184471 - in head/bin: cat cp

Ivan Voras ivoras at
Sun Nov 2 15:47:15 PST 2008

2008/11/2 Ulrich Spoerlein <uspoerlein at>:
> On Thu, 30.10.2008 at 14:05:58 +0000, Ivan Voras wrote:
>> Author: ivoras
>> Date: Thu Oct 30 14:05:57 2008
>> New Revision: 184471
>> URL:
>> Log:
>>   Teach cat(1) and cp(1) to use a larger buffer if enough memory is present
>>   in the system. A simple heuristics is used to detect what is "enough"
>>   memory: if number of physmem pages is greater than 32k (equalling 128 MB
>>   on machines with 4 kB pages).
> Hi Ivan,
> curiosity speaking: Isn't amd64 and the superpages work by alc@ making
> it possible, to have pages of dynamic size, and of sizes > 1MB. If so,
> how are these static (?) macros affected.

I think the base page size of the architecture (which amd64 inherited
from i386) will always stay at 4 kB. For architectures with bigger
page size (as returned by sysconf(_SC_PAGESIZE)), it's forseeable they
will have more than 32k pages of active RAM in any case so it doesn't
really matter what the threshold is (assuming, of course, there will
be no architectures with *smaller* page size :) ).

The reason I introduced this threshold at all is to support old or
embedded (small) hardware in which 1 MB could be thought of as a "big"
buffer. I think 1 MB is "good enough" for all larger machines.

More information about the svn-src-all mailing list