Middle East Technical University

Total Page:16

File Type:pdf, Size:1020Kb

Middle East Technical University

MIDDLE EAST TECHNICAL UNIVERSITY Department of Computer Engineering Ceng Ankara 06531, Turkey 334 Tel: +90 (312) 210 5577 Fax: +90 (312) 210 1259 - Operating Systems (F. P. Genç) Midterm 1 - 2’Th May 2007 Duration - 90 minutes

This is an open book exam. You may use your textbook and any notes you have. Collaboration, however, is not allowed. Read each question carefully and pace yourself. Please use a separate paper for each answer, using the back of page if necessary. When answering the questions please be considerate. Do not write anything which is not relevant to the question. Do not write too much detail.

Question 1 (25 points) Suppose we have an average page fault rate of 1 every 100,000 instructions, a normal instruction takes 1 microsecond, and a page fault causes the instruction to take 10 additional milliseconds. What is the average instruction time, taking page faults into account? What if the instruction time were halved? Suppose we used a different paging algorithm that took an additional millisecond per page fault, but reduced the page fault rate to one per 120,000 instructions: would this result in an increase in overall performance or not? Explain your reasoning. Question 2 (25 points) What is the difference between (1) a context switch and (2) a process switch? Consider a time-sharing operating system whose kernel executes (mostly) in the context of a process (e.g. UNIX). Which kind(s) of switch (typically) occur in this case upon the following events?  an user process calls one of its subroutines;  an user process calls a system call;  an user process's CPU time quantum expires; Assume, for simplicity, that there is one CPU only.

Question 3 (25 points) A certain demand paging system uses pages 8 KB wide. Reading a word from a page table (kept in RAM) involves a overhead of 500 nsec. To cope with this overhead, a TLB is used, which holds up to 64 entries (page/frame number pairs), and can do a lookup in 100 nsec. What hit ratio (proportion of TLB hits to total memory references) is needed to reduce the mean overhead to 200 nsec? What is the corresponding mean hit rate (in number of TLB hits per second)? [Hint: not all the above information about the system is relevant.] Question 4 (25 points) You are the system administrator of computer system whose OS uses a demand-paging virtual memory. A monitor program reports the following utilizations measures (fraction of time during which the device is busy):  CPU: 20%;  Paging disk: 97.7%;  Other I/O devices: 5%;

Which (if any) of the following actions will (probably) improve CPU utilization? Why? (5 points each) 1. Install a faster CPU.

1 2. Install a bigger paging disk. 3. Increase the degree of multiprogramming. Decrease the degree of multiprogramming. 4. Replace the other I/O device with faster ones.

2

Recommended publications