CS Final Exam. Stanford University Computer Science Department. June 5, 2012 !!!!! SKIP 15 POINTS WORTH OF QUESTIONS.!!!!!

Similar documents
Stanford University Computer Science Department CS 240 Sample Quiz 2 Questions Winter February 25, 2005

Stanford University Computer Science Department CS 240 Quiz 2 with Answers Spring May 24, total

Stanford University Computer Science Department CS 295 midterm. May 14, (45 points) (30 points) total

Stanford University Computer Science Department CS 240 Quiz 1 Spring May 6, total

CS 240 Final Exam. Stanford University Computer Science Department. June 2, 2015 !!!!! SKIP 20 POINTS WORTH OF QUESTIONS.!!!!!

Stanford University Computer Science Department CS 240 Sample Quiz 2 Answers Winter February 25, 2005

CS 240 Midterm. Stanford University Computer Science Department. April 28, 2016

Stanford University Computer Science Department CS 140 Midterm Exam Dawson Engler Winter 1999

CS140 Operating Systems and Systems Programming Final Exam

Stanford University Computer Science Department CS 140 Final Exam Dawson Engler Winter 1999

CS 140 Project 4 File Systems Review Session

CS140 Operating Systems and Systems Programming Final Exam

ò Very reliable, best-of-breed traditional file system design ò Much like the JOS file system you are building now

Midterm Exam Answers

Ext3/4 file systems. Don Porter CSE 506

CS140 Operating Systems and Systems Programming Final Exam

CS140 Operating Systems and Systems Programming

Final Examination CS 111, Fall 2016 UCLA. Name:

Name: Instructions. Problem 1 : Short answer. [48 points] CMU / Storage Systems 20 April 2011 Spring 2011 Exam 2

CS140 Operating Systems and Systems Programming Midterm Exam

CS140 Operating Systems and Systems Programming Final Exam

CS140 Operating Systems and Systems Programming Midterm Exam

2. PICTURE: Cut and paste from paper

(a) Which of these two conditions (high or low) is considered more serious? Justify your answer.

Total Score /15 /20 /30 /10 /5 /20 Grader

CS140 Operating Systems Final December 12, 2007 OPEN BOOK, OPEN NOTES

RCU. ò Walk through two system calls in some detail. ò Open and read. ò Too much code to cover all FS system calls. ò 3 Cases for a dentry:

VFS, Continued. Don Porter CSE 506

CS 140: Operating Systems and Systems Programming Midterm Exam

CS140 Operating Systems and Systems Programming Final Exam

PROJECT 6: PINTOS FILE SYSTEM. CS124 Operating Systems Winter , Lecture 25

CSE 303 Midterm Exam

Midterm Exam #2 Solutions April 20, 2016 CS162 Operating Systems

Midterm Exam #2 April 20, 2016 CS162 Operating Systems

Total Score /15 /20 /30 /10 /5 /20 Grader

Operating Systems CMPSC 473 File System Implementation April 10, Lecture 21 Instructor: Trent Jaeger

ò Server can crash or be disconnected ò Client can crash or be disconnected ò How to coordinate multiple clients accessing same file?

EECS 470 Midterm Exam Winter 2008 answers

NFS. Don Porter CSE 506

Midterm Exam #3 Solutions November 30, 2016 CS162 Operating Systems

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction

CSL373/CSL633 Major Exam Solutions Operating Systems Sem II, May 6, 2013 Answer all 8 questions Max. Marks: 56

CS 1301 Exam 1 Fall 2010

CS 167 Final Exam Solutions

Ackworth Howard Church of England (VC) Junior and Infant School. Child-friendly GDPR privacy notice

CS140 Operating Systems and Systems Programming

Problem Max Points Score Total 100

File Systems: Consistency Issues

This is an open book, open notes exam. But no online or in-class chatting.

CS143 Final Fall 2009

The Berkeley File System. The Original File System. Background. Why is the bandwidth low?

Integrating DMA Into the Generic Device Model

Chapter 6. File Systems

Name: 1. CS372H: Spring 2009 Final Exam

Midterm Exam Answers

CS-537: Midterm Exam (Fall 2008) Hard Questions, Simple Answers

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 21: Network Protocols (and 2 Phase Commit)

CS 155 Final Exam. CS 155: Spring 2005 June 2005

EECS 482 Midterm (Fall 1998)

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

The Art and Science of Memory Allocation

Announcements. P4: Graded Will resolve all Project grading issues this week P5: File Systems

ECE 598 Advanced Operating Systems Lecture 18

What is a file system

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

CS140 Operating Systems and Systems Programming Midterm Exam

CS414 Final Exam, Version 1 (December 2, 2004) 75 Minutes, closed book. Five questions, 20 points each

CS107 Handout 26 Spring 2007 May 9, 2007 CS107 Midterm Exam

Math for Liberal Studies

Example File Systems Using Replication CS 188 Distributed Systems February 10, 2015

File Systems: Recovery

Midterm Exam #2 April 29, 2003 CS162 Operating Systems

Final Exam April 14, 2007 COSC 3407: Operating Systems

Lecture 10: Crash Recovery, Logging

Consistency: Relaxed. SWE 622, Spring 2017 Distributed Software Engineering

CS5412 CLOUD COMPUTING: PRELIM EXAM Open book, open notes. 90 minutes plus 45 minutes grace period, hence 2h 15m maximum working time.

Midterm #2 Exam Solutions April 26, 2006 CS162 Operating Systems

CS 550 Operating Systems Spring File System

CS 155 Final Exam. CS 155: Spring 2004 June 2004

Midterm Exam Solutions March 7, 2001 CS162 Operating Systems

Midterm. You have two and a half hours to complete this exam (but you shouldn t need it).

CS-537: Midterm Exam (Fall 2013) Professor McFlub

Heap Arrays and Linked Lists. Steven R. Bagley

Network File Systems

Part II Composition of Functions

File System Performance (and Abstractions) Kevin Webb Swarthmore College April 5, 2018

Chapter 11: Implementing File Systems

Lesson 9 Transcript: Backup and Recovery

My malloc: mylloc and mhysa. Johan Montelius HT2016

CS 318 Principles of Operating Systems

CS 1301 Exam 1 Fall 2010

NFS: Naming indirection, abstraction. Abstraction, abstraction, abstraction! Network File Systems: Naming, cache control, consistency

Request for Comments: 913 September 1984

CS 4349 Lecture October 18th, 2017

CS244 Advanced Topics in Computer Networks Midterm Exam Monday, May 2, 2016 OPEN BOOK, OPEN NOTES, INTERNET OFF

Final Exam Solutions May 11, 2012 CS162 Operating Systems

CS 318 Principles of Operating Systems

CMU Storage Systems 20 Feb 2004 Fall 2005 Exam 1. Name: SOLUTIONS

Each time a file is opened, assign it one of several access patterns, and use that pattern to derive a buffer management policy.

Transcription:

CS 240 - Final Exam Stanford University Computer Science Department June 5, 2012!!!!! SKIP 15 POINTS WORTH OF QUESTIONS.!!!!! This is an open-book (but closed-laptop) exam. You have 75 minutes. Cross out the questions you skip. Write all of your answers directly on the paper. Make your answers as concise as possible. Sentence fragments ok. NOTE: We will take off points if a correct answer also includes incorrect or irrelevant information. (I.e., don t put in everything you know in hopes of saying the correct buzzword.) Question 1-4 (30 points) 5-7 (25 points) 8-11 (35 points) Total (max 75 points): Score Stanford University Honor Code In Accordance with both the letter and the spirit of the Honor Code, I did not cheat on this exam, nor will I assist someone else cheating. Name and Stanford ID number: SCPD? (Yes / No) Signature: 1

1. (10 points) You write a file system for a storage device that guarantees bytes are written atomically (i.e., if a crash occurs during a storage write the written byte either has the old value or the new) rather than traditional sector atomicity (where the written sector has either the old or new value). For a non-journaling Unix file system: how do you ensure that meta data (inodes, directory entries) are consistent? For a journaling FS: how would you do this? (Don t forget the journal!) Does your job get simpler? 2

2. (5 points) Consider the following pseudocode: write to file and sync(); display message to user(); write to file and sync(); display message to user();... write to file and sync(); display message to user(); Would you expect this program to achieve a significant speedup when run on xsyncfs? Why or why not? 3

3. (5 points) X and NOTX are arguing in the hallway about adding journaling to NFS. X claims this will help performance and points to a graph from a cs240 paper to justify this claim. NOTX says journaling will just add complexity and not help since you have to write everything to disk anyway. What graph is X talking about? (Hint: not in the NFS paper.) Who is more correct? 4

4. (10 points) Some kid in the hall tells you the key to happiness in NFS is to store the NFS data on a Venti server and to add the Venti hash of the entire file to the file handle (which now comprises the inode number, the generation number, and the venti hash). Explain how to modify the NFS protocol so that: (1) writes by a single process work, (2) concurrent writes by two processes do something sensible and (3) when you close a file, the contents are exactly what you wrote or that of a later writer, not a mix of the two (so: close-to-open consistency where close does an atomic flush of a client s modified data). Note: don t use leases or other cache coherence gimmicks. 5

5. (10 points) Venti left a lot of cycles on the table. Describe a way to increase Venti s performance by: (a) Keeping extra state on the client. (b) Keeping extra state on the server. (c) Exploiting the fact that you can verify the contents of a Venti block. 6

6. (10 points) Modify the map and reduce code in the paper to implement (1) grep and (2) sort. You don t have to put in every brace, but if the code in the appendix gives a function to use you should use it. 7

7. (5 points) Haystack writes some data synchronously and some data asynchronously. Give the intuition for why either choice is made and the general approach it uses to guarantee correctness for asynchronous writes. 8

8. (10 points) Your cs140 partner wants to sell a FB-B-Gon service that will use denial-ofservice attacks to prevent access to embarrassing photos posted to facebook. His plan is to request the photo, determine the machine storing the photo from the URL returned by the haystack directory, and then attack this machine by generating lots of requests for fake pictures to it, which he claims will result in disk access per request. Will this approach work? (Always, sometimes, not really.) Please give your reasoning. 9

9. (5 points) We ve discussed some of the features of the x86 that make virtualization difficult. What are some that *help* virtualization? (Don t include recent features like Intel VT or AMD-V that were *designed* to enable virtualization. If you don t know what VT or AMD-V mean, don t worry about it.) 10

10. (10 points) You know the future. Concisely describe three optimizations you could do (and how) that would clearly give performance wins for papers from this quarter other than predicting which cache entry to evict. 11

11. (10 points) (a) Some code doesn t care about checking for malloc failures. A routine foo checks the result of malloc against null and then calls another routine bar which does not. What belief-argument can you make about flagging an error? (b) A routine foo calls a routine bar(p) that dereferences p. What belief propagates to foo? It also calls baz(q) which checks q against null. What belief propagates to foo? (For your answers, state why or why not a belief is propagated.) (c) Give three examples of code (not from the paper!) that imply either MAY or MUST beliefs. Explain how to find an error using one or more of these beliefs. 12

13