ll_rw_swapfile optimization in 1.3.6

Eric Gisin (ericg@unixg.ubc.ca)
Sun, 9 Jul 1995 19:55:20 +0000

Did anyone notice any performance improvement in swapfile I/O
with Linux 1.3.6? I studied the code and can't see how it makes
a difference with the IDE driver. Maybe the SCSI driver is different.
I timed 1.3.6 against an earlier 1.3.?, and there was no difference.

The new code queues multiple requests with add_request, then waits
for all of them to finish. If it called make_request, it would
combine contiguous requests, but make_request is for buffer cache
I/O, and swap I/O bypasses the buffer cache.

Here is a simple program to measure swap I/O performance:

=== big.c ===

* Usage: time big
* Measure performance of Linux swap I/O by dirtying bss pages.
* NOTE: you must either boot with the option "mem=4M", or
* define MB to be 2-3 times the size of your physical memory.

#define MB 10 /* MB of VM to page out */

main() {
int i;
static char a[MB*1024*1024];

for (i=0; i<sizeof(a); i+=4096)
a[i] = 1;
return 0;
Eric Gisin, ericg@unixg.ubc.ca