Remove fixed item.
[pintos-anon] / TODO
1 -*- text -*-
2
3 * Bochs is not fully reproducible.
4
5 Godmar says:
6
7 - In Project 2, we're missing tests that pass arguments to system calls
8 that span multiple pages, where some are mapped and some are not. 
9 An implementation that only checks the first page, rather than all pages 
10 that can be touched during a call to read()/write() passes all tests.
11
12 - In Project 2, we're missing a test that would fail if they assumed
13 that contiguous user-virtual addresses are laid out contiguously 
14 in memory.  The loading code should ensure that non-contiguous 
15 physical pages are allocated for the data segment (at least.)
16
17 - Need some tests that test that illegal accesses lead to process
18 termination. I have written some, will add them. In P2, obviously, 
19 this would require that the students break this functionality since 
20 the page directory is initialized for them, still it would be good 
21 to have.
22
23 - There does not appear to be a test that checks that they close all
24 fd's on exit.  Idea: add statistics & self-diagnostics code to palloc.c
25 and malloc.c.  Self-diagnostics code could be used for debugging.
26 The statistics code would report how much kernel memory is free.
27 Add a system call "get_kernel_memory_information".  User programs
28 could engage in a variety of activities and notice leaks by checking
29 the kernel memory statistics.
30
31 ---
32
33 From: "Godmar Back" <godmar@gmail.com>
34 Subject: priority donation tests
35 To: "Ben Pfaff" <blp@cs.stanford.edu>
36 Date: Fri, 3 Mar 2006 11:02:08 -0500
37
38 Ben,
39
40 it seems the priority donation tests are somewhat incomplete and allow
41 incorrect implementations to pass with a perfect score.
42
43 We are seeing the following wrong implementations pass all tests:
44
45 - Implementations that assume locks are released in the opposite order
46 in which they're acquired. The students implement this by
47 popping/pushing on the donation list.
48
49 - Implementations that assume that the priority of a thread waiting on
50 a semaphore or condition variable cannot change between when the
51 thread was blocked and when it is unblocked. The students implement
52 this by doing an insert into an ordered list on block, rather than
53 picking the maximum thread on unblock.
54
55 Neither of these two cases is detected; do you currently check for
56 these mistakes manually?
57
58 I wrote a test that checks for the first case; it is here:
59 http://people.cs.vt.edu/~gback/pintos/priority-donate-multiple-2.patch
60
61 [...]
62
63 I also wrote a test case for the second scenario:
64 http://people.cs.vt.edu/~gback/pintos/priority-donate-sema.c
65 http://people.cs.vt.edu/~gback/pintos/priority-donate-sema.ck
66
67 I put the other tests up here:
68 http://people.cs.vt.edu/~gback/pintos/priority-donate-multiple2.c
69 http://people.cs.vt.edu/~gback/pintos/priority-donate-multiple2.ck
70
71 From: "Godmar Back" <godmar@gmail.com>
72 Subject: multiple threads waking up at same clock tick
73 To: "Ben Pfaff" <blp@cs.stanford.edu>
74 Date: Wed, 1 Mar 2006 08:14:47 -0500
75
76 Greg Benson points out another potential TODO item for P1.
77
78 ----
79 One thing I recall:
80
81 The alarm tests do not test to see if multiple threads are woken up if
82 their timers have expired.  That is, students can write a solution
83 that just wakes up the first thread on the sleep queue rather than
84 check for additional threads.  Of course, the next thread will be
85 woken up on the next tick.  Also, this might be hard to test.
86
87 ---
88 Way to test this: (from Godmar Back)
89
90 Thread A with high priority spins until 'ticks' changes, then calls to
91 timer_sleep(X), Thread B with lower priority is then resumed, calls
92 set_priority to make its priority equal to that of thread A, then
93 calls timer_sleep(X), all of that before the next clock interrupt
94 arrives.
95
96 On wakeup, each thread records wake-up time and calls yield
97 immediately, forcing the scheduler to switch to the other
98 equal-priority thread. Both wake-up times must be the same (and match
99 the planned wake-up time.)
100
101 PS:
102 I actually tested it and it's hard to pass with the current ips setting.
103 The bounds on how quickly a thread would need to be able to return after
104 sleep appear too tight.  Need another idea.
105
106 From: "Godmar Back" <godmar@gmail.com>
107 Subject: thread_yield in irq handler
108 To: "Ben Pfaff" <blp@cs.stanford.edu>
109 Date: Wed, 22 Feb 2006 22:18:50 -0500
110
111 Ben,
112
113 you write in your Tour of Pintos:
114
115 "Second, an interrupt handler must not call any function that can
116 sleep, which rules out thread_yield(), lock_acquire(), and many
117 others. This is because external interrupts use space on the stack of
118 the kernel thread that was running at the time the interrupt occurred.
119 If the interrupt handler tried to sleep and that thread resumed, then
120 the two uses of the single stack would interfere, which cannot be
121 allowed."
122
123 Is the last sentence really true?
124
125 I thought the reason that you couldn't sleep is that you would put
126 effectively a random thread/process to sleep, but I don't think it
127 would cause problems with the kernel stack.  After all, it doesn't
128 cause this problem if you call thread_yield at the end of
129 intr_handler(), so why would it cause this problem earlier.
130
131 As for thread_yield(), my understanding is that the reason it's called
132 at the end is to ensure it's done after the interrupt is acknowledged,
133 which you can't do until the end because Pintos doesn't handle nested
134 interrupts.
135
136  - Godmar
137
138 From: "Godmar Back" <godmar@gmail.com>
139
140 For reasons I don't currently understand, some of our students seem
141 hesitant to include each thread in a second "all-threads" list and are
142 looking for ways to implement the advanced scheduler without one.
143
144 Currently, I believe, all tests for the mlfqs are such that all
145 threads are either ready or sleeping in timer_sleep(). This allows for
146 an incorrect implementation in which recent-cpu and priorities are
147 updated only for those threads that are on the alarm list or the ready
148 list.
149
150 The todo item would be a test where a thread is blocked on a
151 semaphore, lock or condition variable and have its recent_cpu decay to
152 zero, and check that it's scheduled right after the unlock/up/signal.
153
154 From: "Godmar Back" <godmar@gmail.com>
155 Subject: set_priority & donation - a TODO item
156 To: "Ben Pfaff" <blp@cs.stanford.edu>
157 Date: Mon, 20 Feb 2006 22:20:26 -0500
158
159 Ben,
160
161 it seems that there are currently no tests that check the proper
162 behavior of thread_set_priority() when called by a thread that is
163 running under priority donation.  The proper behavior, I assume, is to
164 temporarily drop the donation if the set priority is higher, and to
165 reassume the donation should the thread subsequently set its own
166 priority again to a level that's lower than a still active donation.
167
168  - Godmar
169
170 From: Godmar Back <godmar@gmail.com>
171 Subject: project 4 question/comment regarding caching inode data
172 To: Ben Pfaff <blp@cs.stanford.edu>
173 Date: Sat, 14 Jan 2006 15:59:33 -0500
174
175 Ben,
176
177 in section 6.3.3 in the P4 FAQ, you write:
178
179 "You can store a pointer to inode data in struct inode, if you want,"
180
181 Should you point out that if they indeed do that, they likely wouldn't
182 be able to support more than 64 open inodes systemwide at any given
183 point in time.
184
185 (This seems like a rather strong limitation; do your current tests
186 open more than 64 files?
187 It would also point to an obvious way to make the projects harder by
188 specifically disallowing that inode data be locked in memory during
189 the entire time an inode is kept open.)
190
191  - Godmar
192
193 From: Godmar Back <godmar@gmail.com>
194 Subject: on caching in project 4
195 To: Ben Pfaff <blp@cs.stanford.edu>
196 Date: Mon, 9 Jan 2006 20:58:01 -0500
197
198 here's an idea for future semesters.
199
200 I'm in the middle of project 4, I've started by implementing a buffer
201 cache and plugging it into the existing filesystem.  Along the way I
202 was wondering how we could test the cache.
203
204 Maybe one could adopt a similar testing strategy as in project 1 for
205 the MLQFS scheduler: add a function that reads "get_cache_accesses()"
206 and a function "get_cache_hits()".  Then create a version of pintos
207 that creates access traces for a to-be-determined workload.  Run an
208 off-line analysis that would determine how many hits a perfect cache
209 would have (MAX), and how much say an LRU strategy would give (MIN).
210 Then add a fudge factor to account for different index strategies and
211 test that the reported number of cache hits/accesses is within (MIN,
212 MAX) +/- fudge factor.
213
214 (As an aside - I am curious why you chose to use a clock-style
215 algorithm rather than the more straightforward LRU for your buffer
216 cache implementation in your sample solution. Is there a reason for
217 that?  I was curious to see if it made a difference, so I implemented
218 LRU for your cache implementation and ran the test workload of project
219 4 and printed cache hits/accesses.
220 I found that for that workload, the clock-based algorithm performs
221 almost identical to LRU (within about 1%, but I ran nondeterministally
222 with QEMU). I then reduced the cache size to 32 blocks and found again
223 the same performance, which raises the suspicion that the test
224 workload might not force any cache replacement, so the eviction
225 strategy doesn't matter.)
226
227 Godmar Back <godmar@gmail.com> writes:
228
229 > in your sample solution to P4, dir_reopen does not take any locks when
230 > changing a directory's open_cnt. This looks like a race condition to
231 > me, considering that dir_reopen is called from execute_process without
232 > any filesystem locks held.
233
234 * Get rid of rox--causes more trouble than it's worth
235
236 * Reconsider command line arg style--confuses everyone.
237
238 * Finish writing tour.
239
240 * Introduce a "yield" system call to speed up the syn-* tests.
241
242 via Godmar Back:
243
244 * Project 3 solution needs FS lock.
245
246 * Get rid of mmap syscall, add sbrk.
247
248 * Make backtrace program accept multiple object file arguments,
249   e.g. add -u option to allow backtracing user program also.
250
251 * page-linear, page-shuffle VM tests do not use enough memory to force
252   eviction.  Should increase memory consumption.
253
254 * Add FS persistence test(s).
255
256 * lock_acquire(), lock_release() don't need additional intr_dis/enable
257   calls, because the semaphore protects lock->holder.
258   [ Think this over: is this really true when priority donation is 
259     implemented?  intr_dis/enable prevents the race with thread_set_priority. 
260     Leaving it there could help the students getting the correct synchronization
261     right.
262   ]
263
264
265
266 * process_death test needs improvement
267
268 * Internal tests.
269
270 * Improve automatic interpretation of exception messages.
271
272 * Userprog project:
273
274   - Mark read-only pages as actually read-only in the page table.  Or,
275     since this was consistently rated as the easiest project by the
276     students, require them to do it.
277
278   - Don't provide per-process pagedir implementation but only
279     single-process implementation and require students to implement
280     the separation?  This project was rated as the easiest after all.
281     Alternately we could just remove the synchronization on pid
282     selection and check that students fix it.
283
284 * Filesys project:
285
286   - Need a better way to measure performance improvement of buffer
287     cache.  Some students reported that their system was slower with
288     cache--likely, Bochs doesn't simulate a disk with a realistic
289     speed.
290
291 * Documentation:
292
293   - Add "Digging Deeper" sections that describe the nitty-gritty x86
294     details for the benefit of those interested.
295
296   - Add explanations of what "real" OSes do to give students some
297     perspective.
298
299 * Assignments:
300
301   - Add extra credit:
302
303     . Low-level x86 stuff, like paged page tables.
304
305     . Specifics on how to implement sbrk, malloc.
306
307     . Other good ideas.
308
309     . opendir/readdir/closedir
310
311     . everything needed for getcwd()