나무 숲

Virtual Memory Management Strategy 본문

Career

Virtual Memory Management Strategy

wood.forest 2016. 6. 5. 22:05

Background

- In general, only part of the program needs to be in memory for execution

* Codes for handling unusual error condition

* Arrays, lists, and tables are often-allocated more memory than they actually need

* Certain options and features of a program may be used rarely


- Even in those cases where the entire program is needed, it may not all be needed at the same time

  순차적 언어이므로 동시에 실행될 가능성 전혀 없다


- The benefits of executing a program that is only partially in memory

* A program is no longer constrained by the amount of physical memory that is available

* More program could be run at the same time

* Less I/O would be needed to load or swap user program into memory


위에 physical memory를 뚫고 지나가는 화살표는.. 실행을 안할 것 같으면 뺀다는 뜻


- Virtual address space



1 Demand paging >> http://woodforest.tistory.com/4

2 Page Replacement Schemes >> http://woodforest.tistory.com/14

3 Thrashing >> http://woodforest.tistory.com/15

4 Kernel Memory Allocation Schemes >> http://woodforest.tistory.com/24








Allocation of Frames

- 각 프로세스는 최소 개수의 프레임이 필요하다

* 최소 개수의 프레임은 컴퓨터 구조에 의해 정의된다


- Frame Allocation Schemes


1 Fixed Allocation vs Priority Allocation

- 전체를 다 할당하느냐 마느냐?


- Fixed Allocation

* Equal allocation : 100프레임, 5프로세스가 있다면 각 프로세스에 20프레임씩 할당

* Proportional allocation : 프로세스의 크기에 따라 할당

- Priority Allocation

* proportional allocation을 크기가 아닌, 우선순위에 따르도록 하여 사용

* 만약 프로세스 Pi가 페이지 폴트를 발생시킨다면 -> 더 낮은 우선순위에 있는 프로세스의 프레임과 교체하도록 한다



2 Global replacement vs Local replacement

- 영역을 지정해서 못벗어나도록 하느냐 마느냐?


- Global replacement

* 프로세스는 모든 프레임 셋에서 교체 프레임을 선택

- Local replacement

* 프로세스는 자신이 할당받은 셋 중에서만 교체 프레임 선택







Memory-Mapped Files

- Memory-Mapped file I/O는 file I/O가 routine memory access로 대접받을 수 있도록 한다.  메모리에 있는 페이지와 디스크 블럭을 mapping 하므로써!

- 파일은 demand paging을 통해 먼저 읽혀진다. page-sized portion of the file은  파일 시스템에서 physical page로 읽혀진다. 

- 파일 액세스를, r/w system call 대신 file I/O through memory로 simplify

- 여러 프로세스들이 같은 파일을 map할 수 있도록 한다. 메모리에 있는 페이지는 shared되므로





Other Issues

1 Prepaging




2 Page size





3 TLB Reach

728x90
반응형

'Career' 카테고리의 다른 글

RISC vs CISC  (0) 2016.06.07
File System  (0) 2016.06.06
Demand Paging  (0) 2016.06.05
Memory Management  (0) 2016.06.04
Deadlock  (1) 2016.06.04
Comments