1 / 27

Solutions for the First Quiz

This document provides answers to short-answer questions related to various topics in COSC 6360 Fall 2014, including mapped files, cylinder groups, FFS metadata updates, UNIX set-userid bit, file access control lists, and file system blocks.

corrine
Download Presentation

Solutions for the First Quiz

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Solutions for the First Quiz COSC 6360 Fall 2014

  2. Questions with short answers • What is the main advantage of mapped files?

  3. Questions with short answers • What is the main advantage of mapped files? • Mapped files reduce the number of context switches in the file subsystem.

  4. Questions with short answers • What is the main advantage of cylinder groups?

  5. Questions with short answers • What is the main advantage of cylinder groups? • Since each cylinder group can contain both i-nodes and data blocks, the contents of most files can be located in the same cylinder group as their i-node.

  6. Questions with short answers • Why does FFS use blocking writes for all its metadata updates?

  7. Questions with short answers • Why does FFS use blocking writes for all its metadata updates? • To ensure that all metadata updates are written to disk in the right order.

  8. Questions with short answers • In MACH, what should be the inheritance attribute of an address range that contains a mapped file?

  9. Questions with short answers • In MACH, what should be the inheritance attribute of an address range that contains a mapped file? • Shared

  10. Questions with short answers • What does the UNIX set-userid bit allow?

  11. Questions with short answers • What does the UNIX set-userid bit allow? • It allows a program to be executed with the rights of its owner rather than with the rights of the user executing it.

  12. Questions with short answers • Where does UNIX store file access control lists?Hint: you probably know them under a different name.

  13. Questions with short answers • Where does UNIX store file access control lists?Hint: you probably know them under a different name. • In the i-node of each file

  14. File system • A 32-bit UNIX file system has 8 kilobyte blocks and i-nodes with 15 block addresses. How many file blocks can be accessed (4×5 points) • Directly from the i-node? • With one level of indirection? • With two levels of indirections? • With three levels of indirections?

  15. File System Other stuff 0 2 11 12 13 … … … … 15 block addresses 1 1 3 14 … Not needed 12 direct block addresses … … 2,048 indirect block addresses … … Block size =8 KB32-bit addresses 1,0241,024 double indirect block addresses but we only use 512K – 2,048 – 12 of them

  16. File system • A 32-bit UNIX file system has 8 kilobyte blocks and i-nodes with 15 block addresses. How many file blocks can be accessed (4×5 points) • Directly from the i-node? 12blocks • With one level of indirection? • With two levels of indirections? • With three levels of indirections?

  17. File system • A 32-bit UNIX file system has 8 kilobyte blocks and i-nodes with 15 block addresses. How many file blocks can be accessed (4×5 points) • Directly from the i-node? 12blocks • With one level of indirection? 2,048 blocks • With two levels of indirections? • With three levels of indirections?

  18. File system • A 32-bit UNIX file system has 8 kilobyte blocks and i-nodes with 15 block addresses. How many file blocks can be accessed (4×5 points) • Directly from the i-node? 12blocks • With one level of indirection? 2,048 blocks • With two levels of indirections?512K – 2K – 12blocks • With three levels of indirections?

  19. File system • A 32-bit UNIX file system has 8 kilobyte blocks and i-nodes with 15 block addresses. How many file blocks can be accessed (4×5 points) • Directly from the i-node? 12blocks • With one level of indirection? 2,048 blocks • With two levels of indirections?512K – 2K – 12blocks • With three levels of indirections? 0 blocks

  20. Virtual memory • Consider the Two-Handed Clock policy of Berkeley UNIX, where the page-referenced bit is simulated by software. • What is the function of the first hand of that clock? (5 easy points)

  21. Virtual memory • Consider the Two-Handed Clock policy of Berkeley UNIX, where the page-referenced bit is simulated by software. • What is the function of the first hand of that clock? (5 easy points) • It invalidates all the pages it touches.

  22. Virtual memory • Consider the Two-Handed Clock policy of Berkeley UNIX, where the page-referenced bit is simulated by software. • What is the function of the second hand of the clock? (5 easy points)

  23. Virtual memory • Consider the Two-Handed Clock policy of Berkeley UNIX, where the page-referenced bit is simulated by software. • What is the function of the second hand of the clock? (5 easy points) • It expels from memory all the invalid pages it touches.

  24. Virtual memory • Consider the Two-Handed Clock policy of Berkeley UNIX, where the page-referenced bit is simulated by software. • What would happen if the second hand follows too closely the first one? (5 points)

  25. Virtual memory • Consider the Two-Handed Clock policy of Berkeley UNIX, where the page-referenced bit is simulated by software. • What would happen if the second hand follows too closely the first one? (5 points) • Pages would be expelled too quickly • There will be too many page faults

  26. Virtual memory • Consider the Two-Handed Clock policy of Berkeley UNIX, where the page-referenced bit is simulated by software. • What would happen if the second hand is too far apart from the first one? (5 points)

  27. Virtual memory • Consider the Two-Handed Clock policy of Berkeley UNIX, where the page-referenced bit is simulated by software. • What would happen if the second hand is too far apart from the first one? (5 points) • Pages would remain too long in main memory after their last access. • It would be more difficult to find free page frames.

More Related