Top Banner
SOLUTIONS TO THE SECOND 6360 QUIZ Jehan-François Pâris Fall 2016
23

SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

May 02, 2018

Download

Documents

hoanghanh
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: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

SOLUTIONS TO THE SECOND 6360 QUIZ

Jehan-François PârisFall 2016

Page 2: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

First question

What is inheritance in Mach?

Page 3: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Answer

What is inheritance in Mach?

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

Page 4: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

First question

At which level is it defined?

Page 5: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Answer

At which level is it defined?

It is defined at the level of address ranges, that is, ranges of addresses that are all mapped by a given memory object.

Page 6: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

First question

Explain how Mach uses it to support both regular and lightweight processes.

Page 7: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Answer

Explain how Mach uses it to support both regular and lightweight processes.

Mach specifies the inheritance attribute of its data segment to beCOPY for regular UNIX processesSHARED for lightweight processes.

Page 8: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Second question

Consider an ARC cache with a total capacity of 1024 pages and assume that size(T1) = target_T1 = 200 pages.

How these two parameters would be affected if: A page already present in T1 is referenced a

second time? New size(T1) = ___ New target_T1 = ___

Page 9: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Answer

Consider an ARC cache with a total capacity of 1024 pages and assume that size(T1) = target_T1 = 200 pages.

How these two parameters would be affected if: A page already present in T1 is referenced a

second time? New size(T1) = 199 New target_T1 = 200

Page 10: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Second question

Consider an ARC cache with a total capacity of 1024 pages and assume that size(T1) = target_T1 = 200 pages.

How these two parameters would be affected if: A page that has never been accessed before is

brought into the cache? New size(T1) = ____ New target_T1 = ____

Page 11: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Answer

Consider an ARC cache with a total capacity of 1024 pages and assume that size(T1) = target_T1 = 200 pages.

How these two parameters would be affected if: A page that has never been accessed

before is brought into the cache? New size(T1) = 200 New target_T1 = 200

Page 12: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Third question

What must happen before Proof Carrying Code becomes widely used?

Page 13: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Answer

What must happen before Proof Carrying Code becomes widely used?

We must find a cost-effective way to construct safety proofs for non-trivial extensions.

Page 14: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Fourth question

What problem do Corey kernel coresaddress?

Page 15: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Answer

What problem do Corey kernel coresaddress?

In most OSes, system calls are executed on the core of the invoking process Bad idea if the system call needs to

access large shared data structures

Page 16: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Fourth question

How do they solve that problem?

Page 17: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Answer

How do they solve that problem?

Kernel cores let applications dedicate cores to run specific kernel functions Avoids inter-core contention over the data

these functions access

Page 18: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Fifth question

What are the two ways a malicious extension could defeat Nooks?

Page 19: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Answer

What are the two ways a malicious extension could defeat Nooks?

A malicious extension could switch back to the kernel’s page table, which would give full access to the whole kernel address space

It could also misuse DMA

Page 20: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Sixth question

Consider a virtual memory system with 4 KB pages 8 GB of RAM A TLB with 512 entries.

What would be the TLB coverage of this architecture?

Page 21: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Answer

Consider a virtual memory system with 4 KB pages 8 GB of RAM A TLB with 512 entries.

What would be the TLB coverage of this architecture?

512×4KB = 2 MB

Page 22: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Sixth question

Consider a virtual memory system with 4 KB pages 8 GB of RAM A TLB with 512 entries.

Assume now we add to this TLB eightadditional entries that can only map 1MB superpages, what would be the coverage of the new TLB?

Page 23: SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC cache with a total capacity of 1024 pages and assume that ... A page that has never

Answer

Consider a virtual memory system with 4 KB pages 8 GB of RAM A TLB with 512 entries.

Assume now we add to this TLB eightadditional entries that can only map 1MB superpages, what would be the coverage of the new TLB? 512×4KB + 8×1MB= 10 MB