3 From: Godmar Back <godmar@gmail.com>
4 Subject: project 4 question/comment regarding caching inode data
5 To: Ben Pfaff <blp@cs.stanford.edu>
6 Date: Sat, 14 Jan 2006 15:59:33 -0500
10 in section 6.3.3 in the P4 FAQ, you write:
12 "You can store a pointer to inode data in struct inode, if you want,"
14 Should you point out that if they indeed do that, they likely wouldn't
15 be able to support more than 64 open inodes systemwide at any given
18 (This seems like a rather strong limitation; do your current tests
19 open more than 64 files?
20 It would also point to an obvious way to make the projects harder by
21 specifically disallowing that inode data be locked in memory during
22 the entire time an inode is kept open.)
26 From: Godmar Back <godmar@gmail.com>
27 Subject: on caching in project 4
28 To: Ben Pfaff <blp@cs.stanford.edu>
29 Date: Mon, 9 Jan 2006 20:58:01 -0500
31 here's an idea for future semesters.
33 I'm in the middle of project 4, I've started by implementing a buffer
34 cache and plugging it into the existing filesystem. Along the way I
35 was wondering how we could test the cache.
37 Maybe one could adopt a similar testing strategy as in project 1 for
38 the MLQFS scheduler: add a function that reads "get_cache_accesses()"
39 and a function "get_cache_hits()". Then create a version of pintos
40 that creates access traces for a to-be-determined workload. Run an
41 off-line analysis that would determine how many hits a perfect cache
42 would have (MAX), and how much say an LRU strategy would give (MIN).
43 Then add a fudge factor to account for different index strategies and
44 test that the reported number of cache hits/accesses is within (MIN,
45 MAX) +/- fudge factor.
47 (As an aside - I am curious why you chose to use a clock-style
48 algorithm rather than the more straightforward LRU for your buffer
49 cache implementation in your sample solution. Is there a reason for
50 that? I was curious to see if it made a difference, so I implemented
51 LRU for your cache implementation and ran the test workload of project
52 4 and printed cache hits/accesses.
53 I found that for that workload, the clock-based algorithm performs
54 almost identical to LRU (within about 1%, but I ran nondeterministally
55 with QEMU). I then reduced the cache size to 32 blocks and found again
56 the same performance, which raises the suspicion that the test
57 workload might not force any cache replacement, so the eviction
58 strategy doesn't matter.)
60 Godmar Back <godmar@gmail.com> writes:
62 > in your sample solution to P4, dir_reopen does not take any locks when
63 > changing a directory's open_cnt. This looks like a race condition to
64 > me, considering that dir_reopen is called from execute_process without
65 > any filesystem locks held.
67 * Get rid of rox--causes more trouble than it's worth
69 * Reconsider command line arg style--confuses everyone.
71 * Finish writing tour.
73 * Introduce a "yield" system call to speed up the syn-* tests.
77 * Project 3 solution needs FS lock.
79 * Get rid of mmap syscall, add sbrk.
81 * Make backtrace program accept multiple object file arguments,
82 e.g. add -u option to allow backtracing user program also.
84 * page-linear, page-shuffle VM tests do not use enough memory to force
85 eviction. Should increase memory consumption.
87 * Add FS persistence test(s).
93 * process_death test needs improvement
97 * Improve automatic interpretation of exception messages.
101 - Mark read-only pages as actually read-only in the page table. Or,
102 since this was consistently rated as the easiest project by the
103 students, require them to do it.
105 - Don't provide per-process pagedir implementation but only
106 single-process implementation and require students to implement
107 the separation? This project was rated as the easiest after all.
108 Alternately we could just remove the synchronization on pid
109 selection and check that students fix it.
113 - Need a better way to measure performance improvement of buffer
114 cache. Some students reported that their system was slower with
115 cache--likely, Bochs doesn't simulate a disk with a realistic
120 - Add "Digging Deeper" sections that describe the nitty-gritty x86
121 details for the benefit of those interested.
123 - Add explanations of what "real" OSes do to give students some
130 . Low-level x86 stuff, like paged page tables.
132 . Specifics on how to implement sbrk, malloc.
136 . opendir/readdir/closedir
138 . everything needed for getcwd()