Skip to content

Commit

Permalink
feat(lazy_load_file): 파일내용 복사 후 dirty 해제 (mmap-clean) 성공
Browse files Browse the repository at this point in the history
  • Loading branch information
c4fiber committed Oct 19, 2023
1 parent 0799d86 commit 28caa0a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions userprog/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ static bool lazy_load_file(struct page *page, void *aux) {
memset(upage + read_bytes, 0, zero_bytes);

free(aux); // 인자 (malloc) free 수행

// set not dirty: 파일 내용을 복사하면서 dirty로 체크됨.
// 이를 해제해두면 memeory에 데이터가 쓸때 dirty가 체크되므로 수정여부를 판단 가능
pml4_set_dirty(thread_current()->pml4, page->va, false);

return true;
}
Expand Down

0 comments on commit 28caa0a

Please sign in to comment.