pgoff = pte_to_pgoff(orig_pte);
return _do_fault(mm, vma, address, pmd, pgoff, flags, orig_pte);
Since the faulting address is not linearly associated with the contents of the mapped file, the desired position must be obtained from the information in the PTE that was previously encoded with pgoff_to_pte. Now comes the time to put this information to use: pte_to_pgoff analyzes the page table entry and obtains the desired page-sized offset into the file.
Once the address within the file is known, reading in the required data can be pursued as for regular page faults. The kernel thus hands off the work to the previously discussed function_do_page_fault and is done.
Continue reading here: Kernel Page Faults
Was this article helpful?