"The Linux Gazette...making Linux just a little more fun!"


(?) The Answer Guy (!)


By James T. Dennis, answerguy@ssc.com
Starshine Technical Services, http://www.starshine.org/


(?) Swap file on a RAM Disk

From Mathieu Bouchard on Wed, 02 Dec 1998

(?) Hi,

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.

matju

(!) 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).


Copyright © 1999, James T. Dennis
Published in The Linux Gazette Issue 36 January 1999


[ Answer Guy Index ] a b c 1 2 3 4 5 6 7 9 10 11 12
15 16 18 19 20 21 22 23 24 25 26 27 28
29 31 32 33 34 35 36 37 38 39 40 41 42 44
45 46 47 48 49 50 51 52 53 54 55 56 57 60 61 62 63 64 65 66
67 69 72 76 77 78 79 80 81 82 84 85 86 87 91 94 95 96 97 98


[ Table Of Contents ] [ Front Page ] [ Previous Section ] [ Next Section ]