+---------------------------+ | CS 439 | | PROJECT 3: VIRTUAL MEMORY | | DESIGN DOCUMENT | +---------------------------+ The questions in this design document should reflect the design of the code you wrote for the project. Your grade will reflect both the quality of your answer in this document and the quality of the design implementation in your code. You may receive partial credit for answering questions for parts of the project that you did not get to implement, but you must indicate in your answer that there is no corresponding implementation, or you will not receive any credit. For each question, you should include both the name of the file(s), function name(s), and the line numbers where the relevant code may be found. These design documents will be completed and submitted as a group. Please use this document as a guide for design and discuss the questions and their potential answers prior to beginning implementation. When you have completed your design document, submit it to the Canvas assignment Project 3 Design and Documentation. ***Your submission must be a text file and each line must not extend past 80 characters. In addition, your submission must contain all of the original material and not exceed 18,000 characters. The character count will be measured using the Linux command wc. (Note that rtf files are NOT text files.) ---- Team Information ---- >> Fill your names, UT EIDs, CS logins, email addresses, and unique numbers: Name: EID: CS login: Email: Unique Number: Name: EID: CS login: Email: Unique Number: Name: EID: CS login: Email: Unique Number: Name: EID: CS login: Email: Unique Number: Slip days used on this project: ---- PRELIMINARIES ---- >> If you have any preliminary comments on your submission or notes for the >> TAs, please give them here. >> Please cite any offline or online sources you consulted while >> preparing your submission, other than the Pintos documentation, course >> text, lecture notes, and course staff. PAGE TABLE MANAGEMENT ===================== ---- DATA STRUCTURES ---- >> A1: Copy here the declaration of each new or changed `struct' or >> `struct' member, global or static variable, `typedef', ‘#define’, or >> enumeration that was necessary for your page table implementation. >> (Your frame table information should go in B1.) >> Identify the purpose of each in 25 words or less. ---- ALGORITHMS ---- >> A2: Describe your code for locating the necessary data when a >> process page faults in the code segment. >> A3: How does your code coordinate accessed and dirty bits between >> kernel and user virtual addresses that are aliases for the same >> frame, or alternatively how do you avoid the issue? ---- SYNCHRONIZATION ---- >> A4: When two user processes both need a new frame at the same time, >> how are races avoided? ---- RATIONALE ---- >> A5: Why did you choose the data structure(s) that you did for >> storing any supplemental page information? Please compare to >> an alternative data structure that is also a reasonable option. PAGING TO AND FROM DISK ======================= ---- DATA STRUCTURES ---- >> B1: Copy here the declaration of each new or changed `struct' or >> `struct' member, global or static variable, `typedef', ‘#define’, or >> enumeration that was necessary for your frame and swap implementations. >> Identify the purpose of each in 25 words or less. >> Please do not include any declarations you included in A1. ---- ALGORITHMS ---- >> B2: When a frame is required but none are free, some frame must be >> evicted. Describe your algorithm for choosing a frame to evict. >> B3: When a process P obtains a frame that was previously used by a >> process Q, how do you adjust the page table (and any other data >> structures) to reflect that Q no longer has the frame? >> B4: Explain your heuristic for deciding whether or not page fault >> for an invalid virtual address should cause the stack to be extended. ---- SYNCHRONIZATION ---- >> B5: Explain the basics of how you managed synchronization in your VM >> design. In particular, explain how it prevents deadlock. >> B6: A page fault in process P can cause another process Q's frame >> to be evicted. How do you ensure that Q cannot access or modify >> the page during the eviction process? How do you avoid a race >> between P evicting Q's frame and Q faulting the page back in? >> B7: Suppose a page fault in process P causes a page to be read from >> the filesystem or swap. How do you ensure that a second process Q >> cannot interfere by, for example, attempting to evict the frame while it is >> still being read in? >> B8: Explain how you handle access to paged-out pages that occur >> during system calls. Do you use page faults to bring in pages (as >> in user programs), or do you have a mechanism for "locking" frames >> into physical memory, or do you use some other design? If your method >> could result in potential deadlock, how do you prevent it? ---- RATIONALE ---- >> B9: A single lock for the whole VM system would make >> synchronization easy but limit parallelism. On the other hand, >> using many locks complicates synchronization and raises the >> possibility for deadlock but allows for high parallelism. Explain >> where your design falls along this continuum and why you chose to >> design it this way. SURVEY QUESTIONS ================ Answering these questions is optional, but it will help us improve the course in future quarters. Feel free to tell us anything you want--these questions are just to spur your thoughts. You may also choose to respond anonymously in the course evaluations at the end of the semester. >> In your opinion, was this assignment, or any one of the problems >> in it, too easy or too hard? Did it take too long or too little time? >> Did you find that working on a particular part of the assignment gave >> you greater insight into some aspect of OS design? >> Is there some particular fact or hint we should give students in >> future quarters to help them solve the problems? Conversely, did you >> find any of our guidance to be misleading? >> Do you have any suggestions for the TAs to more effectively assist >> students, either for future quarters or the remaining projects? >> Any other comments?