Linux Swap – Is ‘Page-to-Disk’ Feature the Same as Swapping?

linuxminixswap

In his autobiography, Just for Fun, Linus mentions the "page-to-disk" feature that was pivotal in making Linux a worthy competitor to Minix and other UNIX clones of the day:

I remember that, in December, there was this guy in Germany who only had 2 megabytes of RAM, and he was trying to compile the kernel and he couldn't run GCC because GCC at the time needed more than a megabyte. He asked me if Linux could be compiled with a smaller compiler that wouldn't need as much memory. So I decided that even though I didn't need the particular feature, I would make it happen for him. It's called page-to-disk, and it means that even though someone only has 2 mgs of RAM, he can make it appear to be more using the disk for memory. This was around Christmas 1991.

Page-to-disk was a fairly big thing because it was something Minix had never done. It was included in version 0.12, which was released in the first week of January 1992. Immediately, people started to compare Linux not only to Minix but to Coherent, which was a small Unix clone developed by Mark Williams Company. From the beginning, the act of adding page-to-disk caused Linux to rise above the competition.
That's when Linux took off. Suddenly there were people switching from Minix to Linux.

Is he essentially talking about swapping here? People with some historical perspective on Linux would probably know.

Best Answer

Yes, this is effectively swapping. Quoting the release notes for 0.12:

Virtual memory.

In addition to the "mkfs" program, there is now a "mkswap" program on the root disk. The syntax is identical: "mkswap -c /dev/hdX nnn", and again: this writes over the partition, so be careful. Swapping can then be enabled by changing the word at offset 506 in the bootimage to the desired device. Use the same program as for setting the root file system (but change the 508 offset to 506 of course).

NOTE! This has been tested by Robert Blum, who has a 2M machine, and it allows you to run gcc without much memory. HOWEVER, I had to stop using it, as my diskspace was eaten up by the beta-gcc-2.0, so I'd like to hear that it still works: I've been totally unable to make a swap-partition for even rudimentary testing since about christmastime. Thus the new changes could possibly just have backfired on the VM, but I doubt it.

In 0.12, paging is used for a number of features, not just swapping to a device: demand-loading (only loading pages from binaries as they’re used), sharing (sharing common pages between processes).