Re: [PATCH 3/3] mm: Swap checksum

From: Cesar Eduardo Barros
Date: Mon May 24 2010 - 07:24:53 EST


Em 24-05-2010 03:41, Avi Kivity escreveu:
On 05/23/2010 09:58 PM, Cesar Eduardo Barros wrote:
One possibility could be to compare the full page against zero only if
its crc is a specific value (the crc32c of a page full of zeros). This
would not be too slow (we would be wasting time only when we have a
very high probability of saving much more time), and not need to touch
the crc32c code at all. I would only have to look at how this messes
up the state tracking (i.e. how to make it track the fact that,
instead of getting written out, this is now a zeroed page).

Instead of returning a swap pte to be written to the page tables, return
a zeroed pte.

Unfortunately, at this point in the code (swap_writepage) it is not a matter of simply returning a zeroed pte; it would have to go looking for the page tables.

If I am understanding things correctly, in some situations even looking for them via the struct page I have and its rmap stuff is not enough; you could have a pte still pointing to the swap instead of pointing to the page (which when faulted would go via the swap cache to get the page).

For instance, if the page was shared between several processes, got swapped out, swapped in but accessed only by some of the processes, and in the process of being swapped out again.

--
Cesar Eduardo Barros
cesarb@xxxxxxxxxx
cesar.barros@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/