fix: SPT never removes entries until process termination or special case

This commit is contained in:
Themis Demetriades
2024-12-05 22:05:02 +00:00
parent 7860f3863f
commit 2811ea0eb3
3 changed files with 12 additions and 19 deletions

View File

@@ -271,9 +271,7 @@ fetch_page (void *upage, bool write)
size_t swap_slot = page_get_swap (t, upage);
swap_in (kpage, swap_slot);
hash_delete (&thread_current ()->pages, &page->elem);
lock_release (&page->lock);
page_cleanup (&page->elem, NULL);
bool writeable = pagedir_is_writable (t->pagedir, upage);
@@ -293,11 +291,6 @@ fetch_page (void *upage, bool write)
case PAGE_MMAP:
case PAGE_FILE:
success = page_load_file (page, page->writable);
if (success && page->type == PAGE_FILE)
{
hash_delete (&thread_current ()->pages, &page->elem);
page_cleanup (&page->elem, NULL);
}
break;
default:
return false;