Gordon Dexter on 17 Aug 2009 12:25:18 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Swap on SD

Austin Murphy wrote:
On Sun, Aug 16, 2009 at 2:34 PM, Art Alexion<arthur@alexion.com> wrote:
I have been configuring EeePCs without swap to minimize wear on the SSD.
1) does [swap on SD card] make sense, or is SDHC too slow for swap?

I can't help but think that swap on SD is a bad idea.  To start with,
storage is slow compared to the rest of the system.  Laptop disks and
SD cards are even slower.   This situation has changed dramatically in
the last 10 years.  The relative speed of disk compared to RAM has
gotten far worse.  Swap used to be a decent price/performance
compromise, but now I find that it causes as many problems as it
solves.  Firefox is already smart about using disk space to store
state and cache.  My experience with old slow, low RAM laptops is that
they work better without swap.

Not just that, but there's another problem with having the swap on an SD drive.  You then suddenly have a system that you can forcefully unplug the swap from without warning the kernel.  So the kernel pages out some RAM and then your user is playing with the SD slot or perhaps just has a digital camera they want to use.  I don't think the Linux kernel takes to kindly to having the contents of it's RAM disappear.  Maybe you trust your users not to fiddle, but I sure wouldn't.

Actually that piques my curiosity... how exactly does the kernel react to the traumatic loss of it's swap partition?  Anybody have any experience or expertise here?  I realize that swap is not often in use, or more often is a mirror of RAM contents just in case the RAM is needed for something else, but let's say that the swap partition contains something not in RAM, and it's important  to some running program.  Do we get a kernel panic?  Do apps just die?  Plague of locusts and Nile runs red with blood?


Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug