Re: New Feature Idea: Compress swap file

Russell Coker - mailing lists account (bofh@snoopy.virtual.net.au)
Sat, 21 Feb 98 22:58:12 +1000


>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.

We could have a block/fragment scheme whereby a page would either be
uncompressed (uses a page of disk) or it would be compressed and use from 1 to
3 blocks of 1/4 the page size. This wouldn't be too difficult to setup and as
far as fragmentation goes, the worst case scenario is that it uses as much
disk space as an uncompressed swap partition... We could also have special
handling of pages that compress to 1/8th or 1/16th the page size (some will
compress even more than this by RLE alone).

Russell Coker

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