[kernel:page_fault] update last_accessed physical page timestamp after it has been loaded due to a page fault
This commit is contained in:
parent
92759f73a2
commit
ca354c677e
src
|
@ -156,6 +156,7 @@ KERNEL_page_fault(struct PageTableEntry *pt, size_t page_no)
|
|||
first_free_page->busy_flag = 1;
|
||||
first_free_page->pt = pt;
|
||||
first_free_page->pt_index = page_no;
|
||||
first_free_page->last_accessed = system_time;
|
||||
|
||||
// ---- free list -> busy list ----
|
||||
struct PhysPage *this_page = first_free_page;
|
||||
|
@ -239,6 +240,8 @@ KERNEL_page_fault(struct PageTableEntry *pt, size_t page_no)
|
|||
first_busy_page->pt[first_busy_page->pt_index].p = 0;
|
||||
first_busy_page->pt = pt;
|
||||
first_busy_page->pt_index = page_no;
|
||||
first_busy_page->last_accessed = system_time;
|
||||
|
||||
pt[page_no].p = 1;
|
||||
pt[page_no].ppn = first_busy_page->ppn;
|
||||
|
||||
|
@ -273,6 +276,7 @@ KERNEL_page_fault(struct PageTableEntry *pt, size_t page_no)
|
|||
// update physical page data
|
||||
first_busy_page->pt = pt;
|
||||
first_busy_page->pt_index = page_no;
|
||||
first_busy_page->last_accessed = system_time;
|
||||
|
||||
// update PTE data
|
||||
pt[page_no].p = 1;
|
||||
|
|
Loading…
Reference in New Issue