728x90

Operating System/O.S(Neso Academy, HPC Lab. KOREATECH) 19

HPC Lab) 입출력 시스템 & 디스크 관리

I/O Mechanisms Processor controlled memory access Pooling Processor 가 주기적으로 I/O 장치의 상태 확인 장점 = simple , I/O 장치가 빠르고 , 데이터 전송이 잦은 경우 효율적 단점 = Processor 의 부담이 크다 , Pooling overhead (I/O device 가 느린 경우) Interrupt I/O 장치가 작업을 완료한 후 , 자신의 상태를 Processor 에게 전달 Interrupt 발생 시 , Processor 는 데이터 전송 수행 장점 = pooling 대비 low overhead , 불규칙적인 요청 처리에 적합 단점 = Interrupt handling overhead 2가지 방법다 Process overhead ..

HPC Lab) 파일 시스템

Disk Pack Sector = 가장 기본적인 물리적 단위 Track = 같은 거리에 있는 sector 들의 집합 Cylinder = 같은 반지름을 갖는 track들의 집합 Platter = 둥근 디스크 하나를 의미한다. Surface = Platter 의 뒷면과 아랫면 Disk Drive DIsk pack 에 데이터를 기록하거나 판독할 수 있도록 구성된 장치 Head = 디스크 표면에 데이터를 기록 판독 Arm = Head를 고정 지탱 Positioner (Arm 이동장치) = Head를 원하는 track으로 이동 Spindle = Disk pack을 고정시키고 회전시킨다. Disk Address Physical disk address Logical disk address : relative addr..

HPC Lab) Virtual Memory Management

가상 메모리 관리의 목적 = 가상 메모리 시스템 성능 최적화 cost model Page fault 발생을 최소화 할 수 있게 전략을 설계해야 함. 즉 Context switch 및 Kernel 개입을 최소화 해야한다. Page fault rate = F(w) = # of page faults during w / |w| == 그냥 참조한 페이지들중에 pagefault가 일어난 비율이다. Hardware Components Address translation device (주소 사상 장치) = TLB , Cache memories , 하드웨어적으로 하면 병렬로 search 할 수 있어성능이 대폭 향상된다. 다만 비싸서 큰 table 을 쓰기 힘들다. Bit vectors Page 사용상황에 대한 정보를 기..

HPC Lab) Virtual Memory

Non continuous allocation 사용자 프로그램을 여러개의 block 으로 분할 실행시 , 필요한 block 들만 메모리에 적재 , 나머지 block 들은 swap device 에 존재 Address Mapping Continuous allocation = Relative address (상대 주소) 를 가지고 실제 주소로 Relocation 을 해주었다. Non Continuous allocation = Virutal address 상에서는 연속되어 있지만 실제 Real address 에서는 다 쪼개져서 파편적으로 존재한다. 사용자 , 프로세는 프로그램 전체가 메모리에 연속적으로 적재되었다고 가정하고 실행할 수 있음 Block Mapping 사용자 프로그램을 block 단위로 분할 / 관..

HPC Lab) Memory Management

Block = auxiliary storage 와 Main memory 사이의 데이터 전송 단위 (1~4KB) Word = Main memory 와 register 사이의 데이터 전송의 단위 (16~64bits) , 이것은 64bit 컴퓨터 할떄의 64bit라는 의미이와 동일하다. Address Binding 프로그램의 논리주소를 실제 메모리의 물리 주소로 매핑 하는 작업 Compile time binding 프로세스가 메모리에 적재될 위치를 컴파일러가 완벽히 알고 있어야하고 한번 메모리가 지정되면 변경할 수 없음 , 프로그램 전체가 메모리에 올라가야함 Load time Binding 메모리 적재 위치를 컴파일 시점에서 모르면 , 대체 가능한 상대 주소를 생성 적재 시점에 시작 주소를 반영하여 사용자 코..

HPC Lab) Deadlock

Blocked / Asleep 상태 프로세스가 특정 이벤트 , 필요한 자원을 기다리는 상태 Deadlock 과 Starvation 은 다른것이고 다른 process state 에서 일어난다. Starvation 은 발생 가능할 수 있는 이벤트인데 priority 나 운이 없어서 계속 기다리게 되는 상태 , CPU를 기다리고 있음 Deadlock 은 발생이 불가능한 이벤트이고 CPU가 아닌 다른 자원을 기다리고 있는 중이다. 자원의 분류 선점가능 여부에 따른 분류 Preemptible resource = 선점 당한후 돌아와도 문제가 발생하지 않는다. CPU, Memory (Swap device) Deadlock // Non preemptible resources = 선점 당하면 , 이후 진행에 문제가 발생..

HPC Lab) Semaphore + event count , Monitor

Eventcount 정수형 변수 , 생성시 0으로 초기화 , 감소하지 않음 특정 사건의 발생횟수를 기록 read(E) , advance(E) , await(E,v) 연산으로만 접근 가능 , 은행에서 창구마다 있는 대기번호라고 생각하면 됨 read(E) = 현재 Eventcount 값 반환 advance(E) = E 를 하나 증가시키고 해당 E (창구에서 처리하고 있는 번호) 를 기다리고 있는 프로세스를 깨워준다. await(E,v) = E < v , 즉 현재 받은 대기번호가 창구에서 처리하고 있는 번호보다 크면 당연하게 기다려야한다. Queue에서 기다리게 함 Pticket , Cticket 각각 존재한다. 처음 대기표를 부여 받는 것이다. await(In, t) = 현재 처리하고 있는 In 보다 받은 ..

12)FCFS Scheduling , Shortest Job First , Priority

Convoy Effect if processes with higher burst time arrived before the processes with smaller burst time , then , smaller processes have to wait for a long time for longer processes to release the CPU Turn Around time = Completion time - Arrival time == duration of process to arrival to completion Waiting time = TurnAround time - Burst time Useful time = Total time - Wasted time Efficiency = Usefu..

11)Preemptive Scheduling , Scheduling Criteria , FCFS(First-Come, First-Served) Scheduling

CPU Scheduler the scheduler selects a process from the processes in memory that are ready to execute and allocates the CPU to that process Dispatcher module that gives actual control of the CPU to the process selected by the scheduler. dispatch latency = time it takes for the dispatcher to stop one process an dstart another process. CPU- scheduling decisions may take place under the following 4 ..

10)Threading issue (fork , cancellation) , CPU and I/O burst cycles

Issue if one thread in a program calls fork(), does the new prcoess duplicate all threads, or is the new process single-threaded? solution some unix systems have chose to have 2 versions of fork(), one that duplicates all threads and another that duplicates only the thread that invoked the fork() system call. in muti thread process if one of thread invokes exec() system call, the program specifi..

728x90