A2:
- The answer should describe code, not data; the data structures
- have already been explained in A1.
+ The answer generally boils down to traversing the data structure
+ from A1. The answer should describe code, not data; the data
+ structures have already been explained in A1.
A3:
easier to find all the pages that belong to a given process (for
cleanup when a process dies).
-Check the submitted code, by hand, for the following:
-
PAGING TO AND FROM DISK
=======================
Several possible answers:
- Pre-lock all the pages that the system call will access,
- then unlock them when the system call completes.
+ then unlock them when the system call completes. There must
+ be a discussion of how to avoid deadlock among processes
+ that, among them have all of the user pool locked, and want
+ more.
- Page fault in kernel.
- - Acquire a global lock needed to evict pages. (But there
- should be some additional explanation of how the system call
- makes sure that those pages are in main memory in the first
- place.)
+ - Acquire a global lock needed to evict pages. There should
+ be some additional explanation of how the system call makes
+ sure that those pages are in main memory in the first place.
B9:
to claim that the conditions for deadlock are "rare" or that the
window in which deadlock can occur is "short" are not acceptable.
In a proper design, deadlock is impossible, not just rare. Deduct
- points.
-
-Check the submitted code, by hand, for the following:
+ points. (This deduction is listed under B5 because similar claims
+ are common there.)
MEMORY MAPPED FILES
===================
For some reason, students sometimes talk about permanently
assigning or pre-reserving memory mapped files to swap slots or to
frames in physical memory here. That's incorrect. The assignment
- is explicit that mapping should be lazily loaded and written back
+ is explicit that mappings should be lazily loaded and written back
to their files, not to swap.
C3:
--- /dev/null
+HW3 DESIGN SUMMARY
+==================
+
+OVERALL
+
+ DOCUMENTATION
+ -20 Egregious violation of style versus design document example
+ -10 Numerous excessively long lines (> 79 characters)
+ -10 Numerous capitalization, punctuation, spelling, or grammar errors
+
+ DESIGN
+ -10 Failure to check return value of malloc()
+ -10 Use of ASSERT to check something that can actually fail, e.g. malloc()
+
+ CODING STYLE
+ -10 Inconsistent or bad coding style: no indentation, cramming
+ many statements into one line, other issues at TA's discretion
+ -10 Numerous very long source code lines (> 100 characters)
+ -10 Commented-out or #if'd out code makes real code hard to read
+ -10 Many missing comments on structure, structure members,
+ global or static variables, or function definitions
+ -10 Function(s) should be decomposed for clarity [indicate function]
+ -10 Cut-and-pasted code should be made into function [indicate where]
+ -10 Uninformative or deceptive identifiers
+
+ EXTRA CREDIT
+ +5 Sharing
+
+Subtotal: /10 (not capped)
+
+PROBLEM 1: PAGE TABLE MANAGEMENT
+
+ DOCUMENTATION
+ -25 Grossly inaccurate: documentation has no resemblance to code
+ -13 Important inaccuracies: documentation and code differ significantly
+ [indicate how]
+ -5 Minor inaccuracies: documentation and code differ [indicate how]
+ -5 A1: Missing entirely/missing comments or purpose/too long
+ -5 A2: Missing/non-responsive/too long/too short
+ -5 A3: Missing/non-responsive/too long/too short
+ -5 A3: Sharing implemented, but no explanation of how accessed
+ and dirty bits are coordinated
+ -5 A3: Sharing not implemented, but explanation states or implies
+ that a page can have multiple aliases
+ -5 A4: Missing/non-responsive/too long/too short
+ -5 A5: Missing/non-responsive/too long/too short
+
+ DESIGN
+ -30 Not implemented
+ -10 Page dirty status must be determined accurately, not approximately
+
+Subtotal: /25 (capped at 0)
+
+PROBLEM 2: PAGING TO AND FROM DISK
+
+ DOCUMENTATION
+ -45 Grossly inaccurate: documentation has no resemblance to code
+ -23 Important inaccuracies: documentation and code differ significantly
+ [indicate how]
+ -5 Minor inaccuracies: documentation and code differ [indicate how]
+ -5 B1: Missing entirely/missing comments or purpose/too long
+ -5 B2: Missing/non-responsive/too long/too short
+ -5 B3: Missing/non-responsive/too long/too short
+ -5 B4: Missing/non-responsive/too long/too short
+ -5 B4: Heuristic does not make sense
+ -2 B4: Claim that "struct intr_frame" is on user stack
+ -5 B5: Missing/non-responsive/too long/too short
+ -5 B5: Claim that deadlock is "rare" or has a "short" window
+ -5 B6: Missing/non-responsive/too long/too short
+ -3 B6: Didn't answer first part of question
+ -3 B6: Didn't answer second part of question
+ -3 B5: Disables interrupts
+ -5 B7: Missing/non-responsive/too long/too short
+ -5 B8: Missing/non-responsive/too long/too short
+ -3 B8: When pre-locking of pages is used, no discussion of
+ deadlock prevention
+ -3 B8: When global eviction lock is used, no discussion of
+ how pages are brought into main memory
+ -5 B9: Missing/non-responsive/too long/too short
+
+ DESIGN
+ -45 Not implemented
+ -5 Clock algorithm implementation literally uses a timer
+ -10 Clock algorithm implementation resets dirty bits
+ -5 Stack fault heuristic allows more than 32 bytes below stack pointer
+ -3 Stack limit is smaller than 1 MB
+
+Subtotal: /45 (capped at 0)
+
+PROBLEM 3: MEMORY-MAPPED FILES
+
+ DOCUMENTATION
+ -20 Grossly inaccurate: documentation has no resemblance to code
+ -10 Important inaccuracies: documentation and code differ significantly
+ [indicate how]
+ -5 Minor inaccuracies: documentation and code differ [indicate how]
+ -5 C1: Missing entirely/missing comments or purpose/too long
+ -5 C2: Missing/non-responsive/too long/too short
+ -5 C3: Missing/non-responsive/too long/too short
+ -2 C3: No mention of stack expansion
+ -2 C3: Claim that memory mappings in different processes can "overlap"
+ -5 C4: Missing/non-responsive/too long/too short
+
+ DESIGN
+ -20 Not implemented
+ -5 Pre-reserves or permanently assigning file pages to frames
+ -5 Pre-reserves or permanently assigning file pages to swap slots
+ -5 Global counter for mapid_t lacks synchronization
+ -5 Global table of file mappings lacks synchronization
+ -5 Global table allows multiple processes to access same file mapping
+ -5 Superfluous locking on per-thread data structure [which]
+
+Subtotal: /20 (capped at 0)