-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Memory Manament] 주간 공유 #8
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
공부한 내용
가상 주소(page주소)와 물리 주소(frame 주소)를 매핑한 테이블
page table을 들여다보고 유효한 주소가 아니거나, frame에 page에 대한 데이터 값이 없으면(not_present=1) page fault 발생
page fault 발생시 vm_try_fault_handler에서 supplemental page table(spt)을 참조한다.
page를 frame으로 적재하기 위해서 page정보를 확인할 수 있는 spt가 필요하다
supplemental page table
각 쓰레드에는 spt가 담기고 spt에는 page 구조체에 대한 정보가 담긴다.
spt의 자료구조는 선택사항이지만 여기서는 hash table로 구현하도록 한다.
자료구조
시간복잡도: array(O(1)) = hash table(O(1)) > linked_list(O(n))
array와 hash table 모두 인덱스로 접근할 수 있기 때문에 시간복잡도는 O(1)
hash table은 array처럼 연속적인 메모리 공간이 필요하지 않으므로 메모리 효율성이 좋다.
위와 같은 이유로 spt의 자료구조로 hash table 사용
hash table
page의 가상주소(virtual page number)를 hash 함수(page_hash)에 통과시키면 고유한 인덱스가 만들어진다.
고유한 인덱스마다 bucket에 hash_elem(페이지 구조체)를 갖게 한다.
겹치는 인덱스가 생길 수 있으므로, bucket을 연결 리스트로 구성한다.
The text was updated successfully, but these errors were encountered: