feat: set accessed bit to allocated frames in page_load and get_usr_kpage
This commit is contained in:
@@ -811,6 +811,7 @@ get_usr_kpage (enum palloc_flags flags, void *upage)
|
|||||||
return NULL;
|
return NULL;
|
||||||
else
|
else
|
||||||
page = frame_alloc (flags, upage, t);
|
page = frame_alloc (flags, upage, t);
|
||||||
|
pagedir_set_accessed (t->pagedir, upage, true);
|
||||||
#else
|
#else
|
||||||
page = palloc_get_page (flags | PAL_USER);
|
page = palloc_get_page (flags | PAL_USER);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -77,7 +77,9 @@ page_load (struct page_entry *page, bool writable)
|
|||||||
/* Allocate a frame for the page. If a frame allocation fails, then
|
/* Allocate a frame for the page. If a frame allocation fails, then
|
||||||
frame_alloc should try to evict a page. If it is still NULL, the OS
|
frame_alloc should try to evict a page. If it is still NULL, the OS
|
||||||
panics as this should not happen if eviction is working correctly. */
|
panics as this should not happen if eviction is working correctly. */
|
||||||
void *frame = frame_alloc (0, page->upage, thread_current ());
|
struct thread *t = thread_current ();
|
||||||
|
void *frame = frame_alloc (0, page->upage, t);
|
||||||
|
pagedir_set_accessed (t->pagedir, page->upage, true);
|
||||||
if (frame == NULL)
|
if (frame == NULL)
|
||||||
PANIC ("Could not allocate a frame to load page into memory.");
|
PANIC ("Could not allocate a frame to load page into memory.");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user