lkml.org 
[lkml]   [1997]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Swap Files
Date
alan@lxorguk.ukuu.org.uk (Alan Cox) writes:
> Fix the distributions, fix swapoff but don't keep dumping on the kernel to
> fix user mode problems.

Agreed. Changing swapoff (with the necessary kernel support) so that
it can remove all swap partitions is going to confuse programs such as
swapd which manage swap files themselves.

All you need is for swapon to create an entry in "/etc/swtab" (c.f.
/etc/mtab) when it enables swap partitions or files. It will contain
the swap paritions in /etc/fstab that were enabled using "swapon -a",
and also any that were added manually. Then "swapoff -a" will disable
all of the partitions that "swapon" enabled[1].

No kernel bloat. Available in a stable kernel near you[2].

[1] However, you need a "-n" flag to enable swap on a read-only root
partition, so you also have a "-f" flag to put the entry in /etc/swtab
after the root partition is r/w.

[2] If somebody writes it...

--
`O O' | Nick.Holloway@alfie.demon.co.uk http://www.alfie.demon.co.uk/
// ^ \\ | Nick.Holloway@parallax.co.uk http://www.parallax.co.uk/~alfie/
\
 
 \ /
  Last update: 2005-03-22 13:38    [from the cache]
©2003-2011 Jasper Spaans