Re: Linux VM subsystem (Was: Big mallocs, mmap sorrows and double buffering.)

A.N.Kuznetsov (
Wed, 12 Feb 1997 19:59:29 +0300 (MSK)


> It
> would be interesting to see your test code, as well as hear feedback from
> you on VM techniques and where Linux may be flawed or need improvement.

Well, it is pretty dumb, but hairy, numeric program
(its size as twice as linux vm code 8)8)),
but if you insist I'll give you private ftp pointer to its source.

Really, it is very easy to emulate its behaviour without
digging in obscure source tree.

1. Allocate huge memory area. (I used 56-250Mb for systems
with 64Mb of physical memory)
2. Then you dirtify this pages starting from beginning,
not very fastly (without swapping it should take ~5min for
P-133 and length 100Mb) Really, it is just array of
n*n matrices, when n=160-250, and pass consists in
matrix multiplications, so that it scales as n^3.
3. Then you repeat this procedure in backward direction,
this pass scales as n.

The statement is that other unices make this procedure
without pain, time grows almost linearly, and when running
with low priority in background it practically does not hamper other users.
Linux time grows EXPONENTIALLY after starting swap,
apparently going to infinity at ~250Mb 8)8)
Moreover, when size of array exceeds 150Mb the Linux box becames absolutely
unusable (f.e. emacs startup time exceeds 5min).

Hardware/software, that I have under hands at the moment:
SunOS-5.4, SS-20-50 vs. Linux-2.1.current, P-133.
All the hardware parameters of Linux box are better
(disk speed, SCSI controller and, certainly, CPU)

I ran this program on SS-20-60 with SunOS-4.3, AXP with Digital Unix,
and the same Pentium under FreeBSD. All these behave similarly.
Really, their behaviour is not optimal (when I swap by hands),
but pretty close to optimal.

Alexey Kuznetsov.