SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC...
Transcript of SOLUTIONS TO THE SECOND 6360 QUIZ - Computer …paris/6360/EXAMS/Quiz2-f16.pdf · Consider an ARC...
![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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/1.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/2.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/3.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/4.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/5.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/6.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/7.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/8.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/9.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/10.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/11.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/12.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/13.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/14.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/15.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/16.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/17.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/18.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/19.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/20.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/21.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/22.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052516/5ae8c0e77f8b9ae15790dd3c/html5/thumbnails/23.jpg)
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