solution to the fall 2012 second cosc 6360 quiz jehan-françois pâris [email protected]
TRANSCRIPT
![Page 2: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/2.jpg)
ARC
Consider a very small cache that can hold only 4 pages and assume that the cache is managed by the ARC replacement policy
L1 L2
In cache4 3
5 2
Simulated1 6
7 9
How would target_T1 be affected if the next page to be referenced is:
a) Page 5?
b) Page 6?
![Page 3: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/3.jpg)
Answer
Consider a very small cache that can hold only 4 pages and assume that the cache is managed by the ARC replacement policy
L1 L2
In cache4 3
5 2
Simulated1 6
7 9
• How would target_T1 be affected if the next page to be referenced is:
a) Page 5? No change
b) Page 6? Decreased
![Page 4: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/4.jpg)
Similar question
Consider a very small cache that can hold only 4 pages and assume that the cache is managed by the ARC replacement policy
L1 L2
In cache4 3
5 2
Simulated1 6
7 9
• How would target_T1 be affected if the next page to be referenced is:
a) Page 7?
b) Page 2?
![Page 5: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/5.jpg)
Answers
Consider a very small cache that can hold only 4 pages and assume that the cache is managed by the ARC replacement policy
L1 L2
In cache4 3
5 2
Simulated1 6
7 9
• How would target_T1 be affected if the next page to be referenced is:
a) Page 7? Increased
b) Page 2? No change
![Page 6: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/6.jpg)
TLB issues
A computer has a TLB with 128 entries and uses 8 KB pages. What is the coverage of its TLB?
![Page 7: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/7.jpg)
Answer
A computer has a TLB with 128 entries and uses 8 KB pages. What is the coverage of its TLB?
– Coverage = 1288 KB = 1 MB
If page size was 4KB
– Coverage = 1284 KB = 512 KB
![Page 8: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/8.jpg)
Proof-carrying code (I)
Which problem does proof-carrying code (PCC) attempt to solve?
![Page 9: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/9.jpg)
Answer
Which problem does proof-carrying code (PCC) attempt to solve?
– To let kernels to check extension safety a extension load time
The idea is to eliminate any kind of run-
time checking overhead
![Page 10: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/10.jpg)
Proof carrying code (II)
What is the main drawback of the approach?
![Page 11: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/11.jpg)
Answer
What is the main drawback of the approach?
– It is very difficult to construct safety proofs for non-trivial extensions
![Page 12: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/12.jpg)
Mach VM system (I)
How does the Mach virtual memory subsystem guarantee exclusive access to its data structures?
![Page 13: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/13.jpg)
Answer
How does the Mach virtual memory subsystem guarantee exclusive access to its data structures?
– It uses locks whenever exclusive access to a data structure has to be guaranteed.
![Page 14: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/14.jpg)
Mach VM system (II)
How does it prevent deadlocks?
![Page 15: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/15.jpg)
Answer
How does it prevent deadlocks?
All VM algorithms gain locks using the same ordering.
![Page 16: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/16.jpg)
More Mach
Give one example of a Mach memory object.
![Page 17: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/17.jpg)
Answer
Give one example of a Mach memory object.
– A swap area– Any file of the file system
Could be– Executable file for a running program– A file being mapped
![Page 18: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/18.jpg)
Treadmarks (I)
Treadmarks is said to use a lazy release policy. Why?
![Page 19: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/19.jpg)
Answer
Treadmarks is said to use a lazy release policy. Why?
– Delays propagation of release values
until an acquire is issued
![Page 20: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/20.jpg)
Treadmarks (II)
What would be the corresponding eager release policy?
![Page 21: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/21.jpg)
Answer
What would be the corresponding eager release policy?
– The policy would immediately propagate all released values to all other processes
![Page 22: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu](https://reader035.vdocuments.site/reader035/viewer/2022062409/5697bfef1a28abf838cba137/html5/thumbnails/22.jpg)
Example
Eag
er r
elea
seL
azy
rele
ase