[lkml]   [2010]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 3/3] mm: Swap checksum
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

 \ /
  Last update: 2010-05-24 13:27    [W:0.059 / U:3.140 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site