Is Video RAM a Good Swap Device?
sean4u writes "I use a 'lucky' (inexplicably still working) headless desktop PC to serve pages for a low-volume e-commerce site. I came across a gentoo-wiki.com page and this linuxnews.pl page that suggested the interesting possibility of using the Video RAM of the built-in video adapter as a swap device or RAM disk. The instructions worked a treat, but I'm curious as to how good a substitute this can be for swap space on disk. In my (amateurish) test, hdparm -t tells me the Video RAM block device is 3 times slower than the aging disk I currently use. If you've used this technique, what performance do you get? Is the poor performance report from hdparm a feature of the hardware, or the Memory Technology Device driver? What do you use to measure swap performance?"
But there is a fundamental problem: vidRAM is optimized for writes from main RAM. Not reads. In many cases, reading vidram is extremely slow because the raster generator is busy reading it. Writes are buffered. Reads cannot be.
It doesn't come across as troll or offtopic, just misinformed. If you can swap out an unused page of code or data to provide more room for disk cache, why not do it? You should take a look at what your OS is actually doing with memory some time.
- None can love freedom heartily, but good men; the rest love not freedom, but license. -- John Milton
giant, slow, purple monster of a computer that is like 10 years old. It has the name Onyx on the front. i think it has like 1GB of vram.
I also have this 12-15 year-old beater of an Intergraph box. i think it has like 64MB of vram.
Just 'cause it's old doesn't mean it was or is lame.
That beater of an Onyx can still thrash your SLi.
And the Intergraph's video card was EISA or microchannel, i can't remember which.
But mostly i'm just pointing out corner cases because other repliers to the parent felt it necessary to trash old gear. remember, in 10 years today's gear will be bupkus.
"If still these truths be held to be
Self evident."
-Edna St. Vincent Millay
Since the PlayStation 3 has only a small main memory that's hardwired and nonexpandable (Sony's lamest design decision of all), the Linux that runs on it is severely constrained. PS3 Linux is constantly swapping to compensate for the small memory. But the PS3 does have another small VRAM bank (that's extremely fast XDR). PS3 Linux hackers are working on using VRAM as swap, out of necessity. Their design analysis is probably instructive for anyone considering any platform's VRAM as swap.
--
make install -not war
No one seems to be asking the question as to why swap is even being used these days. I have dozens of servers and the swap space is barely touched. Main memory is cheap so just forget about swap. It's a hack from the days when memory wasn't cheap.