Tutorial Week 10

Questions

    Virtual Memory

  1. What effect does increasing the page size have?


  2. Why is demand paging generally more prevalent than pre-paging?


  3. Describe four replacement policies and compare them.


  4. What is thrashing? How can it be detected? What can be done to combat it?


  5. Multi-processors

  6. What are the advantages and disadvantages of using a global scheduling queue over per-CPU queues? Under which circumstances would you use the one or the other? What features of a system would influence this decision?


  7. When does spinning on a lock (busy waiting, as opposed to blocking on the lock, and being woken up when it's free) make sense in a multiprocessor environment?


  8. Why is preemption an issue with spinlocks?


  9. How does a read-before-test-and-set lock work and why does it improve scalability?


  10. Scheduling

  11. What do the terms I/O bound and CPU bound mean when used to describe a process (or thread)?


  12. What is the difference between cooperative and pre-emptive multitasking?


  13. Consider the multilevel feedback queue scheduling algorithm used in traditional Unix systems. It is designed to favour IO bound over CPU bound processes. How is this achieved? How does it make sure that low priority, CPU bound background jobs do not suffer starvation?

    Note: Unix uses low values to denote high priority and vice versa, 'high' and 'low' in the above text does not refer to the Unix priority value.


  14. Why would a hypothetical OS always schedule a thread in the same address space over a thread in a different address space? Is this a good idea?


  15. Why would a round robin scheduler NOT use a very short time slice to provide good responsive application behaviour?

  16. I/O

  17. Describe programmed I/O and interrupt-driven I/O in the case of receiving input (e.g. from a serial port). Which technique normally leads to more efficient use of the CPU? Describe a scenario where the alternative technique is more efficient.

  18. A device driver routine (e.g. read_block() from disk) is invoked by the file system code. The data for the filesystem is requested from the disk, but is not yet available. What do device drivers generally do in this scenario?

  19. Describe how I/O buffering can be formulated as a bounded-buffer producer-consumer problem.

  20. An example operating system runs its interrupt handlers on the kernel stack of the currently running application. What restriction does this place on the interrupt handler code? Why is the restriction required?