<div dir="ltr"><div><div><div><div><div>Hello all,<br><br></div>I have one confusion about PTE modification on page migration. Can anyone help me clarify it?<br></div>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)<br>
if (pte_none(entry)) {<br>....<br>return do_anonymous_page(...);<br>}<br></div>return do_swap_page(...);<br><br></div>But, in try_to_unmap_one_anon(...), the pte entry is cleared before it has new swap entry.<br>pteval = ptep_clear_flush_notify(vma, address, pte);<br>
...<br>set_pte_at(mm, address, pte, swp_entry_to_pte(entry));<br><br></div>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(...).<br>
<div><br></div><div>Am i right? I don't know if it is my fault or not.<br></div><div>Can someone help me?<br><br></div><div>Thanks!<br><br></div><div>Frank<br></div></div>