1 / 24

Solutions to the Second Quiz

Solutions to the Second Quiz. COSC 6360 Fall 2011. First question. What must a programmer do to ensure that a given program will execute correctly on TreadMarks ?. Answer. All access to shared data must be preceded by a Tmk_lock_acquire() and followed by a

Download Presentation

Solutions to the Second 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 to the Second Quiz COSC 6360Fall 2011

  2. First question • What must a programmer do to ensure that a given program will execute correctly on TreadMarks?

  3. Answer • All access to shared data must be preceded by a • Tmk_lock_acquire() and followed by a • Tmk_lock_release().

  4. Second Question • What is the main advantage of TreadMark lazy release policy compared to Munin eager release policy?

  5. Answer • It reduces the communication overhead of the DSM. • Comment: • I asked for an advantage!

  6. Third question • What is inheritance in Mach? • At which level is it defined? • Explain how Mach uses it to support both regular and lightweight processes.

  7. Answer • Inheritance defines what happens to a range of addresses when a process forks a child.

  8. Third question • What is inheritance in Mach? • At which level is it defined? • Explain how Mach uses it to support both regular and lightweight processes.

  9. Answer • Inheritance is defined at the level of address ranges containing all addresses mapped by a specific memory object. • Comment: • Nobody came with such a detailed answer.

  10. Third question • What is inheritance in Mach? • At which level is it defined? • Explain how Mach uses it to support both regular and lightweight processes.

  11. Answer • Mach specifies the inheritance attribute of its data segment to be • COPY when it performs a regular UNIX fork() • SHARED when it forks a lightweight process.

  12. Answer • New size(T1) = 127 • T1 loses the page • New target_T1 =128 • Remains unchanged

  13. Fourth Question • Consider an ARC cache with a total capacity of 512 pages • Assume size(T1) = target_T1 =128 pages • How these two parameters would be affected if: • A page already present in T1 is referenced a second time? • A page that has never been accessed before is brought into the cache?

  14. Answer • New size(T1) = 128 • Since size(T1) = target_T1, ARC will expel one page in T to make space for the incoming page • New target_T1 =128 • Remains unchanged

  15. Fifth question • What is the main issue raised by dirty superpages? • How do Navarro et al. propose to solve it?

  16. Answer • Since each superpage only has a single dirty bit, the page replacement policy has no way to know • Which base pages are dirty—and must be flushed out when the superpage is expelled from main memory • Which base pages are still clean

  17. Fifth question • What is the main issue raised by dirty superpages? • How do Navarro et al. propose to solve it?

  18. Answer • Navarro et al. propose to avoid this issue by disbanding superpages the first time one of their base pages gets modified18

  19. Sixth question • What is the main advantage of MCS locks? • When does it result in a much better system performance? • When does it not?

  20. Answer • MCS locks have a much lower contention overhead than conventional spinlocks • Because waiting processes are put on a queue

  21. Sixth question • What is the main advantage of MCS locks? • When does it result in a much better system performance? • When does it not?

  22. Answer • They perform much better than spinlocks at high contention rates.

  23. Sixth question • What is the main advantage of MCS locks? • When does it result in a much better system performance? • When does it not?

  24. Answer • They often perform worse than spinlocks at very low to low contention rate • Because entering the queue takes more time than going through very few spinlock cycles

More Related