Subject: Re: RAID & swap
To: Greg Oster <oster@cs.usask.ca>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: current-users
Date: 04/07/2000 12:58:24
> Hmm.... I thought there was some other bits missing yet... unless I was just
> trying to get too fancy...
>
> Maybe a 'swapctl -d /dev/raid0b' in /etc/rc.shutdown (or whatever the
> equivalent is these days) is sufficient??? (I seem to recall that it wouldn't
> be, but I don't recall exactly why...)
There's no guarantee that rc.shutdown will run at the time the kernel
halts.
Also, `swapctl -d' works by paging in all paged-out pages backed by
the swap area being taken down, so if you have (for instance) a full
MFS bigger than the amount of free memory on the system, the swapoff
will fail..
I think you need to do the in-kernel equivalent of "swapctl -d" at
about the same time as the kernel unmounts filesystems. (the optimal
ordering between unmount and swapctl -d could prove tricky,
considering that you can both swap to files and have filesystems
backed by swappable memory and/or userspace processes which may swap).
I think doing unmounts and swapoffs in reverse of the order that the
corresponding mounts and swapons were done would be the way to go,
though you'd have to add some simple accounting to keep track of the
ordering...
- Bill