Re: VMM - freeing up swap space

Hugh Dickins (hugh@veritas.com)
Tue, 18 Jun 2002 19:17:00 +0100 (BST)


On Tue, 18 Jun 2002, Richard B. Johnson wrote:
> On Tue, 18 Jun 2002, DevilKin wrote:
> > On Tuesday 18 June 2002 17:10, Richard B. Johnson wrote:
> > >
> > > Sure. Execute `swapoff -a`, followed by `swapon -a`. This is no joke.
> >
> > Hmm. Now if you happen to get out of memory during the swapoff part, you'll
> > get the OO killer on your tail? Or will the system just go freeze solid?
>
> I think `swapoff -a` will just fail to remove the swap device/file(s) if
> it doesn't have the memory. I've done this with 16 Mb of RAM in the
> 'good-old-days', where VM was swap.

You're right that swapoff should just fail, but sadly we've not done
the work to make that so: the OOM-killer does indeed come in (and it's
not the swapoff task it attacks); and if that can't free enough, then
the system will freeze.

In what forum, by the way, may I suggest to distros that they "rm -rf"
in any tmpfs mounts before shutdown swapoff? It avoids this OOM issue
at shutdown, plus it's a whole lot faster than doing the swapoff.

Hugh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/