Srividya Desireddy <srividya.dr@xxxxxxxxxxx> writes: > > On a ARM Quad Core 32-bit device with 1.5GB RAM by launching and > relaunching different applications, out of ~64000 pages stored in > zswap, ~11000 pages were same-value filled pages (including zero-filled > pages) and ~9000 pages were zero-filled pages. What are the values for the non zero cases? > +static int zswap_is_page_same_filled(void *ptr, unsigned long *value) > +{ > + unsigned int pos; > + unsigned long *page; > + > + page = (unsigned long *)ptr; > + for (pos = 1; pos < PAGE_SIZE / sizeof(*page); pos++) { > + if (page[pos] != page[0]) > + return 0; > + } So on 32bit it checks for 32bit repeating values and on 64bit for 64bit repeating values. Does that make sense? Did you test the patch on a 64bit system? Overall I would expect this extra pass to be fairly expensive. It may be better to add some special check to the compressor, and let it abort if it sees a string of same values, and only do the check then. -Andi -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>