As I know, when program try to access virtual address that the corresponding PTE is NO present , kernel will trigger page fault and page fault handler will handle it.
In handler, if fault is caused by no physical mapping to the PTE, kernel should allocate free physical page and write physical address to PTE.
I found many functions like __handle_mm_fault
or handle_pte_fault
, but I cannot find the location where kernel actually allocate physical page. Could anyone give some suggestion?
Thanks.