title: How to raise a page fault
body: <p>I want to generate a page fault intentionally even if the page table entry already exists.</p>
  
  <p>So I cleared a <code>_PAGE_PRESENT</code> bit to generate a page fault.</p>
  
  <p>Here's the kernel code I wrote:</p>
  
  <pre><code>pte = get_locked_pte(mm, addr, &amp;ptl);
  entry = *pte;
  entry = pte_clear_flags(entry, _PAGE_PRESENT);
  set_pte_at(mm, addr, pte, entry);
  pte_unmap_unlock(pte, ptl);
  flush_tlb_range(vma, vma-&gt;vm_start, vma-&gt;vm_end);
  </code></pre>
  
  <p>However, this code does not work. The page fault I intended does not occur. I want to know exactly how I can trigger a page fault.</p>
  
  <p>Thank you.</p>