Re: New Feature Idea: Compress swap file

Emil Briggs (briggs@bucky.physics.ncsu.edu)
Thu, 19 Feb 1998 22:57:05 -0500 (EST)


>There's also the problem of mapping between swapped pages on disk and in
>memory. At the moment it's 4k in mem<->4k on disk, working out where the
>pages are going to and coming from is trivial and there's no real chance
>of fragmenting the swap space.
>
>If we compress, the pages on disk are variable sized, once you've paged
>in and out a few hundred times we could easilly fragment the swap space to
>hell :).
>
>Then what ?, stall while we defragment the swap space.
>
>Keep it simple.
>

If the object is to improve performance by decreasing the amount of
data transferred across the I/O bus and to disk then you just reserve
4k blocks on disk for each page -- the actual amount written may be
much less because of the compression but you don't have to worry about
fragmentation and you still have a one to one mapping. This wastes
disk space so it doesn't make sense if the idea is to reduce the
amount of swap needed -- if the idea is to improve performance it
might work but I guess you would have to know the relative speeds
of compression/decompression relative to just transferring the stuff
straight.

Regards
Emil

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu