Answer Any Five from the Following
Total Page:16
File Type:pdf, Size:1020Kb
Final Exam CS521 Operating Systems Spring 2011
Answer any five from the following
Test modality: Open book, open notes but neither laptop nor cell phone. Time: 2 hours.
1. Consider a memory system in which the following hole-sizes occur in memory order: 10 KB, 4 KB, 20 KB, 7 KB, 9 KB, 12 KB and 15 KB. Which hole is taken for successive segment requests of
a. 12 KB b. 10 KB c. 9 KB
using first fit? Now repeat the question for best fit, worst fit and the next fit. What is the rationale for choosing next fit as a reasonable alternative to first fit?
2. Suppose that a machine has 38-bit virtual addresses and 32-bit physical addresses. (a) What is the main advantage of a multilevel page-table over a single level one? (b) A computer with a 32-bit address uses a two-level page table. Virtual addresses are split into 9-bit top level page, 11-bit second level page table-field, and the rest as offset. How large are the pages and how many are there in the address space?
3. Suppose that the virtual page reference stream contains repetitions of long sequences of page references, followed occasionally by a random page reference. For example, the sequence: 0,1, 2, …,511, 431, 0, 1, 2, …,511, 275, 0, 1, 2 … consists of repetitions of the sequence 0, 1, 2, …511 followed by a random reference to pages 431, 275, etc.
(a) Why won’t the standard replacement algorithms (LRU, FIFO, Clock) be effective in handling this workload for a page allocation that is less than the sequence length? (b) If this program were allocated 500 page frames, describe a page replacement approach that would perform much better than the LRU, FIFO or Clock algorithm.
4. Can you think of any situations where supporting virtual memory would be a bad idea, and what would be gained by not having to support virtual memory? Explain.
5. Indicate why the concept of locality is an important issue in page replacement problem. Given that locality could be both temporal and spatial, ideally both these components need to be optimally exploited to assure good paging performance. Identify the entities which attempt to exploit time-optimization and space-optimization, respectively. Does code size affect locality? Rationalize your answer. Why is locality not an issue in a segment based system?
6. (a) A set of m processes shares n identical resources which may be acquired and released one at a time. No process ever needs more than n resources. The sum of the maximum needs of the resources is less than m+n. Show that the system is deadlock free. (b) All the trajectories of process progress flow of two co-resident processes are either horizontal or vertical as shown below. Can you envision any circumstances in which diagonal trajectories were also feasible?
7. Show and explain how one could depict the following situations using appropriate Petri Nets. (a) Deadlock state (b) Mutually exclusive sharing of a common resource by processes. Suppose instead of using only one type of tokens, the system is allowed to use colored tokens. Can you suggest how this could expand the conventional net semantics to a more enriched one?
8. Assume a task set {T1 ,T2 ,...,Tn } comprising n tasks with the execution time for Ti
given by ti i . Let Tmin be the length of an optimum schedule for on m processors.
T max{tk } T t / m Show that, in general, min k and min i . Next show that for
preemptive schedules on comprising independent tasks, Tmin is given by a tighter
bound Tmin max{max k (tk ),ti / m}
9. In a system comprising both batch and terminal users, the following observations were made during a 30 minute interval:
Active terminals 40 Think time 20 secs Interactive response time 5 secs Disk service time/access 20 ms. Disk access per batch job 100 Disk access per terminal interaction 5 Disk utilization 60%
(a) What is the batch throughput? (b) Calculate the maximum batch throughput possible if interactive response times of 15 secs are to be achievable. What assumptions must you make to answer this part of the question?