Add a test for P1 that checks that multiple threads can properly wake
[pintos-anon] / TODO
1 -*- text -*-
2
3 Godmar says:
4
5 - In Project 2, we're missing tests that pass arguments to system calls
6 that span multiple pages, where some are mapped and some are not. 
7 An implementation that only checks the first page, rather than all pages 
8 that can be touched during a call to read()/write() passes all tests.
9
10 - In Project 2, we're missing a test that would fail if they assumed
11 that contiguous user-virtual addresses are laid out contiguously 
12 in memory.  The loading code should ensure that non-contiguous 
13 physical pages are allocated for the data segment (at least.)
14
15 - Need some tests that test that illegal accesses lead to process
16 termination. I have written some, will add them. In P2, obviously, 
17 this would require that the students break this functionality since 
18 the page directory is initialized for them, still it would be good 
19 to have.
20
21 - There does not appear to be a test that checks that they close all
22 fd's on exit.  Idea: add statistics & self-diagnostics code to palloc.c
23 and malloc.c.  Self-diagnostics code could be used for debugging.
24 The statistics code would report how much kernel memory is free.
25 Add a system call "get_kernel_memory_information".  User programs
26 could engage in a variety of activities and notice leaks by checking
27 the kernel memory statistics.
28
29 From: "Godmar Back" <godmar@gmail.com>
30
31 For reasons I don't currently understand, some of our students seem
32 hesitant to include each thread in a second "all-threads" list and are
33 looking for ways to implement the advanced scheduler without one.
34
35 Currently, I believe, all tests for the mlfqs are such that all
36 threads are either ready or sleeping in timer_sleep(). This allows for
37 an incorrect implementation in which recent-cpu and priorities are
38 updated only for those threads that are on the alarm list or the ready
39 list.
40
41 The todo item would be a test where a thread is blocked on a
42 semaphore, lock or condition variable and have its recent_cpu decay to
43 zero, and check that it's scheduled right after the unlock/up/signal.
44
45 From: "Godmar Back" <godmar@gmail.com>
46 Subject: set_priority & donation - a TODO item
47 To: "Ben Pfaff" <blp@cs.stanford.edu>
48 Date: Mon, 20 Feb 2006 22:20:26 -0500
49
50 Ben,
51
52 it seems that there are currently no tests that check the proper
53 behavior of thread_set_priority() when called by a thread that is
54 running under priority donation.  The proper behavior, I assume, is to
55 temporarily drop the donation if the set priority is higher, and to
56 reassume the donation should the thread subsequently set its own
57 priority again to a level that's lower than a still active donation.
58
59  - Godmar
60
61 From: Godmar Back <godmar@gmail.com>
62 Subject: project 4 question/comment regarding caching inode data
63 To: Ben Pfaff <blp@cs.stanford.edu>
64 Date: Sat, 14 Jan 2006 15:59:33 -0500
65
66 Ben,
67
68 in section 6.3.3 in the P4 FAQ, you write:
69
70 "You can store a pointer to inode data in struct inode, if you want,"
71
72 Should you point out that if they indeed do that, they likely wouldn't
73 be able to support more than 64 open inodes systemwide at any given
74 point in time.
75
76 (This seems like a rather strong limitation; do your current tests
77 open more than 64 files?
78 It would also point to an obvious way to make the projects harder by
79 specifically disallowing that inode data be locked in memory during
80 the entire time an inode is kept open.)
81
82  - Godmar
83
84 From: Godmar Back <godmar@gmail.com>
85 Subject: on caching in project 4
86 To: Ben Pfaff <blp@cs.stanford.edu>
87 Date: Mon, 9 Jan 2006 20:58:01 -0500
88
89 here's an idea for future semesters.
90
91 I'm in the middle of project 4, I've started by implementing a buffer
92 cache and plugging it into the existing filesystem.  Along the way I
93 was wondering how we could test the cache.
94
95 Maybe one could adopt a similar testing strategy as in project 1 for
96 the MLQFS scheduler: add a function that reads "get_cache_accesses()"
97 and a function "get_cache_hits()".  Then create a version of pintos
98 that creates access traces for a to-be-determined workload.  Run an
99 off-line analysis that would determine how many hits a perfect cache
100 would have (MAX), and how much say an LRU strategy would give (MIN).
101 Then add a fudge factor to account for different index strategies and
102 test that the reported number of cache hits/accesses is within (MIN,
103 MAX) +/- fudge factor.
104
105 (As an aside - I am curious why you chose to use a clock-style
106 algorithm rather than the more straightforward LRU for your buffer
107 cache implementation in your sample solution. Is there a reason for
108 that?  I was curious to see if it made a difference, so I implemented
109 LRU for your cache implementation and ran the test workload of project
110 4 and printed cache hits/accesses.
111 I found that for that workload, the clock-based algorithm performs
112 almost identical to LRU (within about 1%, but I ran nondeterministally
113 with QEMU). I then reduced the cache size to 32 blocks and found again
114 the same performance, which raises the suspicion that the test
115 workload might not force any cache replacement, so the eviction
116 strategy doesn't matter.)
117
118 Godmar Back <godmar@gmail.com> writes:
119
120 > in your sample solution to P4, dir_reopen does not take any locks when
121 > changing a directory's open_cnt. This looks like a race condition to
122 > me, considering that dir_reopen is called from execute_process without
123 > any filesystem locks held.
124
125 * Get rid of rox--causes more trouble than it's worth
126
127 * Reconsider command line arg style--confuses everyone.
128
129 * Finish writing tour.
130
131 via Godmar Back:
132
133 * Get rid of mmap syscall, add sbrk.
134
135 * page-linear, page-shuffle VM tests do not use enough memory to force
136   eviction.  Should increase memory consumption.
137
138 * Add FS persistence test(s).
139
140 * process_death test needs improvement
141
142 * Internal tests.
143
144 * Improve automatic interpretation of exception messages.
145
146 * Userprog project:
147
148   - Mark read-only pages as actually read-only in the page table.  Or,
149     since this was consistently rated as the easiest project by the
150     students, require them to do it.
151
152   - Don't provide per-process pagedir implementation but only
153     single-process implementation and require students to implement
154     the separation?  This project was rated as the easiest after all.
155     Alternately we could just remove the synchronization on pid
156     selection and check that students fix it.
157
158 * Filesys project:
159
160   - Need a better way to measure performance improvement of buffer
161     cache.  Some students reported that their system was slower with
162     cache--likely, Bochs doesn't simulate a disk with a realistic
163     speed.
164
165 * Documentation:
166
167   - Add "Digging Deeper" sections that describe the nitty-gritty x86
168     details for the benefit of those interested.
169
170   - Add explanations of what "real" OSes do to give students some
171     perspective.
172
173 * Assignments:
174
175   - Add extra credit:
176
177     . Low-level x86 stuff, like paged page tables.
178
179     . Specifics on how to implement sbrk, malloc.
180
181     . Other good ideas.
182
183     . opendir/readdir/closedir
184
185     . everything needed for getcwd()
186
187 To add partition support:
188
189 - Find four partition types that are more or less unused and choose to
190   use them for Pintos.  (This is implemented.)
191
192 - Bootloader reads partition tables of all BIOS devices to find the
193   first that has the "Pintos kernel" partition type.  (This is
194   implemented.)  Ideally the bootloader would make sure there is
195   exactly one such partition, but I didn't implement that yet.
196
197 - Bootloader reads kernel into memory at 1 MB using BIOS calls.  (This
198   is implemented.)
199
200 - Kernel arguments have to go into a separate sector because the
201   bootloader is otherwise too big to fit now?  (I don't recall if I
202   did anything about this.)
203
204 - Kernel at boot also scans partition tables of all the disks it can
205   find to find the ones with the four Pintos partition types (perhaps
206   not all exist).  After that, it makes them available to the rest of
207   the kernel (and doesn't allow access to other devices, for safety).
208
209 - "pintos" and "pintos-mkdisk" need to write a partition table to the
210   disks that they create.  "pintos-mkdisk" will need to take a new
211   parameter specifying the type.  (I might have partially implemented
212   this, don't remember.)
213
214 - "pintos" should insist on finding a partition header on disks handed
215   to it, for safety.
216
217 - Need some way for "pintos" to assemble multiple disks or partitions
218   into a single image that can be copied directly to a USB block
219   device.  (I don't know whether I came up with a good solution yet or
220   not, or whether I implemented any of it.)
221
222 To add USB support:
223
224 - Needs to be able to scan PCI bus for UHCI controller.  (I
225   implemented this partially.)
226
227 - May want to be able to initialize USB controllers over CardBus
228   bridges.  I don't know whether this requires additional work or if
229   it's useful enough to warrant extra work.  (It's of special interest
230   for me because I have a laptop that only has USB via CardBus.)
231
232 - There are many protocol layers involved: SCSI over USB-Mass Storage
233   over USB over UHCI over PCI.  (I may be forgetting one.)  I don't
234   know yet whether it's best to separate the layers or to merge (some
235   of) them.  I think that a simple and clean organization should be a
236   priority.
237
238 - VMware can likely be used for testing because it can expose host USB
239   devices as guest USB devices.  This is safer and more convenient
240   than using real hardware for testing.
241
242 - Should test with a variety of USB keychain devices because there
243   seems to be wide variation among them, especially in the SCSI
244   protocols they support.  Should try to use a "lowest-common
245   denominator" SCSI protocol if any such thing really exists.
246
247 - Might want to add a feature whereby kernel arguments can be given
248   interactively, rather than passed on-disk.  Needs some though.