Operating Systems Sample Exam Questions

Part 2

28.  Describe four general strategies for dealing with deadlocks.

29.  For single unit resources, we can model resource allocation and requests as a directed graph connecting processes and resources. Given such a graph, what is involved in deadlock detection.

30.  Is the following system of four processes with 2 resources deadlocked?

Current allocation matrix

P113
P241
P312
P420

Current request matrix
P112
P243
P317
P451

Availability Vector
14

If the availability vector is as below, is the system above still deadlocked?
23

Is the system deadlocked if the availability is
24

31.  Assuming the operating system detects the system is deadlocked, what can the operating system do to recover from deadlock?

32.  What must the banker's algorithm know a priori in order to prevent deadlock?

33.  Describe the general strategy behind dealock prevention, and give an example of a practical deadlock prevention method.

34. Filesystems can support sparse files, what does this mean? Give an example of  an application's file organisation that might benefit from a file system's sparse file support.

35.  Give an example of a scenario that might benefit from a file system supporting an append-only access write.

36. Give a scenario where choosing a large filesystem block size might be a benefit; give an example where it might be a hinderance.

37.  Give an example where contiguous allocation of file blocks on disks can be used in practice.

38. What file access pattern is particularly suited to chained file allocation on disk?

39. What file allocation strategy is most appropriate for random access files?

40. Compare bitmap-based allocation of blocks on disk with a free block list.

41. How can the block count in an inode differ from the (file size / block size) rounded up to the nearest integer. Can the block count be greater, smaller, or both.

42. Why might the direct blocks  be stored in the inode itself?

43.  Given that the maximum file size of combination of direct, single indirection, double indirection, and triple indirection in an inode-based filesystem is approximately the same as a filesystem soley using triple indirection, why not simply use only triple indirection to locate all file blocks?

44.  What is the maximum file size supported by a file system with 16 direct blocks, single, double, and triple indirection? The block size is 512 bytes. Disk block numbers can be stored in 4 bytes.

45.  The berkely fast filesystem (and Linux Ext2fs) use the idea of block groups. Describe what this idea is and what improvements block groups have over the simple filesystem layout of  the System V file system (s5fs).

46.  What is the reference count field in the inode? You should consider its relationship to directory entries in you answer.

47. The filesystem buffer cache does both buffering and caching. Describe why buffering is needed. Describe how buffering can improve performance (potentially to the detriment of file system robustness). Describe how the caching component of the buffer cache improves performance.

48. What does flushd do on a UNIX system?

49. Why might filesystems managing external storage devices do write-through caching (avoid buffering writes) even though there is a detrimental affect on performance.

50. Describe the difference between external and internal fragmentation. Indicate which of the two are most likely to be an issues on a) a simple memory memory mangement machine using base limit registers and static partitioning, and b) a similar machine using dynamic partitioning.

51. List and describe the four memory allocation algorithms covered in lectures. Which two of the four are more commonly used in practice?

52. Base-limit MMUs can support swapping. What is swapping? Can swapping permit an application requiring 16M memory to run on a machine with 8M of RAM?

53. Describe page-based virtual memory. You should consider pages, frames, page tables, and Memory Management Units in your  answer.

54. Give some advantages of a system with page-based virtual memory compared to a simply system with base-limit registers that implements swapping.

55. Describe segmentation-based virtual memory.  You should consider the components of a memory address, the segment table and its contents, and how the final physical address is formed in your answer.

56. What is a translation look-aside buffer? What is contained in each entry it contains?

57. Some TLBs support address space identifiers (ASIDS), why?

58. Describe a two-level page table? How does it compare to a simple page table array?

59. What is an inverted page table? How does it compare to a two-level page table?

60.  What are temporal locality and spatial locality?

61. What is the working set of a process?

62. How does page size of a particular achitecture affect working set size?

63. What is thrashing? How might it be detected? How might one recover from it once detected?

64.  Enumerate some pros and cons for increasing the page size.

65. Describe two virtual memory page fetch policies. Which is less common in practice? Why?

66. What operating system event might we observe and use as input to an algorithm that decides how many  frames an application receives (i.e. an algorithm that determines the application's resident set size)?

67. Name and describe four page replacement algorithms. Critically compare them with each other.