Solutions to the Second QuizFirst questionAnswerSecond QuestionSlide 5Third questionSlide 7Slide 8Slide 9Slide 10Slide 11Slide 12Fourth QuestionSlide 14Fifth questionSlide 16Slide 17Slide 18Sixth questionSlide 20Slide 21Slide 22Slide 23Slide 24Solutions to the Solutions to the Second QuizSecond QuizCOSC 6360COSC 6360Fall 2011Fall 2011First questionFirst questionWhat must a programmer do to ensure What must a programmer do to ensure that a given program will execute that a given program will execute correctlycorrectly on on TreadMarksTreadMarks? ?AnswerAnswerAll access to shared data must be All access to shared data must be preceded by apreceded by aTmk_lock_acquire()Tmk_lock_acquire()and followed by a and followed by a Tmk_lock_release().Tmk_lock_release().Second QuestionSecond QuestionWhat is the main advantage of What is the main advantage of TreadMark lazy releaseTreadMark lazy release policy policy compared to compared to Munin eager releaseMunin eager release policy? policy?AnswerAnswerIt reduces the communication overhead It reduces the communication overhead of the DSM. of the DSM. Comment:Comment:I asked for an advantage!I asked for an advantage!Third questionThird questionWhat is What is inheritanceinheritance in Mach? in Mach?At which level is it defined? At which level is it defined? Explain how Mach uses it to support Explain how Mach uses it to support both both regularregular and and lightweightlightweight processes. processes.AnswerAnswerInheritance defines what happens to a Inheritance defines what happens to a range of addresses when a process forks range of addresses when a process forks a child. a child.Third questionThird questionWhat is What is inheritanceinheritance in Mach? in Mach?At which level is it defined?At which level is it defined? Explain how Mach uses it to support Explain how Mach uses it to support both both regularregular and and lightweightlightweight processes.processes.AnswerAnswerInheritance is defined at the level of Inheritance is defined at the level of address ranges address ranges containing all addresses containing all addresses mapped by a specific memory object.mapped by a specific memory object.Comment:Comment:Nobody came with such a detailed Nobody came with such a detailed answer.answer.Third questionThird questionWhat is What is inheritanceinheritance in Mach? in Mach?At which level is it defined? At which level is it defined? Explain how Mach uses it to support Explain how Mach uses it to support both both regularregular and and lightweightlightweight processes. processes.AnswerAnswerMach specifies the inheritance attribute Mach specifies the inheritance attribute of its data segment to beof its data segment to beCOPYCOPY when it performs a regular when it performs a regular UNIX fork()UNIX fork()SHAREDSHARED when it forks a lightweight when it forks a lightweight process. process.AnswerAnswerNew size(T1) = 127 New size(T1) = 127 T1T1 loses the page loses the pageNew target_T1 =128New target_T1 =128Remains unchangedRemains unchangedFourth QuestionFourth QuestionConsider an ARC cache with a total Consider an ARC cache with a total capacity of 512 pagescapacity of 512 pagesAssume size(T1) = target_T1 =128 pagesAssume size(T1) = target_T1 =128 pagesHow these two parameters would be How these two parameters would be affected if:affected if:A page already present in T1 is A page already present in T1 is referenced a second time? referenced a second time? A page that has never been accessed A page that has never been accessed before is brought into the cache?before is brought into the cache?AnswerAnswerNew size(T1) = 128New size(T1) = 128Since Since size(T1) = target_T1, size(T1) = target_T1, ARC will ARC will expel one page in T to make space for expel one page in T to make space for the incoming pagethe incoming pageNew target_T1 =128New target_T1 =128Remains unchangedRemains unchangedFifth questionFifth questionWhat is the main issue raised byWhat is the main issue raised by dirty dirty superpagessuperpages??How do Navarro How do Navarro et al.et al. propose to solve propose to solve it? it?AnswerAnswerSince each superpage only has a single Since each superpage only has a single dirty bit, the page replacement policy has dirty bit, the page replacement policy has no way to knowno way to knowWhich base pages areWhich base pages are dirty dirty—and must —and must be flushed out when the superpage is be flushed out when the superpage is expelled from main memoryexpelled from main memoryWhich base pages areWhich base pages are still clean still cleanFifth questionFifth questionWhat is the main issue raised byWhat is the main issue raised by dirty dirty superpagessuperpages??How do Navarro et al. propose to solve it?AnswerAnswerNavarro et al. propose to avoid this issue Navarro et al. propose to avoid this issue by disbanding superpages the first time by disbanding superpages the first time one of their base pages gets modifiedone of their base pages gets modified1818Sixth questionSixth questionWhat is the main advantage ofWhat is the main advantage of MCS MCS lockslocks??When does it result in a much better When does it result in a much better system performance? system performance? When does it not?When does it not?AnswerAnswerMCS locks have a much lower contention MCS locks have a much lower contention overhead than conventional spinlocksoverhead than conventional spinlocksBecause waiting processes are put on Because waiting processes are put on a queuea queueSixth questionSixth questionWhat is the main advantage ofWhat is the main advantage of MCS MCS lockslocks?? When does it result in a much better When does it result in a much better system performance? system performance? When does it not? When does it not?AnswerAnswerThey perform much better than spinlocks They perform much better than spinlocks at high contention rates. at high contention rates.Sixth questionSixth questionWhat is the main advantage ofWhat is the main advantage of MCS MCS lockslocks?? When does it result in a much better When does it result in a much better system performance?system performance? When does it not? When does it not?AnswerAnswerThey often perform worse than spinlocks They often perform worse
View Full Document