I couldn't find any reproducibility problems with Bochs 2.2.6.
[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 ---
30
31 From: "Godmar Back" <godmar@gmail.com>
32 Subject: priority donation tests
33 To: "Ben Pfaff" <blp@cs.stanford.edu>
34 Date: Fri, 3 Mar 2006 11:02:08 -0500
35
36 Ben,
37
38 it seems the priority donation tests are somewhat incomplete and allow
39 incorrect implementations to pass with a perfect score.
40
41 We are seeing the following wrong implementations pass all tests:
42
43 - Implementations that assume locks are released in the opposite order
44 in which they're acquired. The students implement this by
45 popping/pushing on the donation list.
46
47 - Implementations that assume that the priority of a thread waiting on
48 a semaphore or condition variable cannot change between when the
49 thread was blocked and when it is unblocked. The students implement
50 this by doing an insert into an ordered list on block, rather than
51 picking the maximum thread on unblock.
52
53 Neither of these two cases is detected; do you currently check for
54 these mistakes manually?
55
56 I wrote a test that checks for the first case; it is here:
57 http://people.cs.vt.edu/~gback/pintos/priority-donate-multiple-2.patch
58
59 [...]
60
61 I also wrote a test case for the second scenario:
62 http://people.cs.vt.edu/~gback/pintos/priority-donate-sema.c
63 http://people.cs.vt.edu/~gback/pintos/priority-donate-sema.ck
64
65 I put the other tests up here:
66 http://people.cs.vt.edu/~gback/pintos/priority-donate-multiple2.c
67 http://people.cs.vt.edu/~gback/pintos/priority-donate-multiple2.ck
68
69 From: "Godmar Back" <godmar@gmail.com>
70 Subject: multiple threads waking up at same clock tick
71 To: "Ben Pfaff" <blp@cs.stanford.edu>
72 Date: Wed, 1 Mar 2006 08:14:47 -0500
73
74 Greg Benson points out another potential TODO item for P1.
75
76 ----
77 One thing I recall:
78
79 The alarm tests do not test to see if multiple threads are woken up if
80 their timers have expired.  That is, students can write a solution
81 that just wakes up the first thread on the sleep queue rather than
82 check for additional threads.  Of course, the next thread will be
83 woken up on the next tick.  Also, this might be hard to test.
84
85 ---
86 Way to test this: (from Godmar Back)
87
88 Thread A with high priority spins until 'ticks' changes, then calls to
89 timer_sleep(X), Thread B with lower priority is then resumed, calls
90 set_priority to make its priority equal to that of thread A, then
91 calls timer_sleep(X), all of that before the next clock interrupt
92 arrives.
93
94 On wakeup, each thread records wake-up time and calls yield
95 immediately, forcing the scheduler to switch to the other
96 equal-priority thread. Both wake-up times must be the same (and match
97 the planned wake-up time.)
98
99 PS:
100 I actually tested it and it's hard to pass with the current ips setting.
101 The bounds on how quickly a thread would need to be able to return after
102 sleep appear too tight.  Need another idea.
103
104 From: "Godmar Back" <godmar@gmail.com>
105
106 For reasons I don't currently understand, some of our students seem
107 hesitant to include each thread in a second "all-threads" list and are
108 looking for ways to implement the advanced scheduler without one.
109
110 Currently, I believe, all tests for the mlfqs are such that all
111 threads are either ready or sleeping in timer_sleep(). This allows for
112 an incorrect implementation in which recent-cpu and priorities are
113 updated only for those threads that are on the alarm list or the ready
114 list.
115
116 The todo item would be a test where a thread is blocked on a
117 semaphore, lock or condition variable and have its recent_cpu decay to
118 zero, and check that it's scheduled right after the unlock/up/signal.
119
120 From: "Godmar Back" <godmar@gmail.com>
121 Subject: set_priority & donation - a TODO item
122 To: "Ben Pfaff" <blp@cs.stanford.edu>
123 Date: Mon, 20 Feb 2006 22:20:26 -0500
124
125 Ben,
126
127 it seems that there are currently no tests that check the proper
128 behavior of thread_set_priority() when called by a thread that is
129 running under priority donation.  The proper behavior, I assume, is to
130 temporarily drop the donation if the set priority is higher, and to
131 reassume the donation should the thread subsequently set its own
132 priority again to a level that's lower than a still active donation.
133
134  - Godmar
135
136 From: Godmar Back <godmar@gmail.com>
137 Subject: project 4 question/comment regarding caching inode data
138 To: Ben Pfaff <blp@cs.stanford.edu>
139 Date: Sat, 14 Jan 2006 15:59:33 -0500
140
141 Ben,
142
143 in section 6.3.3 in the P4 FAQ, you write:
144
145 "You can store a pointer to inode data in struct inode, if you want,"
146
147 Should you point out that if they indeed do that, they likely wouldn't
148 be able to support more than 64 open inodes systemwide at any given
149 point in time.
150
151 (This seems like a rather strong limitation; do your current tests
152 open more than 64 files?
153 It would also point to an obvious way to make the projects harder by
154 specifically disallowing that inode data be locked in memory during
155 the entire time an inode is kept open.)
156
157  - Godmar
158
159 From: Godmar Back <godmar@gmail.com>
160 Subject: on caching in project 4
161 To: Ben Pfaff <blp@cs.stanford.edu>
162 Date: Mon, 9 Jan 2006 20:58:01 -0500
163
164 here's an idea for future semesters.
165
166 I'm in the middle of project 4, I've started by implementing a buffer
167 cache and plugging it into the existing filesystem.  Along the way I
168 was wondering how we could test the cache.
169
170 Maybe one could adopt a similar testing strategy as in project 1 for
171 the MLQFS scheduler: add a function that reads "get_cache_accesses()"
172 and a function "get_cache_hits()".  Then create a version of pintos
173 that creates access traces for a to-be-determined workload.  Run an
174 off-line analysis that would determine how many hits a perfect cache
175 would have (MAX), and how much say an LRU strategy would give (MIN).
176 Then add a fudge factor to account for different index strategies and
177 test that the reported number of cache hits/accesses is within (MIN,
178 MAX) +/- fudge factor.
179
180 (As an aside - I am curious why you chose to use a clock-style
181 algorithm rather than the more straightforward LRU for your buffer
182 cache implementation in your sample solution. Is there a reason for
183 that?  I was curious to see if it made a difference, so I implemented
184 LRU for your cache implementation and ran the test workload of project
185 4 and printed cache hits/accesses.
186 I found that for that workload, the clock-based algorithm performs
187 almost identical to LRU (within about 1%, but I ran nondeterministally
188 with QEMU). I then reduced the cache size to 32 blocks and found again
189 the same performance, which raises the suspicion that the test
190 workload might not force any cache replacement, so the eviction
191 strategy doesn't matter.)
192
193 Godmar Back <godmar@gmail.com> writes:
194
195 > in your sample solution to P4, dir_reopen does not take any locks when
196 > changing a directory's open_cnt. This looks like a race condition to
197 > me, considering that dir_reopen is called from execute_process without
198 > any filesystem locks held.
199
200 * Get rid of rox--causes more trouble than it's worth
201
202 * Reconsider command line arg style--confuses everyone.
203
204 * Finish writing tour.
205
206 * Introduce a "yield" system call to speed up the syn-* tests.
207
208 via Godmar Back:
209
210 * Get rid of mmap syscall, add sbrk.
211
212 * Make backtrace program accept multiple object file arguments,
213   e.g. add -u option to allow backtracing user program also.
214
215 * page-linear, page-shuffle VM tests do not use enough memory to force
216   eviction.  Should increase memory consumption.
217
218 * Add FS persistence test(s).
219
220 * process_death test needs improvement
221
222 * Internal tests.
223
224 * Improve automatic interpretation of exception messages.
225
226 * Userprog project:
227
228   - Mark read-only pages as actually read-only in the page table.  Or,
229     since this was consistently rated as the easiest project by the
230     students, require them to do it.
231
232   - Don't provide per-process pagedir implementation but only
233     single-process implementation and require students to implement
234     the separation?  This project was rated as the easiest after all.
235     Alternately we could just remove the synchronization on pid
236     selection and check that students fix it.
237
238 * Filesys project:
239
240   - Need a better way to measure performance improvement of buffer
241     cache.  Some students reported that their system was slower with
242     cache--likely, Bochs doesn't simulate a disk with a realistic
243     speed.
244
245 * Documentation:
246
247   - Add "Digging Deeper" sections that describe the nitty-gritty x86
248     details for the benefit of those interested.
249
250   - Add explanations of what "real" OSes do to give students some
251     perspective.
252
253 * Assignments:
254
255   - Add extra credit:
256
257     . Low-level x86 stuff, like paged page tables.
258
259     . Specifics on how to implement sbrk, malloc.
260
261     . Other good ideas.
262
263     . opendir/readdir/closedir
264
265     . everything needed for getcwd()
266
267 To add partition support:
268
269 - Find four partition types that are more or less unused and choose to
270   use them for Pintos.  (This is implemented.)
271
272 - Bootloader reads partition tables of all BIOS devices to find the
273   first that has the "Pintos kernel" partition type.  (This is
274   implemented.)  Ideally the bootloader would make sure there is
275   exactly one such partition, but I didn't implement that yet.
276
277 - Bootloader reads kernel into memory at 1 MB using BIOS calls.  (This
278   is implemented.)
279
280 - Kernel arguments have to go into a separate sector because the
281   bootloader is otherwise too big to fit now?  (I don't recall if I
282   did anything about this.)
283
284 - Kernel at boot also scans partition tables of all the disks it can
285   find to find the ones with the four Pintos partition types (perhaps
286   not all exist).  After that, it makes them available to the rest of
287   the kernel (and doesn't allow access to other devices, for safety).
288
289 - "pintos" and "pintos-mkdisk" need to write a partition table to the
290   disks that they create.  "pintos-mkdisk" will need to take a new
291   parameter specifying the type.  (I might have partially implemented
292   this, don't remember.)
293
294 - "pintos" should insist on finding a partition header on disks handed
295   to it, for safety.
296
297 - Need some way for "pintos" to assemble multiple disks or partitions
298   into a single image that can be copied directly to a USB block
299   device.  (I don't know whether I came up with a good solution yet or
300   not, or whether I implemented any of it.)
301
302 To add USB support:
303
304 - Needs to be able to scan PCI bus for UHCI controller.  (I
305   implemented this partially.)
306
307 - May want to be able to initialize USB controllers over CardBus
308   bridges.  I don't know whether this requires additional work or if
309   it's useful enough to warrant extra work.  (It's of special interest
310   for me because I have a laptop that only has USB via CardBus.)
311
312 - There are many protocol layers involved: SCSI over USB-Mass Storage
313   over USB over UHCI over PCI.  (I may be forgetting one.)  I don't
314   know yet whether it's best to separate the layers or to merge (some
315   of) them.  I think that a simple and clean organization should be a
316   priority.
317
318 - VMware can likely be used for testing because it can expose host USB
319   devices as guest USB devices.  This is safer and more convenient
320   than using real hardware for testing.
321
322 - Should test with a variety of USB keychain devices because there
323   seems to be wide variation among them, especially in the SCSI
324   protocols they support.  Should try to use a "lowest-common
325   denominator" SCSI protocol if any such thing really exists.
326
327 - Might want to add a feature whereby kernel arguments can be given
328   interactively, rather than passed on-disk.  Needs some though.