update_mmu_cache() when write protecting pte.

From: Izik Eidus
Date: Wed Sep 23 2009 - 16:14:01 EST


Hi, Hugh just found out that ksm was not calling to update_mmu_cache()
after it set new pte when it changed ptes mapping to point into the new
shared-readonly page (ksmpage).

It is understandable that it is a bug and ksm have to call it right
after set_pte_at_notify() get called, but the question is: does ksm
have to call it only there or should it call it even when it
write-protect pte (while not changing the physical address the pte is
pointing to).

I am asking this question because it seems that fork() dont call it...

(below a patch that fix the problem in case we need it just when we
change the physical mapping, if we need it even when we write protect
the pages, then we need to add another update_mmu_cache() call)

Thanks.