[kernel:page_fault] update last_accessed physical page timestamp after it has been loaded due to a page fault

This commit is contained in:
ІО-23 Шмуляр Олег 2025-03-18 20:22:26 +02:00
parent 92759f73a2
commit ca354c677e
1 changed files with 4 additions and 0 deletions

View File

@ -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;