> I'm not familiar enough with the swapping bits of the kernel code, so I
> could be totally wrong, but turning off a swap file/partition should
> just call the same parts of the VM subsystem that would normally try to
> recover swap space under memory pressure.
A problem with this is that normal paging-in is allowed to page other
things out as well. But you can't have that when swap is about to
be turned off. My guess is that swapoff functionality was perceived to
be so seldom used that they didn't bother too much with scheduling
or efficiency.
I don't have the same problem myself though. Shutting down with
30M or so in swap never take unusual time on 2.4.x kernels here,
with a 300MHz processor. I did a test while typing this letter,
almost filling the 96M swap partition with 88M. swapoff
took 1 minute at 100% cpu. This is long, but the machine was responsive
most of that time. I.e. no worse than during a kernel compile.
The machine froze 10 seconds or so at the end of the minute, I can
imagine that biting with bigger swap.
Helge Hafting
-
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/