Slashdot Mirror


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?"

235 comments

  1. AGP or PCI-Express by j_sp_r · · Score: 5, Informative

    Is your adapter an AGP or PCI-Express card? Because PCI-Express has fast lanes both ways, and AGP is not so fast in writing back. That could explain a part of the performance problems.

    1. Re:AGP or PCI-Express by Like2Byte · · Score: 1

      The GP implied (e.g.: "inexplicably still working") they're using older hardware; therefore, I'd imagine that PCI-E isn't being used on his system. AGP is possible; but, from the tone of the article, I'm leaning more toward his system using PCI.

      What would be the bottlenecks if he was using PCI video RAM?

    2. Re:AGP or PCI-Express by arth1 · · Score: 2, Insightful

      It shouldn't matter, cause AGP is in no circumstance slower than the 33 MHz PCI bus, and you can run a couple of IDE hard drives maxed out on a PCI ATA controller.

    3. Re:AGP or PCI-Express by Corporate+Troll · · Score: 1, Informative

      Not wanting to burst your bubble but there is a significant difference between good old PCI and PCIe.

    4. Re:AGP or PCI-Express by LSD-OBS · · Score: 1

      The bottleneck is always the bus on the card itself, between the VRAM and the PCI/AGP/whatever bus. For some reason they're never designed for decent transfer speeds in that direction, which has been the downfall of many good ideas in the past (not to mention a lot of 2D graphics algorithms)

      --
      Today's weirdness is tomorrow's reason why. -- Hunter S. Thompson
    5. Re:AGP or PCI-Express by Yvan256 · · Score: 0, Redundant

      Given his "lucky/still working" description, it could even be PCI or even ISA graphics...

    6. Re:AGP or PCI-Express by Corporate+Troll · · Score: 1

      Sorry, I get what you mean now... You mean that the write/read to AGP should be faster than a write/read to a disk because the bus is faster. I was comparing raw bus speeds...

    7. Re:AGP or PCI-Express by somersault · · Score: 1

      Not wanting to burst your at first seemingly correct bubble, but the OP points out that you can run 2 old IDE HDs at full transfer rate on even 33Mhz PCI, so anything newer than that shouldn't be suffering a bottleneck on the bus (though some people have pointed out that reading back from AGP takes a long time compared to writes).

      --
      which is totally what she said
    8. Re:AGP or PCI-Express by Orange+Crush · · Score: 1

      Nobody said there wasn't. But the fact remains you can max out several IDE devices with an old interface card on the good old 33mhz PCI bus, and solid state VRAM shouldn't be any slower than a mechanical hard drive. So even if it is running over the slowest likely bus, that's still not the bottleneck. So it might be something in the card itself causing the slowdown.

    9. Re:AGP or PCI-Express by paganizer · · Score: 2

      or Vesa Local Bus. or MCA. But I think the most VRAM ever found on a MCA video card was maybe 8MB.

      --
      Why, yes, I AM a Pagan Libertarian.
    10. Re:AGP or PCI-Express by Corporate+Troll · · Score: 1

      No worries, I realised that after pushing "Submit"... Go back to the comment and you'll find that I corrected myself in a reply...

    11. Re:AGP or PCI-Express by Corporate+Troll · · Score: 1

      Already noticed myself... Apologized and all...

    12. Re:AGP or PCI-Express by edwdig · · Score: 2, Informative

      What's a high end ISA graphics card going to have, 512 KB of RAM ? I can't picture anyone wanting to swap to that. PCI most likely wouldn't have more than a few MB of RAM, making it questionable as well.

    13. Re:AGP or PCI-Express by omeomi · · Score: 1

      He did state that he's using the "built-in video adapter", which I would imagine is on-board, and thus neither PCI, AGP, or PCI-E.

    14. Re:AGP or PCI-Express by Andy+Dodd · · Score: 4, Informative

      Whether it is built into the motherboard or is built into the chipset itself, it almost always still has an "internal only" PCI, AGP, or PCI-E interface, and is thus affected by the performance limitations of that interface.

      --
      retrorocket.o not found, launch anyway?
    15. Re:AGP or PCI-Express by ckaminski · · Score: 2, Informative

      Nearly all video adapters made in the past 10 years are either PCI, PCIe or AGP. Whether or not they are add in cards or soldered on the motherboard is irrelevant.

    16. Re:AGP or PCI-Express by owlstead · · Score: 1

      Are you really a troll or are you just dense? PCIe x 16 is a lot faster than AGP in in transfer from video card to the CPU.

    17. Re:AGP or PCI-Express by Corporate+Troll · · Score: 1

      Neither, I just misunderstood what the original poster was saying. He said that you cannot saturate a regular PCI bus with a few harddisks, and that as such if the RAM of the video card could be accessed at AGP speeds, then accessing the RAMs of the card should be by definition faster than accessing a swapfile on disk.

      So, while I though he was talking exclusively about bus speeds, he wasn't...

      Of course, PCIe is faster than AGP... I know that, you know that and those that don't know it can look it up on wikipedia.

    18. Re:AGP or PCI-Express by hansonc · · Score: 1

      who the hell cares about PCI-E in this case? It's an old machine with built in video, it's not PCI-E and there's a decent chance it's not AGP either

    19. Re:AGP or PCI-Express by Voltageaav · · Score: 1

      sean4u does. One of his questions was if anyone else had done the same thing and if it worked better for them. He just said his computer was really aged, that dosn't mean someone else using the same technique wouldn't have brand new hardware.

      --
      Someone save me from this sanity.
    20. Re:AGP or PCI-Express by Impy+the+Impiuos+Imp · · Score: 1

      If it's built-in, it may be using a chunk of normal RAM as video RAM, in which case it would be faster to use a normal RAM virtual disc.

      --
      (-1: Post disagrees with my already-settled worldview) is not a valid mod option.
    21. Re:AGP or PCI-Express by tomstdenis · · Score: 1

      worse yet, ISA cards are likely to be VGA compliant which only has like 64KB of addressable memory at A0000h. So you'd have to do bank switching to get access to the other memory.

      Tom

      --
      Someday, I'll have a real sig.
    22. Re:AGP or PCI-Express by camperslo · · Score: 1

      I question whether hdparm really gives him a number that is valid for a comparison against any kind of physical RAM.

      Certainly the actual swap performance would be greatly affected by where the swap file is on the disk, and what else the disk is used for. If the disk is being called on to do other things at the same time the swap performance would take a huge hit. Then there's the matter of just how often he needs to use the swap, and how much is needed. If the system simply is over-taxed and has too little RAM for a number of processes having fairly small requirements, the access time may be a bigger deal than the sustained throughput. On the other hand, if a specific application has really huge memory requirements the sustained throughput may be far more important.

      Making the best overall choices requires seeing the big picture, and we're not given all of the facts.
      That said, I think it is likely that using separate video RAM would still have a bigger advantage than the numbers would suggest. Using a separate drive for the swap is probably the easiest way to improve to performance, but one should be mindful of the added energy/heat costs (and environmental issues) and also know whether he'll ever be faced with a wake-from-sleep drive delay.
      Energy runs about $1 a month for every 10 Watts used continuously where I am, which eats into any savings from using using a bunch of old drives in a system. I thing some are wasting quite a bit of energy with high-end add-in GPUs in systems that don't need the 3D performance. I wonder if this guys on-board video even uses dedicated RAM.

      Computing equipment is a significant percentage of our total energy consumption. It's our duty to be ever mindful of the the whole picture, including environmental issues, when making hardware choices.

    23. Re:AGP or PCI-Express by edwdig · · Score: 1

      Bank switching actually wouldn't be a big deal for swap. You're most likely swapping out 4 KB pages, so it'll work well with the 64 KB bank, and a bank switch isn't more than a few instructions.

    24. Re:AGP or PCI-Express by amorsen · · Score: 2, Informative

      So it might be something in the card itself causing the slowdown.

      The PCI bus and its derivatives (AGP, PCI-X, PCI-Express) is basically send-only. If you try to fetch across it, things can't burst properly, and access is very slow. Most PCI and AGP graphics cards don't have proper DMA engines for sending, so the CPU has to fetch. Many PCI-Express graphics cards can be told to do DMA.

      --
      Finally! A year of moderation! Ready for 2019?
    25. Re:AGP or PCI-Express by Spokehedz · · Score: 1

      Well if that is the case, then he's using system memory anyway... So, the bottleneck is that it's going from ram, out, and then back in to the ram to be tested.

    26. Re:AGP or PCI-Express by Odiumjunkie · · Score: 1

      > If it's built-in, it may be using a chunk of normal RAM as video RAM, in which case it would be faster to use a normal RAM virtual disc.

      Perhaps, but regardless, using RAM as swap seems a little redundant.

    27. Re:AGP or PCI-Express by Anonymous Coward · · Score: 0
      The same person who decided two spaces were no longer required when word processing software replaced manual typewriters.

      Who the f*** decided that sentences on the Internet shall no longer be formatted with two spaces after a period?!
    28. Re:AGP or PCI-Express by Mr+Z · · Score: 2, Insightful

      If it's lower bandwidth and higher latency than the rest of system memory, then it makes perfect sense to NOT use it as primary storage but as a secondary storage. Currently, swap is the only straightforward mechanism Linux offers for doing so.

    29. Re:AGP or PCI-Express by BcNexus · · Score: 1

      Three years ago, I bought a half-height PCI video card with a Radeon chipset with 256 MB of on-board (dedicated)RAM.

    30. Re:AGP or PCI-Express by kelnos · · Score: 2, Informative

      No, it's a headless system -- if VRAM is actually being stored in a chunk of system RAM, the way to go here would be to just disable the VRAM entirely and reclaim it as normal system RAM.

      --
      Xfce: Lighter than some, heavier than others. Just right.
    31. Re:AGP or PCI-Express by Mr+Z · · Score: 1

      Oh, I agree--if video RAM is just carved from the main system RAM, reclaim it as system RAM. If it's separate RAM over a slower interface, you really need to treat it as a lower level of the memory hierarchy.

    32. Re:AGP or PCI-Express by Anonymous Coward · · Score: 0

      On an AGP 8x we can read back full rendered 1080i HD frames at 25fps (really, two half height fields at 50fps).

      Thats 197MB/s.. which should be on-par with many HDDs. Coupled with almost 0 time seeks.. should give great performances.

    33. Re:AGP or PCI-Express by kesuki · · Score: 1

      where it really comes in as important is this. I happen to have 4 old PCI (not express) graphic cards with anywhere from 32mb - 128 mb of video ram. if pci graphic cards can read/write as fast as an ide pci card can then it would be very beneficial to install one or more pci graphic cards, and hijack their ram for use as a swapfile. (especially the card with 128 mb of video ram) although the system i was considering doing this on has 384 mb of ram, giving the system an extra 128 mb to use as swap space that potentially could read write much faster than agp cards. (since agp has chronically slow back to the cpu channels, as that is how they got the speed so fast TO the gpu on agp designs)

      Im sure im no the only guy with unused pci graphic cards lying around, and using them as a swap partition could really help people, especially when trying to run linux on older machines with low ram limits. (my system with 384mb maxes out at 512mb, if i used all 4 slots with 128 mb sticks, and its old ram hard to find, especially in the 128 mb size) and it only has a 1.1 ghz processor, which is no problem for linux.

    34. Re:AGP or PCI-Express by joel48 · · Score: 1

      Seconded - there is not valid reason for sentences to have a double-space after them.

    35. Re:AGP or PCI-Express by sean4u · · Score: 1

      Doh! Not enough information, obviously. I was as interested in other people's experiences, but since there's a great deal of interesting replies that wonder what the hardware is:
      00:00.0 Host bridge: Silicon Integrated Systems [SiS] 661FX/M661FX/M661MX Host (rev 11)
      00:01.0 PCI bridge: Silicon Integrated Systems [SiS] SiS AGP Port (virtual PCI-to-PCI bridge)
      01:00.0 VGA compatible controller: Silicon Integrated Systems [SiS] 661/741/760 PCI/AGP or 662/761Gx PCIE VGA Display Adapter
                      Subsystem: ASUSTeK Computer Inc. SiS Real 256E (ASUS P5S800-VM motherboard)
                      Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
                      Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR-

      And I'm sorry if it was misleading, the desktop is only a couple of years old since purchase, but it's one I assembled from parts and the large number of problems I've had with it would not lead you to infer Intelligent Design.

    36. Re:AGP or PCI-Express by unitron · · Score: 1

      Seconded - there is not valid reason for sentences to have a double-space after them.

      Except for that's the way you're supposed to do it.

      It does make for improved readability.

      --

      I see even classic Slashdot is now pretty much unusable on dial up anymore.

    37. Re:AGP or PCI-Express by djimi · · Score: 1

      Typewriters by design have monospaced fonts, plain old text, [e.g. Courier, Monaco], that is every glyph is of a fixed-width, as every block of "type" occupies the same amount of space. The advent of modern computers brought variable-width fonts, which allow the kerning to change: an 'i' is narrow and 'w' is wide. The evolutionary change in default typefaces meant that most people write & publish with variable width fonts (and left & right justification), making the two spaces after a period superfluous, as a period lies closer to the previous character. A space is still a character in the computing world, sometimes more [%20] -- whereas in the press/ink world, it is a freebie and for readability two monospaces are better than one.

      --
      Vox et praetera nihil
    38. Re:AGP or PCI-Express by tomstdenis · · Score: 1

      Did I forget to mention that it only has 256K of memory? VGA cards didn't have 512 or more until SVGA and more importantly VESA came out.

      --
      Someday, I'll have a real sig.
    39. Re:AGP or PCI-Express by edwdig · · Score: 1

      I know that, I originally started this by saying it would have too little memory to be worthwhile. My point there was just that the bank switching issue was essentially negligible.

    40. Re:AGP or PCI-Express by tomstdenis · · Score: 1

      Agreed agreed. Great, barkeep another round for me mates!

      I do kinda miss the DOS days though ... no protected processes, just poke at hardware all you want. now we got this "OS" bullshit in the way. hehehehe.

      Tom

      --
      Someday, I'll have a real sig.
    41. Re:AGP or PCI-Express by gr8scot · · Score: 1

      I find that having more space between sentences than between words within a sentence makes speed-reading easier. If you don't consider the savings of your time "valid reason" for the rules of formatting, that's your problem. I disagree with you, and publishers agree with me.

      --
      All 19 hijackers were known terrorists 09-10-2001. Lack of FBI intelligence does not justify warrantless wiretaps..
  2. OS overhead may well defeat any gains. by BarnabyWilde · · Score: 1

    OS overhead may well overshadow any gains from nanoseconds saved in the video RAM.

    1. Re:OS overhead may well defeat any gains. by LSD-OBS · · Score: 2

      Bear in mind the poster is talking about *swap* space. That is, the hard drive. Video RAM is orders of magnitude faster, aside from issues reading back from the video bus.

      --
      Today's weirdness is tomorrow's reason why. -- Hunter S. Thompson
  3. Probably a good idea, provided you have PCIe by default+luser · · Score: 5, Informative

    I'm assuming your ancient system uses an AGP interface for graphics, which has a very fast download rate, but very poor upload. The maximum performance of AGP uploading data from the card memory to the rest of the machine is pretty slow (less than 100MB/sec, IIRC), and it will vary depending on the implementation. This is probably the reason you got such slow benches.

    PCIe will likely give you performance more in-line with main memory (most implementations now are hitting 1-2 GB/s).

    --

    Man is the animal that laughs.
    And occasionally whores for Karma.

    1. Re:Probably a good idea, provided you have PCIe by AvitarX · · Score: 1

      100MB a second is still pretty damned fast.

      ATA 133 (I will assume this, due to the "aging hd mentioned) is only 17MB/sec for comparison's sake. I believe (could be wrong) that AGP uploads at PCI speeds and downloads at up to 8xPCI. This would put it way past a disk in speed, and the slowdown is somewhere else.

      --
      Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
    2. Re:Probably a good idea, provided you have PCIe by gfxguy · · Score: 1

      If it's really that aging it might still even be PCI or, if it's really old, ISA.

      It's hard to imagine a PCIe card being slower.

      --
      Stupid sexy Flanders.
    3. Re:Probably a good idea, provided you have PCIe by dougmc · · Score: 4, Informative

      ATA 133 (I will assume this, due to the "aging hd mentioned) is only 17MB/sec for comparison's sake. No, ATA 133 is theoretically 133 MB/s. It's bytes, not bits.

      And I used to regularly get sustained 25-30 MB/s from single drives (40 GB or so) on ATA 33 interfaces. Going to ATA 66, 100 or 133 may increase the speed when hitting the on-drive cache, but the drives themselves usually can't go that fast. How fast are the fastest IDE drives nowadays for sustained, sequential transfers -- 50 MB/s or so?

    4. Re:Probably a good idea, provided you have PCIe by imsabbel · · Score: 1

      IDE drives get >75Mbyte in the outer zones, and drop to the 50s in the middle.
      Some reach >60. So even UDMA66 would limit them non-trivially.

      --
      HI O WISE PRINCE. WHT TOOK U SO DAM LONG?
    5. Re:Probably a good idea, provided you have PCIe by InvalidError · · Score: 1

      AGP is basically a souped-up single-drop PCI slot. AGP is fundamentally capable of doing full-speed in any mix of Read-Write as long as the target device is capable of sustaining the operation. The problem is that most GPUs have been designed as output-only devices and their host controller interfaces, be it PCI, AGP or PCIe, have been designed for fast writes to video memory but only implemented a low-cost, small-footprint, low-performance readback path since it is superfluous for normal operation. If you benchmark the readback throughput of early PCIe graphics card - those before the wholesale switch from GPU to GPGPU - probably all things up to Radeon X8xx and GF6 or possibly even X19xx and GF7, you will find that most of them also have relatively slow readback speeds.

      Newer GPUs have been designed with GPGPU in mind which has a more symmetric traffic requirement: being able to do very fast computations on-card is pointless when it is impossible to get the results back in a timely manner. Take one of those GPGPUs, slap an AGP bridge onto it, put it in an AGP slot and you will get decent throughput in both directions.

      Slow VRAM readback was a chip design decision, not a bus issue and not a bug. While the VRAM path is full-speed between the GPU core and RAM, the path between RAM controller and host controller is asymmetric in nearly all early PCIe GPUs as well of the vast majority of AGP and PCI ones. If you want a GPU with symmetric host-RAM RW capability, all Matrox GPUs, be it on PCI, AGP or PCIe have it IIRC - as should today's X2xxx and GF8.

    6. Re:Probably a good idea, provided you have PCIe by pushing-robot · · Score: 1

      How fast are the fastest IDE drives nowadays for sustained, sequential transfers -- 50 MB/s or so?

      I've seen newer 500GB IDE drives do 80MB/s at the start of the drive.

      IDE and SATA are still equivalent for sequential transfers. Until drives reach sustained 100MB/s or 133MB/s, IDE won't be a bottleneck in that regard.

      --
      How can I believe you when you tell me what I don't want to hear?
    7. Re:Probably a good idea, provided you have PCIe by ElecCham · · Score: 5, Informative

      (ObDisclaimer: I work for Seagate.)

      On a current-model 7200RPM SATA drive, you can expect to see around 80MB/sec at the outer edge of the disk. And the rule of thumb is, you see half that at the inner edge, and three-quarters in the middle. So call it a (nearly) guaranteed 40MB/sec, and an average of 60MB/sec.

      These are not hard-and-fast numbers, but it's a pretty good estimate for a modern drive.

      --
      Sig broken, watch for .finger
    8. Re:Probably a good idea, provided you have PCIe by AvitarX · · Score: 1

      Thanks for correcting my lies.

      --
      Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
    9. Re:Probably a good idea, provided you have PCIe by asuffield · · Score: 1

      How fast are the fastest IDE drives nowadays for sustained, sequential transfers -- 50 MB/s or so?


      Sustained transfer is a function of data density and spin rate - it's all about the rate at which bytes travel under the read heads. Spin rates are more or less fixed by mechanical limitations, with consumer disks running at 7.2k RPM, and high-end disks running at up to 16k, so you'll get about twice the sustained transfer rate from the really expensive models.

      Aside from that, it basically depends on the size of the disk, since that's closely related to the data density.

      You will see almost no variation across different manufacturers, but a wide variation across different models of disk.
    10. Re:Probably a good idea, provided you have PCIe by ruiner13 · · Score: 1

      I have a 250GB Samsung SpinPoint P series ATA drive, and tests that I've run on it using various benchmarking apps (SiSoft Sandra, etc.) show that it gets about 60-70MB/sec depending on block size and platter position (No RAID). I've seen it peak at 80MB/sec. I have an nVidia nForce 4 board from DFI. Clearly, 2 drives as master/slave on the same bus could then fairly regularly saturate an ATA-133 bus when running full speed. I suspect this is why Apple gives each drive its own independent IDE bus in the XServe RAID devices.

      --

      today is spelling optional day.

    11. Re:Probably a good idea, provided you have PCIe by Mattsson · · Score: 1

      Well... Two of those on one IDE will make it possible for the bus to be a bottleneck, but that's only under the wrong conditions.

      --
      /.Mattsson - My native language is not English, so please don't whine over linguistic errors. (That's lame anyway...)
    12. Re:Probably a good idea, provided you have PCIe by multipartmixed · · Score: 1

      Is track zero always at the outer edge?

      I hope so, because that's where I like to keep my swap partition.

      Your answer doesn't need to be universal, I use Seagate drives almost exclusively. Most often FC or LVD SCSI, often sun-branded. :)

      --

      Do daemons dream of electric sleep()?
    13. Re:Probably a good idea, provided you have PCIe by Eponymous+Bastard · · Score: 3, Insightful

      Is track zero always at the outer edge?

      I hope so, because that's where I like to keep my swap partition. Actually, that's not necessarily optimal. If you were reading a file on the inner edge and get a page fault, the disk will have to do a full seek all the way to the other side to be able to get the page. You're better off putting the page file halfway between the inner and outer edges to lower the average length of your seeks for page faults. Of course, that depends on how much thrashing you're experiencing and how much file access is mixed in with that, so YMMV

      IIRC, NTFS has some of its main data structures in the middle of the partition for that reason.
    14. Re:Probably a good idea, provided you have PCIe by Anonymous+Freak · · Score: 0, Troll

      Interesting that you work for Seagate, but don't know that the ES.2 achieves over 100 MB/s on the outer edge, and over 50 MB/s on the inner. (According to StorageReview, anyway.)

      --
      Another non-functioning site was "uncertainty.microsoft.com."
      The purpose of that site was not known.
    15. Re:Probably a good idea, provided you have PCIe by NekoXP · · Score: 1

      PCIe will likely give you performance more in-line with main memory (most implementations now are hitting 1-2 GB/s).


      It probably won't simply due to the inefficiency of transferring over the PCI Express bus. Most implementations don't get anywhere near 1GByte/s let alone 2GByte/s, unless you are talking extremely favourable circumstances transferring 100 megabyte blocks of data, in sizes approaching the cache line size.

      What is probably slowing down the transfer for his video RAM (if in fact 100MB/s is meant to be slow - I doubt he is getting this from his "aging disk" to be honest) is that slram does plain memcpy() from one location to another. This may actually be very inefficient if you consider that

      1) memcpy() may be using a byte-by-byte routine, maybe even memory-based instructions (move with two memory addresses as operands) and PCI/AGP/PCIe are best at transferring data in 32-bit (4 byte) blocks. It depends how his kernel is set up, and if the kernel developers were braindead when they wrote the code. It's more efficient by far to transfer larger units of data, and far, far more efficient to pipeline loads and stores by using registers (however, not much fun on x86 - but the basic principle is load, load, load, load all into registers, then store, store, (load) store (load), store (load) :).

      2) PCI host buses usually optimize burst transfers and pipelining based on CPU cache line size. Most systems this is 32 bytes or
      64 bytes (128 on a Pentium 4).

      3) AGP transactions are done by default in FRAME mode, which is basically AGP 1x (66MHz, 32-bit PCI) so don't expect any special performance out of it. Integrated graphics controllers are simply on virtual, internal AGP bus.

      4) The page size (minimum amount you will ever send to or fetch from swap) is 4096 bytes or 8192 bytes depending on your system. Doing 4096 seperate byte transfers runs at bus speed, even doing 1024 32-bit transfers is going to run at bus speed, unless you coerce the system into write combining and bursting. Byte transfers in general do not write combine. And write-combining needs cacheable memory.

      5) This is an MMIO/PIO transaction if you get the CPU to do it, in which case, you are also soaking up CPU time where on a disk it is handled DMA -> host controller -> RAM at all stages.

      6) Video memory is nearly always marked as uncachable (unless you sets an MTRR or MMU page table setting)

      Therefore it makes sense to look at;

      1) hacking the slram driver to copy data in cache-line sized chunks, especially for swap. Some processors have instructions especially for pulling cache lines or posting them; others have streaming functions which can prefetch entire cache lines of data.

      2) hacking the slram driver to copy in a tight loop in such a way that transactions are posted to the PCI bus controller in a way that it can burst them - you need more than one transfer to happen over one PCI cycle. You can do this with SSE (just flood the damn thing with register reads from RAM and then write 4 of them at once, the CPU will pipeline, perform a write-combine and your PCI controller will turn that into the most efficient burst transfer)

      3a) doing that transfer using cacheable memory (set your MTRRs!, essential for 1)
      or
      3b) doing that transfer using a DMA controller rather than dicking around with a CPU (IOAT..?)

      Some interesting reads:

      http://bugs.mysql.com/bug.php?id=19975
    16. Re:Probably a good idea, provided you have PCIe by multipartmixed · · Score: 1

      Good points --

      I'm in a bit of a non-standard usage pattern group, though -- I rarely touch internal disk except in the odd case when an application starts to leak core and I start paging.

      The reason for this setup is that I run in a virtualized clustered environment -- all storage is external except for the cluster bootstrap, base OS, and swap.

      You raise a really interesting question, though: why is it not possible to specify a non-contigous disk slice? That would you could put swap right in the middle and your next busiest partition around it.

      --

      Do daemons dream of electric sleep()?
    17. Re:Probably a good idea, provided you have PCIe by ragefan · · Score: 1

      Interesting that you work for Seagate, but don't know that the ES.2 achieves over 100 MB/s on the outer edge, and over 50 MB/s on the inner. (According to StorageReview, anyway.) Where in his post did he mention a specific drive at all? His post was referring expectations of "modern drives" and was non-manufacturer specific.

    18. Re:Probably a good idea, provided you have PCIe by hasdikarlsam · · Score: 2, Informative

      It's perfectly possible, you just have to use a volume manager like LVM to concatenate the partitions

    19. Re:Probably a good idea, provided you have PCIe by dougmc · · Score: 1

      It's only a lie if you know it not to be true.
      In this case, it sounds like an honest mistake.

    20. Re:Probably a good idea, provided you have PCIe by dfn_deux · · Score: 1

      I have a pair of mtron SSD 32gb drives in a test bench to the left of me being zeroed. dd if=/dev/zero of=/dev/sda Returns a reported 71MB/s sequential write speed. Random access beats the pants of my seagate magentic drives by a considerably larger margin. And the speeds aren't location dependent.

      --
      -*The above statement is printed entirely on recycled electrons*-
    21. Re:Probably a good idea, provided you have PCIe by Erpo · · Score: 1

      (ObDisclaimer: I work for Seagate.)

      Thanks for backing up your products with 5 year warranties while all the other major HDD manufacturers that I know of have reduced their consumer warranties to 1 year. That tells me all I need to know about the quality of Seagate's products compared to its competitors.

      So call it a (nearly) guaranteed 40MB/sec, and an average of 60MB/sec.

      Come on now. Those figures only make sense for sequential reading and writing, which is almost never the situation while swapping.

    22. Re:Probably a good idea, provided you have PCIe by toddestan · · Score: 1

      IIRC, NTFS has some of its main data structures in the middle of the partition for that reason.

      Wouldn't such a scheme be totally defeated by drives with more than one platter?

    23. Re:Probably a good idea, provided you have PCIe by fractoid · · Score: 1

      Wouldn't such a scheme be totally defeated by drives with more than one platter? Not necessarily. I always assumed multi-platter drives stored data in parallel across the disks for faster speeds (so for a 4-platter drive, platter 1 = bits 1+2, platter 2 = bits 3+4, etc. at any given position, meaning that you can read a byte from just 2 head positions). This layout would make the middle of a partition physically in the middle of the drive on a single-partition drive.
      --
      Rampant carbon sequestration destroyed the Dinosaurs' tropical paradise. I'm here to help repair the damage.
  4. Just don't don't do it! by Anonymous Coward · · Score: 0, Flamebait

    This might come off as a troll or offtopic, but you shouldn't be swapping. Buy more main memory.

  5. size by TheSHAD0W · · Score: 3, Informative

    How much RAM is in your video card? 64 megabytes? 128? If it's an older machine, probably much less than that. Assuming you have less than a gigabyte of main RAM in your system it's probably much more worthwhile to drop a few dollars on expanding that and running whatever RAM disk you need in there.

    1. Re:size by arivanov · · Score: 4, Informative

      Not quite so.

      If it is really old it may be running one one of the early Intel Pentium Triton chipsets. The TX will not cache any memory above 64 and the HX needs to be reconfigured to cache above 64. Even after reconfiguration it will just about work for 512MB. There are other similar vagaries related to most old hardware. Ali depending on release and version tanks at 384 or 768 and so on. Even chipsets as recent as Intel 815e while capable of 2G were deliberately bastardised to support only 512MB in order not to undercut the inexistent market for high-end Rambus/i810 based workstations.

      So there are quite a few cases where it is more cost effective to use an old and long past its hayday high end video card as a swap device. All the way up to around 2001-2002. From there onwards nearly everything supported sane memory sizes so it is pointless.

      --
      Baker's Law: Misery no longer loves company. Nowadays it insists on it
      http://www.sigsegv.cx/
    2. Re:size by arth1 · · Score: 2, Informative

      Expanding the RAM isn't always feasible. I have one dns/dhcp/proxy/smb server with 512 MB RAM, and that's max for the i815P chipset (Tualatin-S CPU). Adding more RAM would mean switching out the motherboard, which would also mean switching out the CPU, and we're up to so much money that it's easier just to add a new server and move everything over. Since the average server load is close to zero and only peaks once a day (when doing compressed backups), there's no point in moving to anything faster.

      However, more RAM would mean being able to increase the squid cache, which now is limited to 24 GB, due to RAM, not disk space.

      Regards,
      --
      *Art

    3. Re:size by TheSHAD0W · · Score: 1

      Welllll... What's better? A big RAM disk in an uncached portion of main memory, or a small RAM disk on a video card - also uncached?

    4. Re:size by sootman · · Score: 1

      Maybe it uses an integrated video chipset that shares the main memory. D'oh!

      In that case, the best advice would be "Go into the BIOS and dial it down to 1MB." :-)

      --
      Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
    5. Re:size by arivanov · · Score: 1

      Depends on a few things.

      1. How good is the OS is on mapping memory. If you can map RAM to isolate the uncached area for RAMDISK it may be faster. Which reminds me that for some applications and some cache strategies it may be beneficial to have the swap RAMDISK uncached (your mileage may vary).

      2. Which bus does the video card sit on. AGP is hooked up more or less directly onto the CPU FSB. It also has pipelining and a couple of other nifty features to improve write performance. As a result at least on write you may end up being faster than uncached memory.

      --
      Baker's Law: Misery no longer loves company. Nowadays it insists on it
      http://www.sigsegv.cx/
    6. Re:size by jbcsee · · Score: 1

      That is not always true. My main machine has 32 gigs of RAM, to upgrade that anymore would me an expensive undertaking (I can go up to 64 gigs). However, putting in 2 gigs of video RAM on the PCIe bus is fairly cheap, under $1000.

  6. Maybe, but need GPU specs by redelm · · Score: 4, Interesting
    This is certainly a clever idea for small amounts of swap (~256 MB). But to make it work well, you'd have to find the GPU commands for block moves from main RAM to vidRAM. That's the only way to activate the AGPx2 and higher modes.

    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.

    1. Re:Maybe, but need GPU specs by Anonymous Coward · · Score: 0

      And pray tell us , How will we guarantee that no other program or process doesn't access this Video ram area and corrupt the contents and then this corruption is swapped back into a running process or program?
      Please tell us why that cant happen ?
          The result would be like the mother of all bugs , It woudd act like flaky system ram
      and the result can be systemic and if say a running program serializes (stores to disk this corruption we have the mother of all bugs )
        Why do we have this Guarantee if any that this wont happen ?
      Ps, for those with microprocessor dynamic ram lab and understands how the Os uses memory,please reply . If we truly have this guarantee this would be a great idea, otherwise it seems damn foolish
        Putting he question another way, How is the use this Ram locked out from say another program or process that uses the video memory ?

    2. Re:Maybe, but need GPU specs by 644bd346996 · · Score: 1

      No programs would have direct access to the video RAM, any more than they have access to the address space of other running programs. Only the kernel itself would be able to control what gets swapped out to vram.

      Seriously, you write as though your brain hasn't been used since the heyday of Windows 3.1. Go learn what a real operating system is these days.

    3. Re:Maybe, but need GPU specs by rbanffy · · Score: 1

      There could be a way to turn off the raster generator and then increase the reading speed a bit. However I doubt any video board designer ever considered such a corner case.

      But, given the story that the machine is a server running an e-commerce website that, presumably, should be up most of the time, I would suggest buying a cheap entry level server from Dell with enough memory and just forgetting about it. Running a server on luck generally indicates someone will have to deal with an emergency migration one day or the other.

      If they have to pay for rack space, a 1u rack unit would quickly pay for itself.

  7. Performance != Stability by bostons1337 · · Score: 5, Insightful

    This doesn't sound like the most stable thing to do especially if your running a server on the same computer. It sounds good on paper but implementing it is a whole different game. From my years in IT never try anything like this on production servers, thats what test servers are for.

    1. Re:Performance != Stability by verbatim_verbose · · Score: 1

      Eh... if you're running production servers, spend a few bucks and buy adequate RAM and disks.

      This is more an exercise for novelty/home enthusiasts.

    2. Re:Performance != Stability by IcephishCR · · Score: 1

      But if it works well in the test environment your could then transition into production - I would us this for other items than swap; most servers have plenty of ram, its those small seek happy applications that need alot of temp space (like AV and Spam checkers for mail servers, PHP temp space) items like these could be mapped there instead of tying up disk I/O for very small and transient files

      --
      Life is but a Beta test...
  8. No by Anonymous Coward · · Score: 0

    VRAM speed is optimized for access by the GPU.

    In addition, AGP buses will provide much faster writes than readback. PCIe devices should have less of this problem.

  9. Just misinformed by spun · · Score: 3, Interesting

    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
    1. Re:Just misinformed by Corporate+Troll · · Score: 4, Insightful

      Video RAM is designed for performance, not for stability. If a bit flips in your video RAM, a pixel is going to be bad or a texture will be slightly different. You're not going to notice.

      A bit flip in your swap space (or main RAM), now that is something you really don't want to happen....

    2. Re:Just misinformed by Overzeetop · · Score: 1

      If you can buy enough memory not to have to swap, why would you? Swap is for people who can't afford any more memory, and are willing to take a massive performance hit to avoid said expense. If you're running very few apps, most of your memory is going to be data, and if most of your memory is data, then swapping out unused code to disc will not free up much memory (on a percentage basis). I'm with the GP on this one.

      --
      Is it just my observation, or are there way too many stupid people in the world?
    3. Re:Just misinformed by Spazmania · · Score: 1

      If you can swap out an unused page of code or data to provide more room for disk cache, why not do it?

      Because your idea of "unused" and Linux's idea of "unused" don't always match up well.

      --
      Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
    4. Re:Just misinformed by Molt · · Score: 1

      On that basis though wouldn't it make more sense to use the video RAM as disk cache?

      --
      404 Not Found: No such file or resource as '.sig'
    5. Re:Just misinformed by ToasterMonkey · · Score: 1

      The machine in question is meant to be a server right? Sure it might do some swapping, not out of necessity, but just to make room for more filesystem cache. For that, all he needs a bit of harddrive space. If the machine is swapping because real memory is low (why else would you be concerned with swap performance?), then add more RAM. Simple.
      If there is a funky server process that needs to be highly responsive but sleeps long periods of time in between use, Linux has parameters to encourage it not to be swapped out.

      Have enough RAM + don't take stuff out of RAM if you still need it = who needs swap??
      Having more RAM is ALWAYS better than scavenging some from old processes. Swapping just improves the efficiency of available RAM for people who couldn't get more of it.

    6. Re:Just misinformed by Corporate+Troll · · Score: 3, Interesting

      Swap is more than that... It also allows you to recover a machine that runs out of memory due to a runaway process. Login remotely won't work if no process gets memory anymore, so you can't kill the runaway process. With swap, you'll be able to log in, kill the process and recover the machine. That said, it won't be fast, but at least you've got an option.

      Read up on Virtual Memory, because there is much more behind it that just "dumping memory that's not used to disk".

    7. Re:Just misinformed by mikael · · Score: 2, Insightful

      It will be more than slightly different if one of the most significant bits of any byte is changed in such a way, it may very well be white or black instead of medium gray. Also, VRAM is used for more than just pixel data now. It it also used to store geometry in the form of display lists and executable code for vertex, geometry and pixel shaders. One bit flipped in a floating-point value or in a executable bit of code and it could affect an entire rendered frame.

      Although, I can only imagine the senior engineers at companies at Nvidia raising their hands to their head and screaming "Noooooooo!!!!". I guess that happens when you choose to have one storage device have a faster bus transfer rate than all the others.

      --
      Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
    8. Re:Just misinformed by arth1 · · Score: 4, Informative

      If you can buy enough memory not to have to swap, why would you? Swap is for people who can't afford any more memory, and are willing to take a massive performance hit to avoid said expense.

      Bzzt - wrong.
      Even high-end systems use swap space, because it allows for swapping out parts of memory that isn't called, freeing up that memory for things like disk cache, which does have a positive effect.

      Doing "free" on a system here, I see that there's 886492 kB of free memory, of which 879896 kB is used for disk cache. 72892 kB is swapped to disk, and if there were no swap, the disk cache would have been that much smaller. Even if I had umpteen gigabytes of RAM free, that still would be 70 MB of extra cache by using a swap partition. That's a Good Thing.

      What's a Bad Thing is when swap is used because you run low on memory -- then you get trashing and a seriously slow system. But on a healthy system with enough free memory, where the kernel can swap out pages not because it has to, but because it makes sense, using swap is a Good Thing.
    9. Re:Just misinformed by AVee · · Score: 1

      Swap is for people who can't afford any more memory, and are willing to take a massive performance hit to avoid said expense. Cheapskate! Ram is for people who can't afford any more Level 2 cache, and are willing to take a massive performance hit to avoid said expense.

      In fact, Level 2 cache is for... Oh well, nevermind.
    10. Re:Just misinformed by Barny · · Score: 3, Insightful

      Problem is, most people who think the whole "swapping is bad" thing are windows users, an OS that still has a tendency to swap out the most interesting and useful things.

      Swap is great for a server or workstation, once set on a single task it needs never do anything else till shut down, but for a windows PC that could at any time have anything run on it (not to mention a sub-standard disk cache system) having parts swapped out to make room for a disk cache that doesn't do a whole awful lot is less than optimal.

      This is of course the point where you point out that converting all your junk to windows vista and training all your staff to use the new office 2007 "ribbon" is about the same cost as training them to use linux and OOo, the latter being a lot cheaper too :)

      --
      ...
      /me sighs
    11. Re:Just misinformed by Anonymous Coward · · Score: 1

      Bzzt - wrong... Even if I had umpteen gigabytes of RAM free, that still would be 70 MB of extra cache by using a swap partition.

      Which is a trivial ~1% of your memory space. In other words, there's relatively little that can be permanently swapped out. The parent post is generally valid. If the guy is considering using video ram as swap to improve performance on a low-end server, he's definitely optimizing the wrong thing. Additional main system memory will have vastly more of an effect on performance.

    12. Re:Just misinformed by Anonymous Coward · · Score: 0

      Disk cache is not given a higher priority over programs. If that were the case, then reading a 20 GB file would push all your programs (esp. the idle ones) into swap. But I can't see that happening on my machine here.

    13. Re:Just misinformed by dgatwood · · Score: 5, Interesting

      Uh... no. I've heard that argument before, but I don't buy it. An ideal system is one that doesn't page anything out to disk. In fact, I make it a point to always have enough memory that my pageout count does not increase during normal use. As soon as you page out anything, you're taking a performance hit. Period. Paging out data to disk in order to make room for disk cache is almost never a good idea, as the changes of needing to later access a data page page in an application are typically far greater than the chances of reusing a randomly read block on disk.

      A disk cache (a limited amount of readahead notwithstanding) is only useful for data that is used more than once, which makes it a highly transient data store. Storing most data in cache longer than a few minutes usually doesn't buy you anything in terms of performance because if data isn't reused fairly soon after initial use, odds are it won't ever be.

      By contrast, data explicitly loaded into RAM by an application (assuming the app is reasonably well written) is in memory for a reason, and if the data were transient, the app would have repeatedly reused a single chunk of temporary storage instead of keeping the data around. The odds that any data won't ever be used again should be vanishingly small unless an app is written poorly. For example, in a word processor, the majority of memory pages associated with a file will probably get touched when you save changes to disk even if you never actually scroll to the end of the file. Yes, there are ways to avoid that by manually organizing your data structures in memory, but it usually doesn't make sense to optimize memory organization that heavily.

      In any case, regardless of memory organization, it is safe to assume that the vast majority of application data pages (not the actual executable code pages) will be reused at some point in the future. As such, paging out any of this data will require that the data be paged back in at some point, causing a noticeable stall for the user. This is slightly less significant for background daemons, but still true.

      Thus, cache is a great example of the principe of diminishing returns. Doubling cache does not necessarily double the benefits. Once cache gets to a certain point, doubling it no longer significantly increases the number of additional hits in the cache. Every increase beyond that point will likely hurt performance by increasing the management overhead without actually increasing the number of successful hits.

      Indeed, the only thing that makes sense to not keep in core is infrequently used code text, but that can be thrown away without ever paging it out; it can always be paged back in from the original executable if needed. Even then, an optimal system should not throw out anything except in small physical memory configurations. If you don't have enough RAM, increasing the inherently small disk cache by a small amount actually will result in a significant increase in hits and throwing out infrequently used code pages won't result in a significant performance penalty by comparison. In a large memory configuration, increasing the amount of disk cache won't have much benefit at all, and throwing out those pages probably has a much greater chance of resulting in a performance hit than throwing out a previously read random block on disk; if a page has been used once, the odds are better that it will be used again.

      Note: this all assumes that your OS is smart enough to only load in application pages as they are used rather than loading the entire app in at launch. If it isn't, then you have bigger problems, of course.... :-)

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    14. Re:Just misinformed by Just+Some+Guy · · Score: 1

      Even high-end systems use swap space, because it allows for swapping out parts of memory that isn't called, freeing up that memory for things like disk cache, which does have a positive effect.

      What he said. I'm 184MB into swap on a mostly-idle system with 120MB free out of 1280MB installed. That's a good thing because that old data isn't competing for RAM with new processes.

      --
      Dewey, what part of this looks like authorities should be involved?
    15. Re:Just misinformed by Anonymous Coward · · Score: 0

      read-only data like code should never swap, it can always be read again from disk anyway, so why go to the trouble of writing an extra copy?

    16. Re:Just misinformed by babyrat · · Score: 1

      so your telling me if I have 16GB of RAM in my system and am running an email program, and solitaire (to amuse myself while waiting for more email to arrive) that I will notice whether I have swap space or not?

      Bzzztt wrong.

      Given effectively unlimited RAM for the task at hand swap won't matter even a little bit.

    17. Re:Just misinformed by flows · · Score: 0

      Problem is, most people who think the whole "swapping is bad" thing are windows users

      That's because windows did such a lousy job at managing swap files in windows 95/98/ME that "Disable Virtual Memory" was a common procedure. with obvious disatrous results. you'll still find hundreds of "tips and tricks" pages that recommend it if you google.

    18. Re:Just misinformed by BradleyUffner · · Score: 1

      Pixel and vertex shaders are actual computer code living and executed on the video cards' ram. If that gets corrupted you WILL notice it, as it will most likely crash the application.

    19. Re:Just misinformed by lena_10326 · · Score: 1

      If a bit flips in your video RAM, a pixel is going to be bad or a texture will be slightly different. You're not going to notice.
      What if that bit flipped is in the data structure that defines a collection of of surfaces? How about when the bit flipped is in header data for a texture image? A 100x100 pixel texture now reads as 2,147,483,748x100 pixels. Wonder what happens when that corrupted texture is swapped out for another texture. Ouch.

      Yea. I'm sure you'll hardly noticed when the rendered scene looks like a bunch of garbled noise.. or your video driver is blue screening your box.. or the GPU is off in la-la land munching away on bad data. Not all the memory is used for the frame buffer.

      --
      Camping on quad since 1996.
    20. Re:Just misinformed by edwdig · · Score: 2, Interesting

      Paging out data to disk in order to make room for disk cache is almost never a good idea, as the changes of needing to later access a data page page in an application are typically far greater than the chances of reusing a randomly read block on disk.

      That depends on how you use your computer. Think about at a programmer's workload. You start the compiler, it processes your code along with a ton of other files it depends on, then you get the results. And usually a few minutes later you'll have another build with more changes.

      By contrast, data explicitly loaded into RAM by an application (assuming the app is reasonably well written) is in memory for a reason, and if the data were transient, the app would have repeatedly reused a single chunk of temporary storage instead of keeping the data around. The odds that any data won't ever be used again should be vanishingly small unless an app is written poorly.

      Again, programmer's workflow. Take a program like Visual Studio. It'll read in and parse your entire program and all the headers it's dependent on. It'll store a tree in memory of all the symbols within the scope of the project. On a large project, only a very small portion of that symbol data will be useful to what you're currently working on, but the IDE has no way of knowing what code you're going to write, so it can't trim down that data.

      Thus, cache is a great example of the principe of diminishing returns. Doubling cache does not necessarily double the benefits. Once cache gets to a certain point, doubling it no longer significantly increases the number of additional hits in the cache. Every increase beyond that point will likely hurt performance by increasing the management overhead without actually increasing the number of successful hits.

      You probably need a ridiculous amount of RAM and an extreme habit of opening files once and never using them again before that would have a detectable impact.

      Indeed, the only thing that makes sense to not keep in core is infrequently used code text, but that can be thrown away without ever paging it out; it can always be paged back in from the original executable if needed. ...
      Note: this all assumes that your OS is smart enough to only load in application pages as they are used rather than loading the entire app in at launch.


      You're forgetting about one big factor. Code relocation. Any time code calls a shared library, the program loader has to fill in the appropriate memory address at load time. The code loaded does not directly match the code on disk anymore. In a C++ program, there's a LOT of relocations that need to be done. They're slow. Look into all the "Why does KDE take so long to start up?" stories if you don't believe me. The relocations have two side effects relevant to this discussion:

      1) A much larger portion of the executable gets loaded at startup than you would otherwise think.

      2) Sections of code with relocations can't simply be reread from disk and must instead be swapped as needed, unless you move the relocation logic from userspace and into the kernel.

    21. Re:Just misinformed by mr_mischief · · Score: 1

      Those are features of newer 3D accelerated cards, though. It'll apply to other people, but probably not to the OP. If this is an older server-class machine with on-board graphics, it may well not have those features.

      I still doubt the RAM is overly faulty (if it's even separate from system RAM) since most video memory is soldered in place. A random bit in an image flipping is one thing, but enough of those and it's a whole card or motherboard being RMAed and not just a chip. Reliability would still seem to be of some importance to the video device makers for that simple reason.

    22. Re:Just misinformed by dgatwood · · Score: 3, Interesting

      That depends on how you use your computer. Think about at a programmer's workload. You start the compiler, it processes your code along with a ton of other files it depends on, then you get the results. And usually a few minutes later you'll have another build with more changes.

      That's true, but only because a programmer's usage patterns are highly atypical. Typical usage patterns for normal users do not involve lots of short-lived processes that read in a chunk of data, process it, and exit; the UNIX way of programming (small tools with pipes between them) just didn't catch on in the general computing space, and for good reason---it's an excellent design for programmer tools, but a poor design for end user tools because users generally prefer to work on a task to completion.

      Indeed, it could be argued that this is the result of a toolchain that is not well designed. One could easily imagine an IDE that memory maps the source tree and binary build results into RAM, sharing those pages with the short-lived compiler. This would end up being a much faster workflow because instead of having to go through filesystem lookups and read the blocks (which is relatively slow even from cache), the compiler would simply be handed the data it needs, or at least a series of VM pages that will contain the needed content after it is paged in. You would pay the penalty once at launch time (or better yet, defer mapping until the data from a particular file is needed) and never pay the lookup penalty again. That would make it more in line with a typical user's usage patterns.

      The typical computer user (not programmer) reboots their computer every few days, whether because they need to swap batteries in a laptop, because the kernel is leaking memory, etc. For them, that gives a fairly short upper bound to the lifespan of data in the cache. They typically run an application that loads or memory maps a file into RAM, work with it for a period of minutes or even hours, then close the file and work on something else. They don't open the file and close it repeatedly, and neither do their applications. That's a very degenerate usage pattern.... :-)

      You probably need a ridiculous amount of RAM and an extreme habit of opening files once and never using them again before that would have a detectable impact.

      Not at all. If you double the size of the cache, you double the size of the data structure that maintains the cache. If you are looking up a block in a tree, for example, that means the average time to do the lookup will be log_2(2n) instead of log_2(n). While in theory, that's not a big difference, in practice, that translates to an average of one extra tree node before you get to the node you're looking for. Multiply that times the number of cache lookups, and it adds up. Such a hit must be justified by the increased size of the cache. If the computer reboots before that data is needed again, you've just made every disk operation take an extra few dozen CPU cycles with no benefit.

      Put another way, if you have 512 megs of cache and are working with 512KB blocks, you have 1024 blocks cached, and your tree depth is 10 nodes (log_2 of 1024). If you double the size of the cache, you are adding one extra hop, so you have increased the amount of cache lookup time by an average of 10% for every lookup, including those that get served from the cache. That means that your cache is now effectively 10% slower than it was before. If most of your data is already cached, that's a pretty huge impact, and if you are pulling data from cache frequently, it can easily exceed the gains you'd get from occasionally saving a disk read.

      Also, bear in mind that there is a psychological advantage to using the smaller cache in such a case. Pausing once a minute for a full second to read bits in from disk is far less annoying to the user than adding a .1 second delay every time the user pulls down a

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    23. Re:Just misinformed by Mattsson · · Score: 1

      Video RAM is no longer using special-purpose VRAM-chips. They use exactly the same kinds of chips that sits on your DDR2- or DDR3-DIMMS and are exactly as reliable as them, unless you're actually using ECC-RAM.
      A graphics card with intermittent RAM-errors is very noticeable when running 3D-software, like games, Windows Vista, etc)
      While running a 2D desktop, you might not experience much problems and might not know that you have a defective chip on your graphics-card, but the same it true with a defective chip in your systems main RAM.
      You could be churning out millions of erroneous calculations every second and not have a clue if running a standard system without ECC-RAM and ECC cpu-caches.

      --
      /.Mattsson - My native language is not English, so please don't whine over linguistic errors. (That's lame anyway...)
    24. Re:Just misinformed by Anonymous Coward · · Score: 0

      Your assumptions about application behavior are very optimisitic. System or desktop daemons that run in the background but aren't used much or leaky long-running apps like Firefox or your X server all generate modified pages that aren't used often (or at all) that could be pushed to disk instead of occupying valuable RAM.

      You also ignore users who switch between applications which could benefit from large amounts of memory. I might want Photoshop to use all of my RAM for a while without having to kill my browser or e-mail sessions idling in the background.

    25. Re:Just misinformed by Overzeetop · · Score: 1

      Actually, you're right. But RAM _is_ cheap, and L1 (or L2) cache isn't exactly expandable.

      I suppose it would be nice to put everything into memory and just keep the machine on with enough power to keep the RAM refreshed. But then it would look more like a PDA.

      Besides, as bad as the latency is from RAM to Ln, it ain't nothing like disc latency.

      --
      Is it just my observation, or are there way too many stupid people in the world?
    26. Re:Just misinformed by basneder · · Score: 0

      Video RAM is designed for performance, not for stability. If a bit flips in your video RAM, a pixel is going to be bad or a texture will be slightly different. You're not going to notice.

      A bit flip in your swap space (or main RAM), now that is something you really don't want to happen....

      Just install RAID5 on your video memory! The downside is you'll need atleast 3 videocards
    27. Re:Just misinformed by thePowerOfGrayskull · · Score: 1

      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. Except presumably, sooner or later I will want that code or data back in memory -- at which point I now have to wait, for the benefit of having some more files cached that I may or may not be referring to multiple times...
    28. Re:Just misinformed by Anonymous Coward · · Score: 0

      I can only disagree with this...

      "A disk cache (a limited amount of readahead notwithstanding) is only useful for data that is used more than once, which makes it a highly transient data store. Storing most data in cache longer than a few minutes usually doesn't buy you anything in terms of performance because if data isn't reused fairly soon after initial use, odds are it won't ever be."

      He stated he has a web server running e-commerce. That most likely means he will always be looking at the same disk cache. Also, do you not close and open your terminal services client throughout the day? Or Mozilla, or wtf ever else you use constantly at work. This is not to say that I agree with the thought that paging to disk is ever OK. Paging RAM to disk is always a bad idea. And for disk cache, (n00b comment coming), why don't they build in 512 of disk cache on the hdd itself? Just a thought, never asked the question before...

      JC

    29. Re:Just misinformed by XdevXnull · · Score: 1

      1) This guy is using the computer in question as a file server. 99% of what it is doing will benefit greatly from a large disk cache. 2) "this all assumes that your OS is smart enough to only load in application pages as they are used rather than loading the entire app in at launch." Wouldn't that result in a *gasp* delay?? I don't want to start up firefox and have to wait several seconds when I enter a URL because the HTTP request module isn't loaded into RAM yet.

      --
      "I'm a Laver, not a Phyto[plankton]"
    30. Re:Just misinformed by Anonymous Coward · · Score: 0

      You're looking on this at a local scale, rather than a global scale. The first is easy to see that paging pages out incurs a performance hit, because paging out always takes more time than not paging out. That's pretty trivial to understand.

      What's hard to understand is the global performance implications. Does paging page X out now mean that I can get better performance by using that space for something else, which will increase performance by more than I'm losing by spending time paging X out (and potentially back in, at some point)?

      As with many global optimization problems, the answer is usually, "I don't know." You need to measure your workload, and find out. Or you don't care, and rely on heuristics which are good for 99% of situations. (This is what the vast majority of people who don't need to optimize performance to the very last millisecond end up doing.)

      You can always counter, of course, that installing an unbounded amount of RAM would solve the problem--never swapping out is always going to be faster than anything else. However, besides the obvious practical issues with this, the theoretical idea behind modern RAM management is that it acts like a cache for secondary storage, which is inevitably larger. Unless you're on an embedded system, you always have the possibility of needing to page.

      Caches and cache scheduling are very important aspects of any modern operating system, and kernel developers (whether it be Linux, NT, Darwin, etc.) spend a lot of their time trying to improve this. They do this with benchmarks run against typical workloads, trying out different possibilities to improve performance. Whatever algorithm the operating system uses by default is probably a pretty good one. I can certainly see any number of scenarios where paging infrequently-used pages in favor of disk cache will provide a net benefit.

      All that said, keep in mind that all modern operating systems use a unified buffer cache. Basically, every page in the address space is treated equitably, whether it comes from program text, anonymous memory used for process data, or from disk files. The only question for the paging algorithm is then not whether or not it's better to evict pages to increase the size of the disk cache, but whether it's more valuable to have these pages (representing portions of a disk file) in memory rather than those pages (perhaps representing some large, sparsely accessed arrays generated at program initialization time).

      With that understanding, it's largely meaningless to consider the source of the page. The only thing that matters is how it's used (or not used) by the running system. A program that reads from disk a lot will benefit from those pages being from disk files. A program that intensively uses memory will benefit from those pages being variable storage. A program that spends most of its time in the CPU cache and is CPU bound won't care one way or another, as long as its intensively used pages aren't paged out.

      Meanwhile, the job of the disk caching algorithm is to try and guess what pages are going to be needed next, and use whatever memory the page cache makes available to perform this job. Overly aggressive disk caches aren't optimal when you have I/O bound processes that might need that I/O resource for other purposes. Once again, it's about finding a balance, which involves heuristics, benchmarks, and some guesswork.

      To simplify all this, there's basically two pools of storage an operating system is concerned with: main memory, and secondary storage. All paging and disk caching algorithms are trying to find the optimal way to distribute pages of storage between these two mediums, in response to load. Disk cache vs. process memory is a false dichotomy.

    31. Re:Just misinformed by heinousjay · · Score: 1

      Nothing like using an utterly unrealistic example to make a point.

      --
      Slashdot - where whining about luck is the new way to make the world you want.
    32. Re:Just misinformed by edwdig · · Score: 1

      That's true, but only because a programmer's usage patterns are highly atypical. Typical usage patterns for normal users do not involve lots of short-lived processes that read in a chunk of data, process it, and exit;

      Ignore the short lived process part of it, which isn't the important part, and it's not that atypical. Anything involving HTML is going to be frequently opening and closing the same files. Whether you're designing a site or just browsing the company intranet in a web browser, you're going to be constantly opening and closing lots of HTML, image, and stylesheet files.

      Audio work will have similar patterns - modify your composition, then read in the samples to create the output. Or 3D graphics work with the textures.

      Oh, and lets not forget databases, which are full of random access of large data sets.

      This would end up being a much faster workflow because instead of having to go through filesystem lookups and read the blocks (which is relatively slow even from cache), the compiler would simply be handed the data it needs, or at least a series of VM pages that will contain the needed content after it is paged in.

      On any sort of large project, the memory demands for a system like that would be unfeasible. Not to mention you're basically just creating your own cache, which would have the same access issues as the system cache.

      The typical computer user (not programmer) reboots their computer every few days, whether because they need to swap batteries in a laptop, because the kernel is leaking memory, etc. For them, that gives a fairly short upper bound to the lifespan of data in the cache.

      That was true in the Win9x days, but not anymore. Look at your typical college or office setup. It's pretty rare to turn the computers off in those places.

      If the computer reboots before that data is needed again, you've just made every disk operation take an extra few dozen CPU cycles with no benefit.

      A few dozen CPU cycles on a modern computer is going to take in the ballpark of 10-20 nanoseconds. A typical hard disk is going to take around 10 milliseconds to seek to the data, plus the time to read it. The CPU time is completely negligible.

      That means that your cache is now effectively 10% slower than it was before. If most of your data is already cached, that's a pretty huge impact, and if you are pulling data from cache frequently, it can easily exceed the gains you'd get from occasionally saving a disk read.

      10% slower cache is completely meaningless when you realize that the cache lookup is a million times faster than the disk read.

      That should not be the case. The symbol tables are the only thing that absolutely has to be loaded at startup. Everything after that should be on an as-needed basis, though there are performance advantages to immediately loading all of the blocks containing functions that you know will be used during a typical application launch, of course.

      Theory and practice are different though. Seriously, read some of the "Why does KDE start so slowly?" articles. A very large amount of symbols get resolved at program startup. Enough to create very noticeable delays.

      You can still throw this page away; if you have to reload it from disk, then you just take the extra performance hit of having to relink it. The logic need not be in the kernel. I don't see any reason why relocatable code should be any different except for the need to keep track of where you put it instead of relying on the file to provide a load address.

      The problem with this is the entire concept of virtual memory. Virtual memory is completely transparent to the application. Only the kernel knows it happens. Relocations are done in userspace. What you're talking about here makes sense and could be done with enough kernel work, but isn't. At least not in modern Unix systems. I don't know about Windows.

  10. Sounds like a quite pointless idea by wlad · · Score: 1

    Video card memory is much more expensive than normal RAM for a reason, as it has to support crazy throughputs for things like alpha blending. This throughput advantage does not apply when the host (CPU) accesses the memory. PCI Express is a lot faster than AGP, but it's still a bottleneck that makes it much slower than native RAM. Like the person above me already states, you're much better off just buying some extra RAM.

    1. Re:Sounds like a quite pointless idea by weierstrass · · Score: 1

      Why is it better to buy something that will cost money, than to use something you already have that is going to waste, even if that (completely free) performance is inferior?

      --
      my password really is 'stinkypants'
    2. Re:Sounds like a quite pointless idea by wlad · · Score: 1

      OK, you have a point, if it's the built in graphics card or you got it with the PC you can just as well use it. But those are generally cards with very little memory, or even of the 'hypercache' brand that costs you main memory to use. And generally, that 16MB of fast swap space extra won't really make a performance gain that is worth all the trouble.

  11. Are you looking at the right timings? by arivanov · · Score: 4, Informative

    Err... Which hdparm timings are you looking at?

    One of the biggest advantages of using VRAM for disks is the nearly 0 seek latency.

    As a result even if the card is slower than disk on read you are still likely to have an overall performance gain.

    In addition to that there is a number of architectural vagaries to consider. AGP is asymmetric. Reading is considerably slower than writing (can't find anywhere by how much. Damn...).

    --
    Baker's Law: Misery no longer loves company. Nowadays it insists on it
    http://www.sigsegv.cx/
  12. Re:AGP/PCI-E by Anonymous Coward · · Score: 0

    Yes, and that's why they want to kill whitey.

  13. video RAM by mcmonkey · · Score: 4, Insightful

    Are you sure the system has video RAM? Doesn't built-in video generally share the system RAM?

    1. Re:video RAM by demonbug · · Score: 1

      I was wondering the same thing. If that is the case, it makes sense that it would be pretty slow - all that you would be doing by making use of the "video RAM" is cannibalizing system RAM, and accessing it in a presumably slower way (since any reads/writes to it would have the extra step of going through the video system, which depending on the age of the system is likely to be relatively slow).

    2. Re:video RAM by julesh · · Score: 2, Informative

      Doesn't built-in video generally share the system RAM?

      Not always. For example, I have a machine that has 32MB of video RAM, and can use additional system RAM if necessary.

    3. Re:video RAM by sean4u · · Score: 1

      You might have hit the nail on the head for me - digging out the manual that came with the motherboard, I see the P4S800-MX SE's Sis Real256E integrated graphics has "a maximum 64MB shared memory". I can completely give up on this right now, after perhaps fixing what looks like a dodgy BIOS setting (lspci reports 128MB for the Display Adapter).

      What caused me to submit the article was first the disappointing result when I tried this technique (with clear reason now, thanks), but more importantly the often-claimed "superior performance" of VRAM as swap. It was even in the wikipedia article for Virtual memory.

      Does anybody get superior performance from Video RAM as swap? If nothing else, the replies here will at least balance out the claims made elsewhere.

  14. Short answer: by Ihlosi · · Score: 1, Insightful
    Is video RAM a good swap device

    No.

    It's an interesting hack to use it as such, but in terms of performance you're better off investing in more RAM and a faster HDD.

    1. Re:Short answer: by AVee · · Score: 1

      If you were to choose between spending money on one or the other you may well be right, however for people like me, the ones with a big box of old hardware bur never enough memory it may well be a cheaper solution.

    2. Re:Short answer: by ubergeek65536 · · Score: 1

      What if you don't want to invest anything? Even the cheapest of PCIe video cards have 256MB or more and will do 400MB/S plus. 90% of the time that memory isn't being used.

      If you are interested in testing your cards memory bandwidth check out gpubench at http://sourceforge.net/projects/gpubench

    3. Re:Short answer: by 644bd346996 · · Score: 5, Insightful

      Which is, of course, a completely useless and disingenuous answer to a person who already has the graphics memory sitting around, and wants to know if it is better than a hard drive.

      You seem to be advocating wasting perfectly good VRAM in favor of buying more system RAM. If the VRAM is essentially free (ie. comes with the system no matter what), there is no good reason not to try to put it to good use.

      Also, your "No" is completely unqualified. You offer no details of how VRAM performs worse as swap space than hard drives, let alone actual benchmarks or citations. (And I have the feeling that most graphics memory would be significantly better than your average IDE hard drive for swapping.)

      Mod parent overrated.

    4. Re:Short answer: by eggnoglatte · · Score: 1

      Look, I like GPU hacks as much as the next guy, but your "the video ram is free anyways" argumentation is a typical geek phallacy. Yes, the hardware has is free, but if the guy seriously counted the value of his own time to make this "solution" "work" (I am using both terms in the loosest possible sense), then he would easily discover that this approach is both more expensive and less reliable than just going out and buying some new hardware.

      This is a nice hobbyist project, and you can probably learn a lot doing it, but he is trying to run an e-commerce site, for crying out loud.

  15. Re:AGP/PCI-E by Anonymous Coward · · Score: 0

    s/niggers/trolls/g

  16. yeah, I know it means no screen by jollyreaper · · Score: 4, Funny

    I know headless means that the system doesn't have a screen but I still get this idea of a box strapped to a horse, chasing down Ichabod Crane.

    --
    Kwisatz Haderach
    Sell the spice to CHOAM
    This Mahdi took Shaddam's Throne
    1. Re:yeah, I know it means no screen by curmudgeous · · Score: 2, Funny

      ...chasing down Ichabaud Crane.

      There, fixed that for you.

    2. Re:yeah, I know it means no screen by eharvill · · Score: 1

      ...chasing down Ichabaud Crane.
      There, fixed that for you. How does that compare to 2400 baud?
      --
      At night I drink myself to sleep and pretend I don't care that you're not here with me
    3. Re:yeah, I know it means no screen by rbanffy · · Score: 1

      One Ichabaud is about 9200 baud, so, it's about 4 times faster if noise conditions allow.

    4. Re:yeah, I know it means no screen by intchanter · · Score: 1

      ... but I still get this idea of a box strapped to a horse, chasing down Ichabod Crane.

      Then it may interest you to know that somewhere in Idaho, there's a headless box running as a server that has been named Horseman for the last five years and on its second physical box.

      It was the best I could come up with at the time, and I haven't had a better name idea yet. :-)

    5. Re:yeah, I know it means no screen by Jay+Carlson · · Score: 1

      You missed out on the PC Weasel 2000, a useful-looking video card that speaks RS-232.

      PC Weasel 2000: Making servers run headless since 1999

      You *have* to see their logo.

  17. I'd Say...Neither by camperdave · · Score: 2, Funny
    Is your adapter an AGP or PCI-Express card?

    using the Video RAM of the built-in video adapter as a swap device
    The adapter in question is built into the motherboard.
    --
    When our name is on the back of your car, we're behind you all the way!
    1. Re:I'd Say...Neither by Corporate+Troll · · Score: 2, Informative

      Bull... Even onboard video adaptors are connected to via a bus and that bus will be either ISA, VESA Local Bus, PCI, AGP or PCIe, depending on the age of the machine.

    2. Re:I'd Say...Neither by Anonymous Coward · · Score: 0

      Why bull?

      Answering 'neither' to the question "is it AGP or PCI express" is still valid, even if the reason given is not.

    3. Re:I'd Say...Neither by Bodrius · · Score: 1

      Because the onboard graphics adapter is still either AGP or PCI-e.

      The bus defines that, and the onboard chip still uses either bus.

      "Neither" is only a valid option if it is really old hardware and uses yet another bus (VESA? EISA?)... but I haven't seen those in... 10 years by now?

      --
      Freedom is the freedom to say 2+2=4, everything else follows...
    4. Re:I'd Say...Neither by Machtyn · · Score: 1

      If the adapter is built onto the motherboard, are you sure it is not sharing physical memory? You have 1024MB RAM, 256 being used by graphics, so OS has 768MB to work with.

      Of course, there are some boards out there with onboard graphics chipset with dedicated memory, but those are few and fairly expensive.

      Still, as others have mentioned, even with onboard graphics, it is still using a bus, likely a PCI-E or AGP bus.

    5. Re:I'd Say...Neither by langelgjm · · Score: 1

      What would be even funnier is if it were one of those cards that uses "shared" system memory for video memory.

      --
      "Anyone who [rips a CD] is probably engaging in copyright infringement." - David O. Carson
    6. Re:I'd Say...Neither by Anonymous Coward · · Score: 0

      "Neither" is only a valid option if it is really old hardware and uses yet another bus (VESA? EISA?)... but I haven't seen those in... 10 years by now?

      So, because you've not seen an on-board PCI controller in years, no one else could possibly be using one?
    7. Re:I'd Say...Neither by mabhatter654 · · Score: 1

      Built in adapters have no ram of their own and proprietary connections to the internals of the chipset.. this is bunk. This might be interesting on a PCI-E Geforce with 256MB of DDR3 though.

    8. Re:I'd Say...Neither by Amouth · · Score: 1

      and if they do have deticated memory on board for video.. it is a small amount.. between 1-4mb normaly...

      most i have everseen was the dell c400 latop which has 64mb of onboard (non shared) video memory... now if only it had had a better video chipset than the cheep intel one..

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    9. Re:I'd Say...Neither by OS24Ever · · Score: 4, Insightful

      Neither of the technologies he listed were PCI. VESA came out in the late 80s/early 90s, as did EISA. to the best of my knowledge EISA was never used on video cards unless it was highly specialized. they went from the VESA local bus, to PCI, to AGP and its various speeds, to PCI-E x16.

      I think one of the points of confusion here seems to be that most people don't realize that while something is built into a motherboard it doesn't have some magical interface that makes the bits fly differently than if it was in a slot. I think that is what is attempted to be said by the multiple posts this comment has generated

      --

      As a rock-in-roll Physicist once said, No matter where you go, there you are.

    10. Re:I'd Say...Neither by chmod+a+x+mojo · · Score: 1

      Built in adapters have no ram of their own

      That is true in MOST cases, but not always. Some internal video cards do have their own VRAM, like the savages used in older BioStar boards. I have one BioStar board that has 32MB VRAM with an option to share up to another 32MB from system RAM.
      --
      To err is human; effective mayhem requires the root password!
    11. Re:I'd Say...Neither by abradsn · · Score: 1

      Never say never. There are sometimes, especially with old machines that the board does have some video memory on it. It's usually a very small amount of memory though (if it is there at all).

    12. Re:I'd Say...Neither by Machtyn · · Score: 1

      Not necessarily, I've seen up to 256MB with the latest motherboards with IGP. But certainly, the older boards with IGP generally maxed at 64MB. (and then really old boards, 7+ y/o boards, maxed at 8MB if you were lucky.)

    13. Re:I'd Say...Neither by Anonymous Coward · · Score: 0

      most i have everseen was the dell c400 latop which has 64mb of onboard (non shared) video memory... now if only it had had a better video chipset than the cheep intel one.. I love my i830GM, you insensitive clod!
      Latitude c400 doesn't have onboard vram, quite contrary its shared video memory was limited to few megs by the BIOS in earlier models (I don't remember just how much, but it was so little that you couldn't run X at full resolution).
    14. Re:I'd Say...Neither by Anonymous Coward · · Score: 0

      Mylex made EISA graphics cards too. For your computer history lesson today, here are some more:

      http://stason.org/TULARC/pc/graphics-cards/EISA_t.html

    15. Re:I'd Say...Neither by SanityInAnarchy · · Score: 1

      I think one of the points of confusion here seems to be that most people don't realize that while something is built into a motherboard it doesn't have some magical interface that makes the bits fly differently than if it was in a slot.

      Actually, some of them do -- I seem to remember PHY (for network cards) is only available if the card is part of the motherboard. Also, if you buy a gigabit PCI card, you'll likely saturate your PCI bus.

      What you wanted was: Just because it's built in doesn't necessarily mean it has a magical interface. It might, or it might not.

      --
      Don't thank God, thank a doctor!
    16. Re:I'd Say...Neither by kjs3 · · Score: 1

      There were a number of EISA video cards (e.g. Compaq Qvision, ATI Ultra Pro) and were pretty widespread at least as far as EISA was widespread (i.e. not very).

    17. Re:I'd Say...Neither by Amouth · · Score: 1

      the c400 i am typeing on has 64mb of deticated video memory on board.. so .. yea it might be that there are diffrent models of this laptop..

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
  18. Quote: Direct Rendering or fast swap. Your choice. by Anonymous Coward · · Score: 0

    I, for one, pick Direct Rendering...

    In other words, this is useless.

  19. Finally! by Anonymous Coward · · Score: 0

    Finally! A practical use for those ATI video cards that have 1 GB of video RAM!

  20. Interesting Idea by GodCandy · · Score: 1

    I have never used the ram on my graphics card for swap or as a ramdisk however that is an interesting idea. I use ram as ramdisk for some of the directories on my gentoo stations. It seems to make some processes work faster. I would have to do some down and dirty testing to see if the overall performance increase is worth the amount of ram used by the ramdisk. I currently have no less than 4 gigs in any machine that I am doing this with thus it is not a big issue however if you are running on 512 or even 1 gig and are using quite a bit of space for your ramdisk it will end up causing it to be slower than normal due to the shrinking in the amount of ram available.

    I do also agree that agp is a slower technology and that most older graphics cards only contain small amounts of memory in comparison to the mass amounts of ram that can be bought today for little money.

    Who knows... It might work great... I may have to test this out tonight and see what I come up with...

  21. Useful even if not so fast by TeknoHog · · Score: 3, Insightful

    Heck, I remember RAM expansion cards for ISA slots. I'm sure this is faster, though I didn't get any meaningful boost when I tried this once. Nevertheless, if you're running headless system, it's better IMHO if you get some use of the display hardware, rather than no use. Even if it's a little slow. You shouldn't rely on swap as a memory expansion anyway, it's just a way to gracefully degrade performance when you hit the limit.

    I think it's also nice to have swap on a different physical device/bus from your main hard drive. Maybe the swap isn't any faster, but at least it isn't slowing down any other hard drive usage.

    --
    Escher was the first MC and Giger invented the HR department.
    1. Re:Useful even if not so fast by owlstead · · Score: 1

      Oh, a friend of mine had a rather rich father who bought such a thing for a 286. Don't know how they used it exactly, as a RAM drive, swap space or even some sort of main memory (I always thought the latter, but that seems extremely unlikely for a 286). For those times, it was a whopping 2 MB of memory. I guess anything beat going to the hard drive in those days. The Borland pascal IDE seemed to be working fine with it, but hell, RAM was *expensive* back then.

    2. Re:Useful even if not so fast by TeknoHog · · Score: 2, Informative

      Oh, a friend of mine had a rather rich father who bought such a thing for a 286. Don't know how they used it exactly, as a RAM drive, swap space or even some sort of main memory (I always thought the latter, but that seems extremely unlikely for a 286).

      It was main memory, but back then we had the XMS/EMS hack instead of flat memory.

      http://en.wikipedia.org/wiki/Expanded_Memory_Specification#Expansion_boards
      --
      Escher was the first MC and Giger invented the HR department.
  22. Re:As far as swap devices go, I prefer by Anonymous Coward · · Score: 3, Funny

    Dear troll,

    You are not very good at this. People on slashdot are more or less immune to trolls that use racial slurs. In troll 101, you should have at least learned to disparage an OS or programming language if you really want to rile people up. This is a good troll, that is also topical:

    "Linux is not a very good OS to use for swapping to the video card. It's video bus support is hopelessly dated and slow, though you can use the experimental driver if you patch the kernel."

    That simple statement will get you far more responses, and perhaps even get modded up by some clueless folks with mod points. Then you can masturbate feverishly until the next time someone tries to cross your bridge.

  23. funroll-loops.org by Anonymous Coward · · Score: 0

    Once again I'm sad funroll-loops.org is only available via internet archive. This would make a prefect addition.

    http://web.archive.org/web/20061004200708/http://www.funroll-loops.org/

  24. Re:Quote: Direct Rendering or fast swap. Your choi by Bert64 · · Score: 1

    But his server is headless, as servers should be. What is he going to be directly rendering to?
    He also stated the videocard was built in, so he cant even put it to good use in another machine.

    --
    http://spamdecoy.net - free throwaway anonymous email - avoid spam!
  25. Works even better with really old video cards by Waffle+Iron · · Score: 5, Funny
    Old-fashioned dual-ported VRAM is an excellent solution for an e-commerce site. You can be loading customer transactions and one-click purchases from the VRAMs' random-access ports while you're simultaneously serving web pages from the serial-access ports. Your performance will double!

    Now if you want truly blazing speed, you can track down some of that dual-ported static RAM that came in 40-pin DIPs. Full random access on both ports would let you serve dynamic web pages while you run customer transactions, all with zero wait states on the ISA bus!

  26. Re:As far as swap devices go, I prefer by Anonymous Coward · · Score: 0

    How can you say this about teh Linuxxxx!!!

  27. Re: Trolls by Anonymous Coward · · Score: 0

    Why does /. even allow AC posting still? Seems like a flame/troll enabler.

  28. Don't try this with linux. by Anonymous Coward · · Score: 0

    Linux is not a very good OS to use for swapping to the video card. It's video bus support is hopelessly dated and slow, though you can use the experimental driver if you patch the kernel.

    1. Re:Don't try this with linux. by Anonymous Coward · · Score: 0

      No, no, no! You have to do it way up at the top like the racial slur guy!

  29. Re: Trolls by TheVelvetFlamebait · · Score: 2, Insightful

    Why does /. even allow AC posting still?
    What's wrong with them? They're easy to ignore, and they offset the problem with the moderation system, where expressing certain opinions can guarantee you negative karma.

    Besides, Slashdotters have never bought the "why are you running if you have nothing to hide" argument.
    --
    You know, there is a difference between trolling and pointing out the flaws in your reasoning. Just saying.
  30. Built in still uses the bus.... by tinkerghost · · Score: 1

    Onboard video still uses the same bus structure as available for expansion (believe I saw 1 board with all PCI slots & an ISA onboard video but it was fucked from the get go). Most of the chipsets will simply load the data on the bus & be done with it - the BIOS cuts out the onboard at POST when another video card is detected. A few of the boards seem to route through the onboard in a serial rather than true bus fashion(greatly reduced framerates on boards with the same video card & similar chipsets w/ & w/out the onboard video).

    1. Re:Built in still uses the bus.... by sumdumass · · Score: 4, Informative

      This sort of brings up another issue he might be happening. A lot of on board video cards use system memory to function properly. If the swap space is actually in system memory, the extra transfer overhear of going up the bus to the controller that then send it back to the memory that is actually sending the stuff to the video ram.. Well, you see what I mean. The extra few steps could be enough latency per read write operation to slow the thing down compared to a direct access method that would be present with an IDE connection as well as video memory built on to the video car itself.

      I think the differences might be as noticeable as turning DMA (direct memory access) on and off. And yes, you can see a big bit of difference. It was actually worth me buying new drives just to have DMA access when it first started becoming available. I remember earlier versions of windows 98 and (95 I think), that wouldn't turn it on by default. After making sure the drives supported it and enabling it, people would almost think they had a new computer. There was that much of a difference in performance.

    2. Re:Built in still uses the bus.... by dpilot · · Score: 1

      For that matter, if this is Unified (el-cheapo) Memory Architecture, and you've got "video memory" that you're not using, take a look in the BIOS and see if there's some way to dedicate less system memory for video. Giving the memory back to the system would be far better than trying to use it through the video subsystem.

      --
      The living have better things to do than to continue hating the dead.
    3. Re:Built in still uses the bus.... by Anonymous Coward · · Score: 0

      RAM is generally useful for random access uses. Putting a mysql database file in this provided area after formatting it as described in the tutorial is an example of
      a use for a video RAM disk. I think the DMA question here, however, is valid. Most major video cards handle a DMA interrupt, providing an in memory RAM buffer to the hardware
      for copying bytes into, or reading bytes out of the video card. This tutorial, however, shows how to map a generic block device driver towards using the video memory in
      PCI address space. PCI provides the ability for a developer to 'memory map' a region of addresses to directly correspond to a block of virtual (could be registers, or a bridge), or
      real memory on a device. I believe this is the case here, where 'each' byte copied or read via swap is asserting an address write/read on the PCI bus. It's likely the block
      driver for your hard drive is making use of DMA however, and I don't believe swap needs to be excessively randomly accessed.

  31. Alot of sever boards have low end pci video card.. by Joe+The+Dragon · · Score: 0

    Alot of sever boards have low end pci video cards built into with other i/o on the same pci bus. So this will not work that good in a setup like that.

  32. Optimizations are necessary by Rolman · · Score: 2, Insightful

    It's very cool that the memory becomes available so easily with just a couple driver parameters. It's a pity that there's a lot to optimize before it can really shine.

    Memory architecture on a GPU is very different from system memory. Memory there is not linear and the video memory controller will go through a lot of remapping to present it as such, something that's probably very slow because of the VBIOS. Then there's the issue of tuning the bus so that reads and writes are using its full bandwidth, and again a poor VBIOS implementation may be the bottleneck.

    The best but harder solution would be to have a means to program the video memory controller directly to map pages of system memory and do all the copying and moving itself. Of course, this is hardly ever going to happen, but some improvements can still make it into the VBIOS, some of which will probably happen once GPGPU-style programming starts getting more attention as both nVidia and AMD/ATI are seemingly interested in pushing with things like CUDA and Stream Computing.

    The concept as it is now, however, remains extremely cool. It might still be orders of magnitude slower in terms of latency and throughput compared to system memory, but it should be a lot more responsive than a hard drive just because there are no seek times involved. That said, hdparm -t may not be the best tool for measuring performance, so i'd be more interested in a random access benchmark since it may make some use of the parallel memory architecture inherent on a video card.

    --
    - Otaku no naka no otaku, otaking da!!!
    1. Re:Optimizations are necessary by Anonymous Coward · · Score: 0

      It is an interesting hack but the whole idea of swap is to simulate relatively fast, relatively expensive memory using a slower cheaper medium (like a cache in reverse). Dedicated video memory is ordinarily faster and much more expensive than ordinary RAM so, in the normal course of things, you would want to use system RAM to "swap" for video rather than the other way around (which is how it is designed and why the read rate is so slow).

      Typically the rule of thumb for swap is something like 2x your RAM. For any given generation of PCs, VRAM ~= (1/8)RAM. While there are probably specific exceptions, any system where VRAM>=(2)RAM needs more RAM or a much newer motherboard.

  33. Sounds like a stupid idea to me by TheLink · · Score: 0

    0) AGP performance sucks for this
    1) How sure are you that they test video ram well enough to use for that purpose? Some people might not notice a few display artifacts due to video ram having one bit stuck at zero or one, but for swap that's not good.
    2) Just buy more _real_ ram, nowadays for normal usage, I recommend setting a small swap partition, that's only purpose is to tell you that you're running out of ram (by making the machine more sluggish). Set the swap too big and you have the entire machine running from swap which nowadays is about as good as powering the machine off abruptly (since that's what everyone does rather than wait weeks or more). Hard drives are too many magnitudes slower than real RAM for users to want to recreate the "Drum memory" era. Who sets their ssh and tcp timeouts to 1 month? ;)

    3) If you need more ram than the old machine can get you, buy a new machine, the last I checked PC hardware is cheap, they're amongst the cheapest things in the world for the technology and materials you get. Use the old machine for something else or give it away.

    --
    1. Re:Sounds like a stupid idea to me by nuzak · · Score: 1

      > Some people might not notice a few display artifacts due to video ram having one bit stuck at zero or one, but for swap that's not good.

      Video RAM is used to store everything, including shader programs. Card makers don't like having their hardware getting a reputation for crashing peoples games when a shader divides by zero. Plus, RAM manufacturers make a commodity, they don't have a bin of "low grade flakey RAM that will just go into video cards". Well, maybe Acer does.

      --
      Done with slashdot, done with nerds, getting a life.
    2. Re:Sounds like a stupid idea to me by TheLink · · Score: 1

      My point is the testing is different and of a different standard. Whether card makers really care or not, in my experience their graphics cards are flakier than a stick of say Kingston RAM.

      Secondly if math goes wrong in a video card it doesn't usually cause the game to crash since it's mainly _output_, what you claim is about the same as saying a rendering/shading fault in your monitor will cause your game to crash.

      As for RAM that's mainly for video cards - see GDDR2, GDDR3, GDDR4 etc.

      --
  34. tried this, by Anonymous Coward · · Score: 0

    you get really crappy read speed even with pcie atleast with nvidia 7600, the write works nice but really usless. Someone should make a pcie card with slots for ddr/pc133 so we could these gigs that just lays in the drawer this would be far more usefull.

  35. Might be possible to decrease any shared memory by Thorwak · · Score: 0

    Since it's an old machine with onboard video it's quite possible it's using system RAM as graphics RAM. So, check out the BIOS, there might be a setting to reduce the amount of memory allocated to the graphics adapter in the fist place. More efficient than trying to swap through some obscure hack :)

    --
    Connection closed by foreign host.
  36. Re: Trolls by Anonymous Coward · · Score: 0

    Why does /. even allow twitter to continue posting? Seems like a flame/troll enabler moreso than an AC

  37. Ha! by TheVelvetFlamebait · · Score: 2, Funny

    And to think people laughed at me when I bought a shiny new 1GB video card!

    --
    You know, there is a difference between trolling and pointing out the flaws in your reasoning. Just saying.
  38. AGP not that bad by Anonymous Coward · · Score: 0

    Thats not quite correct. Traditionally Windows OpenGL and Direct3D drivers has had poor readback speed, but linux less so. I just tested and got 825/625 MB/s (glDrawPixels/glReadPixels) on a FireGL X2 (R350) on AGP.

  39. However by Sycraft-fu · · Score: 2, Informative

    Built in is relevant since nearly all built in adapters do not have their own RAM. They borrow some of the system's RAM to use. As such using it as swap is dumb, since it is just system RAM. A better solution is to turn down the amount of RAM the onboard card gets to reserve (usually the BIOS can control this). Separate graphics adapters almost always include their own RAM, and as such could potentially be useful.

    1. Re:However by operagost · · Score: 0, Troll

      They borrow some of the system's RAM to use. As such using it as swap is dumb, since it is just system RAM.
      Quoted for truth. How did this make it onto the front page? It's a totally absurd proposition.
      --

      Gamingmuseum.com: Give your 3D accelerator a rest.
    2. Re:However by Enigma2175 · · Score: 1

      Built in is relevant since nearly all built in adapters do not have their own RAM. They borrow some of the system's RAM to use.


      No, nearly all CURRENT built-in adapters use system memory. In the past (think pentium/pentium II era) most on-board graphics adapters used dedicated vram soldered to the motherboard. The OP said that it was older hardware - it's reasonable to assume that it is separate memory rather than assume he is using system memory.
      --

      Enigma

    3. Re:However by Anonymous Coward · · Score: 0

      Why'd you need to QFT on a site without editable comments?

    4. Re:However by Psychofreak · · Score: 1

      My guess is that his "lucky" system is like my old P133 system. I had 2 MB video ram with 2 MB upgrade capability(really HOT stuff for the time!) Small potatoes I know, but it was dedicated video ram. That system was on the PCI bus, and a circa 1995 system. If that machine were still alive a low grade web server would be about all it could reasonably be expected to do. Set up as headless I would want to have that ram useful, even if it was diminished in capacity compared to other swap spaces.

      Machines from that era were not capable of using system ram as video memory. That became popular shortly after in about '98 or '99. My understanding is those machines still had a small piece of dedicated video ram at the GPU, but could be assigned more ram from main memory.

      Just my $.02. Hope I got my history right.
      Phil

      --
      Laugh, it's good for you!
    5. Re:However by master0ne · · Score: 1

      i think the point is OLDER is a relative term, depending on who you talk to, its unreasonable to assume anything, either attach the question from all angles, or leave it be. the poster didn't specify how the hardware was setup, so assume it could be setup any way, from ISA to PCI-E and from shared system memory to dedicated VRAM, without knowing details, its a big task to properly answer the posters question...

      --
      Noone writes jokes in base 13!
    6. Re:However by XO · · Score: 1

      Or you could probably even presume that even if it does have a changeable amount of RAM to carve out of system ram to use as video ram, that that limit cannot be set to "None".

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
  40. Irony by Anonymous Coward · · Score: 0

    Dear trolled,

    You were so riled-up about some lame comment about niggers that you felt compelled to strike back by assaulting the GP AC's trollhood, anonymously no less.

    YHB so T.

  41. Reading Comprehension ... by Anonymous Coward · · Score: 0

    You only have to sacrifice direct rendering if you're using a blob in which you can't control the amount (or regions) of memory to use. Which should be an extremely trivial option to support.
    Why would you want direct rendering anyway? There isn't really much to play.

  42. OLD NEWS.... nothing to see here.... by drew_92123 · · Score: 1

    I use to have a disk copy tool for a mac that used video ram when duplicating floppies to try and make it faster... It made a bunch of nice garbage on the screen while it was working too. That was 15 years ago, I'm not impressed...

    It wasn't really that practical back then, and it's certainly not practical at all today...

    1. Re:OLD NEWS.... nothing to see here.... by Anonymous Coward · · Score: 0

      Like all mac users, you have no idea what you're talking about.

    2. Re:OLD NEWS.... nothing to see here.... by IhuntCIA · · Score: 1

      Well old news it is. I used to have RAM DISK for keeping environment variables and temp files on it. It worked much faster than swapping on hard drive. Yes I did use the bootable RAM disks to boot games and they did boot and worked much faster.
      That was 15 years ago. I had 2.5 megs of RAM.

      Now people think that their PCI, AGP or PCIe video cards will swap slower than their lame hard drives. How lame is that?
      --
      Don't mod me down if You disagree or don't understand my post. Think trough and use moderating options reasonably.

  43. Re:As far as swap devices go, I prefer by Anonymous Coward · · Score: 0

    Dear troll,

    and that's the whole problem with the "omg troll" mentality -- small-minded cretins assume they know the motives behind a post merely because its content goes against accepted social standards.

    to assume a post is a "troll" or "flamebait" assumes that the poster desires responses, or to cause arguments, but there are an infinite amount of other possible motivations for posting rude, nonsensical, or off-colour posts.

    perhaps posting racial slurs on slashdot eases some psychological burden. perhaps the poster is insulting his own race in an attempt to normalize the taboo words. perhaps the posts are a form of performance art. perhaps they are intended to pollute slashdot and drive posters away in disgust. perhaps they are intended to keep posters at slashdot by discouraging browsing at certain levels. perhaps they are inside jokes intended to amuse a certain group of people.

    it isn't a binary world. viewing such important and critical matters such as nigger posts so myopically is criminally irresponsible.

    i think you need to issue a retraction.

  44. i have this lucky/still working... by conspirator57 · · Score: 2, Interesting

    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
  45. Re: or a Windoze user by Anonymous Coward · · Score: 0

    On a sane OS (like Linux) you're right. He's probably a Windows user.

    Windows is not sane, allow a swapfile and Windows will use it to free up RAM for caching, often harming performance by swapping things that would have fit in RAM otherwise. On a WinXP system with enough RAM disabling swapping can give noticeable speed improvements.

    On Linux it makes no noticeable difference and there's no point disabling it.

  46. Use a SATA Ramdisk... by Zymergy · · Score: 2, Informative

    Like this one: http://techreport.com/articles.x/9312
    It works wonderfully for Windows swap file! (and better still for Photoshop/Premiere swapfile) It is limited to 4GB (draws power from the PCI bus) and it is driver-less. (works with ANY PC motherboard supported OS)
    It connects to the PC using a SATA1 connection (but a continuous 1.5 Gb/s is still better than most HDDs) and it uses 4x 1024MB DDR1 RAM Modules.
    There is a future 8GB DDR2 SATA2 3.0 Gb/s model (allegedly) coming out soon that fits in a 5.25" drive bay:
    http://techreport.com/discussions.x/10116 (please, oh please, don't be vaporware)

  47. DMA? by OrangeTide · · Score: 2, Informative

    Might be faster if the driver knew about DMA. Your harddrive, even thought it is slow, has DMA. So when you want to swap out pages you can set it and forget it. You're not really in any hurry to swap out, only to swap in. So it seems while a harddrive lets the CPU do other work while it ways for the pages to be copied, the MTD slram driver does not.

    There isn't enough memory on a videocard to really make it worth doing the right way either. Mine only has 256M which is not that big compared to systems that have 1G to 2G of system RAM and 1-4G of swap.

    --
    “Common sense is not so common.” — Voltaire
    1. Re:DMA? by grommit · · Score: 1

      Your harddrive, even thought it is slow I hear ya man. My HDD is pretty emo. It just sits around thinking about how slow it is compared to the other HDDs out there.
  48. Re:Quote: Direct Rendering or fast swap. Your choi by Anonymous Coward · · Score: 0

    @Bert64 RTFA, I wasn't talking about 'him'. I was talking about me.

    And @AC, you obviously haven't got a clue about the state of the 3d drivers for GNU/Linux, do you? As in, they're all blobs. Also, your knowledge of gaming on this platform is from the jolly 1990s.

  49. Bzzzt yourself by Joce640k · · Score: 1

    One of the best things you could possibly do to speed up an Windows 9x or NT4 machine was to limit the disk cache.

    No more juddering, no more half-burnt CDs because you dared to move the mouse around while it was burning .... the whole system ran a lot better when you prevented the disk cache from swapping programs out to disk.

    Guess which feature they took out of XP?

    That's right - the ability to limit the size of the disk cache!

    So we're back to using stone-age machines which grind to a halt for half a minute when you open a window which was closed for a while.

    --
    No sig today...
    1. Re:Bzzzt yourself by arth1 · · Score: 1

      One of the best things you could possibly do to speed up an Windows 9x or NT4 machine was to limit the disk cache.

      Windows? Who said anything about Windows? That OS uses its paging file and manages memory in a completely different way. You can't run Windows without a paging file, which is used not just for swapping out individual unused memory pages but complete DLL files. A good chunk of swap is used just by booting up Windows! And disk caching is done a completely different way too, where you won't have zero free memory because any unused memory is used for disk caching -- a fixed percentage of the total memory is set aside for disk caching, which seriously hurts performance.

      At least I was talking about operating systems which act in a more sensible manner, and swap out old and unused pages, because keeping them in memory is not going to help anything anyhow, and the system immediately can take advantage of the real memory that frees up.

    2. Re:Bzzzt yourself by dreddnott · · Score: 1

      I ran Windows (95, 2000, Server 2003) without a paging file for years, just because I could. It still worked.

      --
      I may make you feel, but I can't make you think.
  50. PS3 VRAM Swap by Doc+Ruby · · Score: 3, Interesting

    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

  51. u makes no senses by Anonymous Coward · · Score: 0

    try again

  52. forests and trees by Lord+Ender · · Score: 1

    In the time it takes you to post this question and read the replies, you could have gotten a job at McDonald's and earned enough money to buy some real hardware.

    --
    A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
  53. Re: Trolls by Anonymous Coward · · Score: 0

    Mod parent up!

  54. General hardware specialist hardware by wikinerd · · Score: 1

    vidRAM is optimized for writes from main RAM. Not reads.

    Here we have a perfect example of some hardware (memory) which was specialised to better support a specific application (video), but then some users decided they wanted to do something else with it (swap) and found that they would be better off if they had general-purpose hardware for all system functions rather than specialist hardware for every function.

    Perhaps hardware manufacturers should invest their time in optimising and speeding up general-purpose hardware (memory), rather than designing specialist hardware that "lock" the user into particular usages (video RAM).

  55. Video RAM swap - what a cool idea by mollog · · Score: 1

    Another poster has described the evolution of GPU devices to GPGPU and the need for symmetrical bus speeds. The concept of having the video subsystem server as a swap device is brilliant. The RAM speeds are high, and the GPU can mediate the operation. I'm going to assume that this becomes the norm in the near future. I know that HTPCs usually have some nice graphics hardware, and that some people are already using two high-end video cards in their systems for gaming/CAD. Seems like a smart board designer will pick up on the idea and integrate a swap device on the video subsystem.

    --
    Best regards.
    1. Re:Video RAM swap - what a cool idea by Mr+Z · · Score: 1

      Actually, if there is a mechanism to turn it into a memory zone, it could be managed more effectively than swap. Swap should be the lowest level of hierarchy, and video RAM should be above it, just like a multi-level cache. Right now, if you put swap on a video card, it's in parallel with any swap you have on a hard drive. Sure, you can put it at a higher priority for allocation, but that doesn't mean the "hot" stuff allocates there, it just means it fills up first.

    2. Re:Video RAM swap - what a cool idea by GregPK · · Score: 1

      I've been advocating something similar to this for a while. Integrating a GPU onto a cpu letting the GPU work with an external Video Card under an open source interface. Combined with your idea this would essentially let people just install a daughter card memory controller/ram card on the motherboard via a PCI express of some sort and install a crapload of ECC on it for use as a massive mulitchannel swap disc for really powerful video cards to essentially just use in an SLI hookup.

  56. No seek time by wtarreau · · Score: 1

    Hi,

    I've also been doing this on my laptop for about 2 years now. I have
    no use of the 64 MB video RAM on it, and I could dedicate 56 of them
    to the swap. While it has a very low read speed (8 MB/s), write speed
    is fast, and seek times are NULL. You have to remember that when you
    are swapping to a disk, you're very lucky if you can even reach 8 MB/s,
    as all the time is lost in seeks. Swapping is one of the most random
    patterns on disks, and disks are extremely slow at this job.

    I really see a speed difference between VRAM swap and disk swap, but
    I try to use them very rarely anyway.

    Willy

  57. real-life benchmark by wikinerd · · Score: 1

    If the server operates within some form of high availability setup where a second server can take its place if the primary server gets broken, then just do a real-life test: Enable the videoRAM swap and write down how long it takes it to satisfy every Web request, whether its mail queue gets clogged up easily, etc. Then enable the HD swap and do the same.

    If, however, the server is not in high availability setup and is important for you, then just don't touch it :)

  58. Read-ahead caching and what is on the RAM disk? by scottsk · · Score: 1

    I've been reading Love's new book on systems programming and it talks about Linux read-ahead strategies. If this RAM disk was faster than RAM, wouldn't your performance get killed by Linux caching your data read from the faster video RAM (if it is faster) into regular RAM? Would you ever hit the RAM disk for frequently used data (and if it wasn't frequently used why bother)? I went back and read the question again, but don't see any indication of what is going to be stored on the RAM disk. What it seems like Linux would do is keep anything you use often enough to put on a RAM disk in its memory disk buffers anyway. They'd be accessed so often they'd never get old enough to be deleted from memory. (Obviously this would be read-only. You wouldn't store anything volatile on this RAM disk!) Might be a neat hack, but it doesn't seem to have much practical value. Most video card memories are sort of small, a few MB, and anything you would put in that RAM disk would fit into the disk cache anyway, so if you put something frequently used onto the RAM disk, that data would be read from the cache. I'd bump your system memory to 2GB and let Linux's caching do its thing. I don't think I've swapped a memory page all year.

  59. If you work for Seagate, fix the AAK firmware! by _Shorty-dammit · · Score: 1

    Because we most definitely are not getting ~80MB/s from the outside of the platters with the AAK firmware. That crap's got an artificial limit in it.

  60. It does not matter how slow the bus is by sulimma · · Score: 1

    He is comparing with a hard drive that will be connected to the same or a slower bus than the graphics board.

  61. More importantly: What does it look like? by torpor · · Score: 1

    Anyone got any screenshots? :)

    --
    ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
    1. Re:More importantly: What does it look like? by Anonymous Coward · · Score: 0

      Piss off, spammer.

  62. I had an EISA graphics card... A Tseng Labs ET4000 by sd.fhasldff · · Score: 2

    to the best of my knowledge EISA was never used on video cards unless it was highly specialized.

    You are incorrect.

    I remember back when I got my first post-ISA graphics card - in order to get better kick my neighbors ass in Descent, IIRC.

    Anyway, I distinctly remember having to chose between EISA and VLB (VESA). For whatever reason, I wound up going with a Tseng Labs ET4000 EISA card sporting 1MB of VRAM.

    I also recall the salesman's shock at my asking what the speed was of the memory chips. He'd never had anyone ask that before... which was actually a bit surprising since the performance difference between the slow and fast memory chips was quite substantial.

    Wikipedia's article on the ET4000 card even mentions an EISA version!

    And here is a link to a specific ET4000 EISA card, although not the one I owned (and probably still have in a box in the basement).

  63. Some hard numbers by Roman+Mamedov · · Score: 1

    I've had a very similar situation, like what poster of the story describes.

    The computer with which I tested the "video-swap", is a Celeron 433, with Intel 815 chipset. It had 128 MB of main RAM.
    The videocard is ATI Radeon 9000 with 64 MB of RAM. Of these 64, I configured 56 megabytes to be used as swap.
    It worked absolutely fine, even with X (which was hardlocked in config file to the bottom 8 MB).

    However, the speed of read/write access to the video RAM was not great at all.
    Reads were about 4.5 megabytes/sec, and writes about 11.2 megabytes/sec.
    In addition, during reads or writes even at these low speeds, the process named "mtdblockd" was chewing up 99% of CPU.

    I tried both slram and phram modules, they both worked, performance of both was the same.

    I believe something somewhere code along the code path (phram|slram -> mtdblock -> mtd ) is poorly optimized for this type of task, because 11.2 or 4.5 megabytes is too large of a difference from 1066 megabytes/sec AGP 4x (at which rate my videocard worked), theoretically allows.
    Also, 99% CPU load while accessing video-RAM through mtdblock device is a serious issue which may limit its usefulness for swapping.

  64. Re:I had an EISA graphics card... A Tseng Labs ET4 by OS24Ever · · Score: 1

    I stand corrected. Tseng labs, wow, haven't heard that name in a while I remember when some of their cards came out, they were hot stuff. Didn't know they ever made an EISA version of those.

    --

    As a rock-in-roll Physicist once said, No matter where you go, there you are.

  65. Three times slower? by Anonymous Coward · · Score: 0

    Isn't that an Oxymoron like jumbo shrimp or Microsoft Works? Shouldn't the proper terminology be "x is one half the speed of y" or "x is one third the speed of y"?

  66. Who uses swap? by Anonymous Coward · · Score: 1, Interesting

    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.