Note that under Linux and a filesystem which supports holes, the check for pages full of zero bytes will not often succeed because they are mapped in memory as the special zero-page (and marked copy on write).
But the ultra-simplified compression algorithm looks like: read the first byte, read the second byte and see if it equal to the first byte, read the third byte and see if it is equal to either the first one or the second one or both, ... so you will catch quickly a page full of the same byte.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds