From Mathieu Bouchard on Wed, 02 Dec 1998
Some have even reported that using 100 or 200K RAM disk with a swap file on it will dramatically improve the performance over using all of your memory as straight RAM.
Do you have any rational explication to this? I'm not a kernel expert, but it makes no sense -- especially because AFAIK, Linux RAM disks are swappable (and lazily-allocated), and mutual containment (in this context) makes no sense;
No. I don't have a rational explication or explanation for this.
but in the event that a RAM disk wouldn't be swappable, then, swapping from RAM to RAM isn't anything more than a CPU hog and unnecessary complexity -- it's a kind of Alice in Wonderland to me. It would make sense if some compression was done while swapping, which would look like a Macintosh RAMdoubler. But Linux has no such feature -- six months ago I asked the Linux guys and they said that they didn't like the idea.
Is it possible that such a report would be gibberish? in which case I would like you to get the precise facts and publish them. I think that even though it is a detail, the Linux community doesn't deserve to have anything done wrong. I'm not [bf]laming, I just want to correct a situation.
However, I can make a guess. Many of the memory management code paths may have to special case the situation where no swap/paging space is available. The routines invoked to handle this special case may result in a slow down when no swap is available.
You're welcome to search the Linux-Kernel mailing list archives yourself. You can also just try it (run some tests with no swap space "mounted" and then run them again with just a small swap file located on a small RAM disk. I haven't actually tried this experiment, so I made an effort to identify my statement as hearsay.
If you'd like to so some research on it --- you could publish your results (probably in LG --- perhaps as a 2-cent tip or as a full article).