Last active
December 14, 2022 17:28
-
-
Save yeonwooz/01dd8771573243413ce535800d8f4c90 to your computer and use it in GitHub Desktop.
swap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct frame *vm_evict_frame () { | |
struct frame *victim = vm_get_victim (); | |
swap_out (victim->page); // 페이지 스왑 아웃 | |
return victim; | |
} | |
struct frame *vm_get_frame () { | |
... | |
return vm_evict_frame(); | |
} | |
bool vm_do_claim_page () { | |
vm_get_frame(); // 새로운 프레임 혹은 스왑 아웃된 프레임을 할당받음 | |
... | |
return swap_in (page, frame->kva); // 새 프레임으로 스왑 인 | |
} | |
bool page_fault_handle() { | |
... | |
vm_do_claim_page(); // 페이지 폴트 발생시 물리 프레임 할당 요청 | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment