From 28caa0ae20dc6478c80477fcc7d6a29aba7bbde2 Mon Sep 17 00:00:00 2001 From: c4fiber Date: Thu, 19 Oct 2023 15:16:17 +0000 Subject: [PATCH] =?UTF-8?q?feat(lazy=5Fload=5Ffile):=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=20=EB=B3=B5=EC=82=AC=20=ED=9B=84=20dirty=20?= =?UTF-8?q?=ED=95=B4=EC=A0=9C=20(mmap-clean)=20=EC=84=B1=EA=B3=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- userprog/syscall.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/userprog/syscall.c b/userprog/syscall.c index 8078cf7..6dfb4a2 100644 --- a/userprog/syscall.c +++ b/userprog/syscall.c @@ -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; }