Swap

From OLPC
Revision as of 12:31, 6 January 2008 by Mike41430 (talk | contribs)
Jump to: navigation, search

see the Support FAQ for more on setting up an SD card or other device as swap.

Swap on SD is currently is broken. The XO currently force-unmounts the SD card at suspend, which loses the swap file and breaks all applications that touched the swap, most notoriously X11.

Swap on the internal memory doesn't work either, it causes system freezes. Swap doesn't even like attaching to a jffs2 file, but can be forced by using a loopback device. The internal flash chip is only rated for 3000 writes/cell (Remember when flash could take 100,000 writes? Now we're giving that up for density). JFFS2 will try to spread that across the whole chip, even then swap write patterns are likely bad for it. Try the following at your own risk.

su
dd if=/dev/zero of=/var/swap count=128000
/sbin/mkswap /var/swap
#!/bin/sh
if [ `cat /proc/swaps | wc -l` == 1 ] ;then
    loopdev=`su -c "/sbin/losetup -f"`
    su -c "/sbin/losetup $loopdev /var/swap"
    su -c "/sbin/swapon $loopdev"
fi

user:mike41430

The document that the "Hardware specification" page calls the "Definitive Laptop Specification", which is dated 9/13/07, says "The endurance of the NAND device is one hundred thousand erase cycles". The Swap article, with edit dates 12/23-28/07, says the "internal flash chip is only rated for 3000 writes/cell". I do not know which of these statements to believe. Did the "definitive laptop specification" become less "definitive" between 9/13 and 12/23? In particular, I would like to know the endurance rating of the flash memory in my G1G1 XO-1, ordered 11/12/07 and shipped 12/17/07. I also hope that a future release will be fixed so that it will be possible to swap on the built-in SD card slot, or use it as an extension of memory, which seems to be what was intended.