Messages in this thread | | | Subject | [PATCH] MM fix & improvement | From | Zlatko Calusic <> | Date | 09 Jan 1999 08:32:50 +0100 |
| |
OK, here it goes. Patch is unbelievably small, and improvement is BIG.
Two things:
1) Til' now, writing to swap files & partitions was clustered in 128kb chunks which is too small, especially now when we have swapin readahead (default 64kb). Fragmentation of swap file with such a value is big, so swapin readahead hit rate is probably small. Thus first improvement is in increasing on-disk cluster size to much bigger value. I chose 512, and it works very well, indeed (see below). All this is completely safe.
2) There was an artificial limit in swapin readahead code, that is completely unnecessary, and also kills performance a big time. It also makes trouble with two thrashing tasks, because swapin readahead doesn't work very well in such low memory condition. I removed it alltogether, and swapping quite improved.
If you don't believe, look at benchmarks I made for your eyes only (swap cache statistics is after both runs):
pre6 + MM cleanup (needed for swap cache hit rate)
hogmem 100 3 - 10.75 MB/sec 2 x hogmem 50 3 - 2.01 + 1.97 MB/sec (disk thrashing) swap cache - add 194431 find 13315/194300 (6.9% hit rate)
pre6 + MM cleanup + patch below
hogmem 100 3 - 13.27 MB/sec 2 x hogmem 50 3 - 6.15 + 5.77 MB/sec (perfect) swap cache - add 175887 find 76003/237711 (32% hit rate)
Notice how swap cache done it's job much better with changes applied!!!
Both tests were run in single user mode, after reboot, on 64MB machine. Don't be disappointed if you get smaller numbers, I have two swap partitions on different disks and transports (IDE + SCSI). :)
[unhandled content-type:application/octet-stream] -- Zlatko
| |