Messages in this thread | | | Date | Fri, 20 Feb 1998 04:23:38 +0100 (MET) | From | Rik van Riel <> | Subject | Re: New Feature Idea: Compress swap file |
| |
On Thu, 19 Feb 1998, docwhat@gerf.org ;The Doctor What wrote:
> Can't optimize this by compressing on a per page basis? I'm not overly
It could, but you can never be sure exactly how big the page will be. It might even end up bigger than the uncompressed one, but you can't just allocate 3k/page, because you'll get stuck on several pages that way.
> familiar with the theory, but it seems that there is less to compress > (yeah, the compression isn't as good) and less for the CPU to worry about.
In 2^12 bits (one page) you have 2^12 possible patterns. You can't guarantee to compress each of those, since there are only 2^12 - 1 patterns with less bits.
Therefore, some pages can't be properly compressed and you'll need all kinds of fancy bookkeeping that may just compensate for the possible benefit...
Rik. +-----------------------------+------------------------------+ | For Linux mm-patches, go to | "I'm busy managing memory.." | | my homepage (via LinuxHQ). | H.H.vanRiel@fys.ruu.nl | | ...submissions welcome... | http://www.fys.ruu.nl/~riel/ | +-----------------------------+------------------------------+
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |