Computing/Operating System

14 > Paging, Swaping

i독 2021. 11. 15. 02:24

* 해당 게시물은 경북대학교 컴퓨터학부 강의초빙교수, 배준현 교수님의 강의를 보고 작성되었음을 미리 알려드립니다. ( 개인적인 공부를 정리한 글입니다. )

 

> 주니온 TV Youtube Channel.  https://www.youtube.com/channel/UCOcPzXDWSrnaKXse9XOPiog

 

주니온TV 아무거나연구소

TMI Lab. 아무거나 연구소의 유튜브 TMI 지식나눔 채널 컴퓨팅 사고력을 키워 주고 코딩 지능을 길러 주는 자세히 보면 유익한 코딩 채널 주니온TV@Youtube 주니온 박사: 현) 경북대학교 컴퓨터학부 초

www.youtube.com

 

> 주니온 TV Inflearn page.  https://www.inflearn.com/users/@joonion

 

주니온님의 소개 - 인프런 | 온라인 강의 플랫폼

인프런 지식공유자 주니온님의 소개 페이지 입니다. - 지식공유자 소개 | 인프런...

www.inflearn.com


[  ] Paging

- a memory management scheme that permits a process's physical address space to be non-contiguous.

 

[  ] Basic method for Paging.

- break physical memory into fixed-sized blocks (frames) and break logical memory into blocks of the same size. (pages)

- The logical address space is totally separate from the physical address space.

 

- Every address generated by the CPU is divided into two parts.

  p: a page number, d: a page offset.

- The page number is used as an index into a per-process page table.

Figure 9.8 Paging hardware.
Figure 9.9 Paging model of lo g ical and physical memory.

- The page size(like the frame size) is defined by the hardware.

- If the size of logical address space is 2^m, and a page size is 2^n,

  then the high-order m n bits designate the page number,

  and the low-order n bits designate the page offset.

[  ] PTBR (page-table base register)

페이지의 정보를 따로 메인 메모리에 Table 기록해 보관한다.

실제적으로 Memory 접근하므로 (Table 읽은 , Table 찾아서 Data Load) 속도가 느리다. page 수도 엄청나기에 이것을 읽는 또한 작업이다.

 

[  ] Translation Look-aside buffer. (TLB)

Cache memory 사용하여 TLB 기록한다.

Figure 9.12 Paging hardware with TLB.

TLB hit : if the page number of interest is in the TLB.

TLB miss : if the page number of interest is not in the TLB.

hit ratio 따라 속도가 달라진다.

 

[  ] Memory Protection with Paging.

물리적으로 1bit 추가하여, true라면 legal하고 false라면 illegal 상태를 의미한다.

bit protection bit 한다.

Figure 9.13 Valid bit (v) or in v alid bit (i) in a page table.

 

[  ] Shared Pages.

DLL 같은 것들을 이곳에 올리면 매우 효율적으로 자원을 사용할 있다. (실행 중에 자신의 코드가 변경되지 않는 것들)

 

Physical Memory 하나이고 Page table에서 같은 주소를 가리키고 있다.

Figure 9.14 Sharing of standard C library in a paging environment.

 

 

[  ] Hierarchical Paging.

이름 그대로, page 너무 크다면 다른 page 나눠 새로운 page 가리키는 기법.

Figure 9.16 Address translation for a two-lev e l   32-bit p a ging architecture.

[  ] Hashed Page Tables.

Hash 값으로 Page 구성한다.(hash 생성을 hardware 구성해서 효율성을 높인다.)

address 공간도 32bit(CPU Cache) 관리한다.

 

[  ] Inverted Page Tables.

Page table 안에 PID 정보를 추가하여 관리한다.

Figure 9.18 Inverted page table.

 

 

[  ] Swapping.

프로그램이 필요한 메모리가 실제 메모리 공간 보다 경우 사용 있다. (프로그램 전체를 메모리에 올릴 필요가 없다.)

지금 당장 필요한 메모리만 paging 하여 사용한다.

Figure 9.19 Standard swapping of two processes using a disk as a b a cking store.

요즘은 swapping with paging 그냥 paging 이라 부른다.

page out : moves a page from memory to backing store.

page in : moves a page from backing store to memory.

- Paging works well in conjunction with the virtual memory. (Chapter 10)

 

Figure 9.20 Swapping with paging.

 

'Computing > Operating System' 카테고리의 다른 글

17 > Storage Management  (0) 2021.11.15
16 > Page Replacement  (0) 2021.11.15
13 > Main Memory  (0) 2021.11.15
12 > 동기화(4)  (0) 2021.11.15
11 > 동기화(3)  (0) 2021.11.15