Top Banner
Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris [email protected]
22

Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris [email protected].

Jan 18, 2016

Download

Documents

Roy May
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu.

Solution to the Fall 2012 Second COSC 6360 Quiz

Jehan-François Pâris

[email protected]

Page 2: Solution to the Fall 2012 Second COSC 6360 Quiz Jehan-François Pâris jparis@uh.edu.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Example

Eag

er r

elea

seL

azy

rele

ase