1 / 56

Problems discussed in the review session for the final

Problems discussed in the review session for the final. COSC 4330/6310 Summer 2012. True or false?. External fragmentation is often the result of using very large page sizes. Answer. External fragmentation is often the result of using very large page sizes.

thuyet
Download Presentation

Problems discussed in the review session for the final

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. Problems discussed in the review session for the final COSC 4330/6310 Summer 2012

  2. True or false? External fragmentation is often the result of using very large page sizes.

  3. Answer External fragmentation is often the result of using very large page sizes. FalseLarger page sizes increase internal fragmentation but it rarely is an issue in virtual memory systems

  4. True or false? Global page replacement policies cannot handle real-time processes.

  5. Answer Global page replacement policies cannot handle real-time processes. TrueReal-time processes must keep all their pages in memory all the time, which can only be achieved by giving them a private partition containing all the pages they will ever need

  6. True or false? UNIX uses file-specific passwords to control access to files.

  7. Answer UNIX uses file-specific passwords to control access to files. FalseUNIX uses the file access control list to check which file access rights can be granted to a user process

  8. True or false? UNIX stores the name of a file in its i-node.

  9. Answer UNIX stores the name of a file in its i-node. FalseSee next answer

  10. True or false? A UNIX file can have several names.

  11. Answer A UNIX file can have several names. TrueIt can have as many names as there are directory entries pointing to it

  12. Bob File i-node Robert An example • Two directory entries pointing to same i-node • The file has two names

  13. True or false? UNIX special files are not files.

  14. Answer UNIX special files are not files. True. They are physical devices—or POSIX named semaphores

  15. TLB misses • When comparing the hit ratios of two translation look-aside buffers, which question should we ask first?

  16. Answer • Are TLB misses handled by the firmware or by the OS? • If TLB misses are handled by the firmware, the cost of a TLB miss is one extra memory reference • If TLB misses are handled by the OS,the cost of a TLB miss is two context switches.

  17. The dirty bit • What is the purpose of the dirty bit?

  18. Answer • The dirty bit tells whether a page has been modified since the last time it was brought into main memory. It is used whenever a page must be expelled from main memory. • If its dirty bit is ON, the page must be saved to disk before being expelled • If its dirty bit is OFF, there already is an exact copy of the page on disk.

  19. The BSD page replacement policy • How does the BSD UNIX page replacement policy simulate a missing page-referenced bit? • What is the main drawback of the technique?

  20. Answer (I) • How does the BSD UNIX page replacement policy simulate a missing page-referenced bit? • Whenever the hand of the clock encounters a page that has been recently used, it marks it INVALID instead of clearing its page-referenced bit.

  21. Answer (II) • What is the main drawback of the technique? • The main drawback of this technique is that an interrupt will occur the next time that page will be accessed. The cost of handling this interrupt will be roughly equal to two context switches.

  22. Page replacement policies • Among the following page replacement policies: Local FIFO, Local LRU, Global FIFO, Global LRU, Original Clock,Berkeley Clock, and Windows • Which ones are the poorest performers?

  23. Answer • Among the following page replacement policies: Local FIFO, LOCAL LRU, Global FIFO, Global LRU, Original Clock,Berkeley Clock, and Windows • Which ones are the poorest performers? • Local FIFO and Global FIFO

  24. Page replacement policies • Among the following page replacement policies: Local FIFO, Local LRU, Global FIFO, Global LRU, Original Clock,Berkeley Clock, and Windows • Which ones cannot be implemented at a reasonable cost?

  25. Answer • Among the following page replacement policies: Local FIFO, Local LRU, Global FIFO, Global LRU, Original Clock,Berkeley Clock, and Windows • Which ones cannot be implemented at a reasonable cost? • Local LRU and Global LRU

  26. Page replacement policies • Among the following page replacement policies: Local FIFO, Local LRU, Global FIFO, Global LRU, Original Clock,Berkeley Clock, and Windows • Which ones provide a decent performance and do not require any special hardware support?

  27. Answer • Among the following page replacement policies: Local FIFO, Local LRU, Global FIFO, Global LRU, Original Clock,Berkeley Clock, and Windows • Which ones provide a decent performance and do not require any special hardware support? • Berkeley Clock and Windows

  28. Page replacement policies • Among the following page replacement policies: Local FIFO, LOCAL LRU, Global FIFO, Global LRU, Original Clock,Berkeley Clock, and Windows • Which ones support real-time processes?

  29. Answer • Among the following page replacement policies: Local FIFO, LOCAL LRU, Global FIFO, Global LRU, Original Clock,Berkeley Clock, and Windows • Which ones support real-time processes? • Windows(older exams mention VMS)

  30. Page table organization • A virtual memory system has a virtual address space of 4 GB and a page size of 4 Kilobytes. Each PTE occupies 4 bytes. • How many bits are used for the byte offset?

  31. Page table organization • A virtual memory system has a virtual address space of 4 GB and a page size of 4 Kilobytes. Each PTE occupies 4 bytes. • How many bits are used for the byte offset? • Since 4K =212, the byte offset will use 12 bits.

  32. Page table organization • A virtual memory system has a virtual address space of 4 GB and a page size of 4 Kilobytes. Each PTE occupies 4 bytes. • How many bits are used for the page number?

  33. Page table organization • A virtual memory system has a virtual address space of 4 GBs and a page size of 4 Kilobytes. Each PTE occupies 4 bytes. • How many bits are used for the page number? • Since 4G = 232,We have 32-bit virtual addressesOf these 32 bits the page number occupies 32 - 12 = 20 bits

  34. Page table organization • A virtual memory system has a virtual address space of 4 Gigabytes and a page size of 4 Kilobytes. Each PTE occupies 4 bytes. • What is the maximum number of page table entries in a page table?

  35. Page table organization • A virtual memory system has a virtual address space of 4 Gigabytes and a page size of 4 Kilobytes. Each PTE occupies 4 bytes. • What is the maximum number of page table entries in a page table? • Address space/ Page size =232 / 212 = 220 PTE’s.

  36. Page table organization • A virtual memory system has a virtual address space of 4 GB and a page size of 4 Kilobytes. Each PTE occupies 4 bytes. • What is the maximum size of a page table?

  37. Page table organization • A virtual memory system has a virtual address space of 4 GB and a page size of 4 Kilobytes. Each PTE occupies 4 bytes. • What is the maximum size of a page table? • Since each PTE occupies 4 bytes,4 x 220= 222 bytes = 4 MB.

  38. UNIX file organization (I) • A 32-bit UNIX file system has 16 kilobyte pages and i-nodes with 15 block addresses. How many file bytes can be accessed • Directly from the i-node?

  39. Answer • A 32-bit UNIX file system has 16 kilobyte pages and i-nodes with 15 block addresses. How many file bytes can be accessed • Directly from the i-node? • The 12 first blocks that is12 x 16 KB =192 KB.

  40. UNIX file organization (II) • A 32-bit UNIX file system has 16 kilobyte pages and i-nodes with 15 block addresses. How many file bytes can be accessed • With one level of indirection?

  41. Answer • A 32-bit UNIX file system has 16 kilobyte pages and i-nodes with 15 block addresses. How many file bytes can be accessed • With one level of indirection? • An indirect block can store16KB/4B = 4K block addresses. • Hence we can access the next4K x 16K = 64MB of the file

  42. UNIX file organization (III) • A 32-bit UNIX file system has 16 kilobyte pages and i-nodes with 15 block addresses. How many file bytes can be accessed • With two levels of indirections?

  43. Answer • A 32-bit UNIX file system has 16 kilobyte pages and i-nodes with 15 block addresses. How many file bytes can be accessed • With two levels of indirections? • We should be able to access 4K4K = 224 blocks of 16 KB = 256 GB • Since the maximum file size is 4 GB we will be able to access4 GB – 64 MB – 192 KB

  44. UNIX file organization (IV) • A 32-bit UNIX file system has 16 kilobyte pages and i-nodes with 15 block addresses. How many file bytes can be accessed • With three levels of indirections?

  45. Answer • A 32-bit UNIX file system has 16 kilobyte pages and i-nodes with 15 block addresses. How many file bytes can be accessed • With three levels of indirections? • None

  46. Internal fragmentation • Internal fragmentation is not a big problem in virtual memory systems. Is it always so in file systems? • Give a hypothetical example to support your argument.

  47. Answer • Internal fragmentation can be a big problem whenever the disk partition contains many files than are much smaller than the block size. • Consider for instance a partition where many files are smaller than 1 KB and the block size is 4KB. More than 75 percent of the space used by these files will be wasted.

  48. Controlling access to files • Alice, Bob and Carol want to share a few files on a UNIX system while preventing other users to access these files. What should they do?

  49. Answer • Alice, Bob and Carol want to share a few files on a UNIX system while preventing other users to access these files. What should they do? • They should ask their system administrator to create a group “abc” for the three of them.

  50. Access control lists and tickets • Give examples of tickets and access controls lists in the UNIX file system.

More Related