Hello all,
I have one confusion about PTE modification on page migration. Can anyone help me clarify it?
As we know, if process access the virtual addresss with null PTE entry, it will result in page fault. In page fault routine, it will check PTE entry to determine whether it is swap case, (handle_pte_fault)
if (pte_none(entry)) {
....
return do_anonymous_page(...);
}
return do_swap_page(...);
But, in try_to_unmap_one_anon(...), the pte entry is cleared before it has new swap entry.
pteval = ptep_clear_flush_notify(vma, address, pte);
...
set_pte_at(mm, address, pte, swp_entry_to_pte(entry));
I feel confused about the above atomic operation. That is, If the pte is zeroed and new swap entry is not set yet. Some process accesses to the address and page fault is raised. In the above routine from page fault, pte_none() will return TRUE and it will go to do_anonymous_page(...), instead of do_swap_page(...).
Am i right? I don't know if it is my fault or not.
Can someone help me?
Thanks!
Frank
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies