![]()
![]()
목차
1. frame table
1.1. Algorithm
1.2. Data Structure
1.3. Function
2. lazy loading
2.1. Algorithm
2.2. Function
3. Supplemental page table
3.1. Algorithm
3.2. Data Structure
3.3. Function
4. stack growth
4.1. Algorithm
4.2. Function
5. File memory mapping
5.1. Algorithm
5.2. Data structure
5.3. Function
6. Swap table
6.1. Algorithm
6.2. Data structure
6.3.Function
7. On process termination
7.1. Algorithm
7.2. Function
8. discussion
본문내용
1. frame table
어떤 page에 frame을 할당하기 위해 frame table을 순회하였을 때
1. free frame이 존재하는 경우
해당 frame을 할당하면 된다.
2. free frame이 존재하지 않는 경우
다른 frame의 page를 evict하여 새로운 free frame을 만들어야 한다
이때 page replacement algorithm을 통해
evict할 frame을 고른 후,
현재 frame에 참조중인 모든 page table의 reference를 제거하고,
page에 변화가 있다면 write back이나 swap을 수행한다.
evict된 frame은 새로운 page를 저장하기 위해 사용된다.
project 3에서
frame에서의 eviction을 위해 사용할 page replacement algorithm은 Clock algorithm이다.
이 알고리즘은
frame table을 순회하여
page의 accessed bit이 1인 경우 0으로 바꿔주고,
page의 accessed bit이 0인 경우 이를 선택한다.
1.1. Algorithm
Frame 생성
Frame 생성을 위한 memory공간을 할당하기 위해 frame_allocate을 호출한다.
이때, palloc_get_page(PAL_USER) 를 통해 user pool로부터 page를 생성한다.
page allocation 성공
생성한 주소 그대로 사용
page allocation 실패
free frame을 확보하기 위해 eviction()을 호출한다.
palloc_get_page()를 다시 호출한다.
frame을 생성하기 위해 malloc()을 호출한다.
frame을 frame table에 추가한다.
Frame 제거
Frame 제거를 위한 frame_deallocate()를 호출한다.
Frame table에서 해당 frame을 찾으면,
page를 해제해주고,
frame table에서 frame을 제거한다.
출처 : 해피캠퍼스
답글 남기기