(no commit message)
[ikiwiki.git] / docs / developer / gsoc2010 / index.mdwn
1 [[!meta title="Google Summer of Code 2010"]]
2
3 [[!toc  levels=0]]
4
5 DragonFly BSD is planning to participate (pending acceptance) in the Google Summer of Code program for 2010.
6
7
8 Have a look at our SoC pages from [[2008|docs/developer/GoogleSoC2008/]] and [[2009|docs/developer/gsoc2009]] to get an overview about prior year's projects.  The [Projects Page](/docs/developer/ProjectsPage/) is also a potential source of ideas.
9
10
11 For more details on Google's Summer of Code: [Google's SoC page](http://socghop.appspot.com/)
12
13 Note to prospective students: These project proposals are meant to be a first approximation; we're looking forward to your own suggestions (even for completely new directions) and will try to integrate your ideas to make the GSoC project more interesting to all parties. Even when a proposal is very specific about the goals that must be achieved and the path that should be taken, these are always negotiable. Keep in mind that we have tried to limit our proposals to those that (based on our past experience) are appropriate for the GSoC program.
14
15 Legend:
16
17 * Prerequisites: knowledge that the student should have before starting the project. It may be possible to acquire the knowledge in the course of the project, but the estimated difficulty would increase substantially. On the bright side, you can expect to have a much deeper understanding of these fields (and gain some real-world experience) after you successfully complete the respective project.
18 * Difficulty: Estimated difficulty of the project, taking into account the complexity of the task and the time constraints of the GSoC program.
19 * Contact point: The person you should contact for any further information or clarifications.
20
21 #### Project ideas
22
23 ##### VFS Quota System
24 * Create a new kernel subsystem to manage quota's in a filesystem agnostic manner by interfacing with the kernel VFS layer.
25 * Create filesystem-agnostic quota support tools for userland that obtain information in the same manner as eg: du(1) instead of parsing the filesystem internals directly as the existing quota tools do (see quotacheck(8), repquota(8), edquota(8), ...).
26 * The quota file storage can be modeled after the existing UFS code that does the same, but should use the more general bytes, files and/or directories metrics instead of the somewhat UFS-specific blocks and inodes.
27
28 Meta information:
29
30 * Prerequisites: C, introductory filesystems internals
31 * Difficulty: Moderate
32 * Contact point: Samuel J. Greear <sjg@thesjg.com>
33
34 ---
35
36 ##### HAMMER Data dedup
37
38 The HAMMER filesystem is very efficient in sharing data between its fine-grained
39 snapshots, but when you copy (or otherwise duplicate) a file or directory tree, the data
40 is no longer shared. This is suboptimal because then we make poor use of disk space
41 and the same data gets cached multiple times wasting precious RAM space.
42
43 The goal of this project is to add a data de-duplication mechanism to the HAMMER
44 filesystem. A reasonable approach would be to detect potential data matches using
45 CRCs during pruning runs. Then you could verify there is actual duplication of data
46 (i.e. the match is not a false positive), collapse the B-Tree data reference and account for the
47 additional reference in the allocation blockmap.
48
49 Meta information:
50
51 * Prerequisites: C, modern filesystem internals
52 * Difficulty: Moderate
53 * Contact point: dillon
54
55 ---
56
57 ##### Implement i386 32-bit ABI for x86_64 64-bit kernel
58 * Add a 32-bit syscall table which translates 32-bit
59   system calls to 64-bit.
60 * Add support for 32 bit compatibility mode operation
61   and ELF binary detection.
62
63 The idea here is to support the execution of 32 bit DragonFly binaries in 64 bit DragonFly environments, something numerous other operating systems have done.  Several things must be done to support this.  First, the appropriate control bits must be set to execute in 32-bit compatibility mode while in usermode instead of 64-bit mode.  Second, when a system call is made from 32-bit mode a translation layer is needed to translate the system call into the 64-bit requivalent within the kernel.  Third, the signal handler and trampoline code needs to operate on the 32-bit signal frame.  Fourth, the 32 and 64 bit ELF loaders both have to be in the kernel at the same time, which may require some messing around with procedure names and include files since originally the source was designed to be one or the other.
64
65 There are several hundred system calls
66
67 Meta information:
68
69 * Prerequisites: C
70 * Difficulty: Difficult (lots of moving parts, particularly the trapframes)
71 * Contact point: dillon
72
73 ---
74
75 ##### Implement ARC algorithm extension for the vnode free list
76 * Vnode recycling is LRU and can't efficiently handle data sets which
77   exceed the maxvnode limit.  When the maxvnode limit is reached the kernel
78   starts throwing away cached vnodes along with their VM objects (and thus
79   all related cached file data).
80
81 * What we would like to do is implement an ARC algorithm for the free
82   vnodes to determine which ones to throw away and potentially combine
83   this with further caching of the related VM object even after the vnode
84   is thrown away by associating it with a mount point and inode number,
85   until memory pressure forces all of its pages out.
86
87 * For this project the student can choose to just implement the VM object
88   retention portion and not try to implement an ARC algorithm (which can
89   be considerably more complex).
90
91 Meta information:
92
93 * Prerequisites: C, OS internals
94 * Difficulty: Modest without ARC (Very difficult with ARC)
95 * Contact point: dillon
96
97 ---
98
99 ##### Implement swapoff
100 * We have swapon to add swap space, we need a swapoff to
101   remove it.
102
103 Meta information:
104
105 * Prerequisites: C, elementary OS memory management
106 * Difficulty: Modest
107 * Contact point: dillon
108
109 ---
110
111 ##### Graphics Kernel Memory Manager Support ( GEM )
112 * Support dealing with graphics NUMA in kernel space for modern graphics hardware
113 * http://en.wikipedia.org/wiki/Graphics_Execution_Manager
114
115 Meta information:
116
117 * Prerequisites: C, knowledge of modern computer graphics system architecture
118 * Difficulty: Moderate
119 * Contact point: kernel@crater.dragonflybsd.org
120
121 ---
122
123 ##### Make DragonFly NUMA-aware 
124
125 * Parse related ACPI tables 
126 * NUMA-aware memory allocation
127 * References:
128 [ACPI SLIT parser](http://mail-index.netbsd.org/tech-kern/2009/11/23/msg006518.html)
129 [ACPI SRAT parser](http://mail-index.netbsd.org/tech-kern/2009/11/23/msg006517.html)
130 [NetBSD NUMA diff](http://www.netbsd.org/~cegger/numa2.diff)
131 [NetBSD NUMA x86 diff](http://www.netbsd.org/~cegger/numa_x86.diff)
132
133 Meta information:
134
135 * Prerequisites: C, introductory computer architecture
136 * Difficulty: Easy
137 * Contact point: kernel@crater.dragonflybsd.org
138
139 ---
140
141 ##### Volume Management based on NetBSD's port of LVM2
142
143 NetBSD reimplemented Linux's device mapper (currently only implementing
144 the linear, zero and error targets; Linux has support for a variety of
145 targets, including crypt, stripe, snap, multipath) as dm(4). Device mapper
146 provides the functionality on which to implement volume management; NetBSD
147 has imported LVM2 (which is GPL), but it is possible to create different
148 tools for volume management (e.g. IBM's EVMS was also built on top of device
149 mapper).
150
151 The goal of this project is to port both the kernel code, dm(4), and the
152 LVM2 userspace libraries and tools from NetBSD. If time remains, the
153 student should also implement a proof of concept "stripe" target or, for the
154 more ambitious, a "crypt" target.
155
156 A possible roadmap for this project would be
157
158 1. Port the dm(4) code
159
160     This code uses proplib instead of binary ioctls for communicating with
161 userspace. Either port proplib, or convert the code to use ioctls.
162
163 1. Port the userspace tools
164
165     Integrate the tools in our source tree using a separate vendor branch, as
166 is normally done for contrib software (see development(7)). Make any
167 DragonFlyBSD-specific changes necessary.
168
169 1. (Optional) Implement either a "stripe" target or a crypt target.
170
171     The stripe target must be designed with robustness and extensibility in
172 mind, though it is not required to go all the way. It should be flexible
173 enough to allow for different RAID level implementations (at least 0, 1
174 and 5). Additionally, it should be possible to keep an internal (i.e. part
175 of the volume) log to speed up resyncing and parity checking. Implementing
176 those features would be ideal, but is not required.
177
178     The crypt target must allow for different ciphers and cipher parameters and
179 should make use of our in-kernel crypto infrastructure. It is probably
180 necessary to do the encryption asynchronously which will require extending
181 the current infrastructure.
182
183 Meta information:
184
185 * Prerequisites: C, elementary OS internals
186 * Difficulty: Medium
187 * Contact point: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
188
189 ---
190
191 ##### Port DragonFly to Xen platform
192
193 Meta information:
194
195 * Prerequisites: C, x86 assembly
196 * Difficulty: Hard
197 * Contact point: kernel@crater.dragonflybsd.org
198
199 ---
200
201 ##### Port valgrind to DragonFlyBSD
202
203 Valgrind is a very useful tool on a system like DragonFly that's under heavy development. Since valgrind is very target specific, a student doing the port will have to get acquainted with many low level details of the system libraries and the user<->kernel interface (system calls, signal delivery, threading...). This is a project that should appeal to aspiring systems programmers. Ideally, we would want the port to be usable with vkernel processes, thus enabling complex checking of the core kernel code.
204
205 The goal of this project is to port valgrind to the DragonFlyBSD platform so that at least the memcheck tool runs sufficiently well to be useful. This is in itself a challenging task. If time remains, the student should try to get at least a trivial valgrind tool to work on a vkernel process.
206
207 Meta information:
208
209 * Prerequisites: C, x86 assembly, low-level OS internals
210 * Difficulty: Hard
211 * Contact point: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
212
213 ---
214
215 ##### Adapt pkgsrc to create a package system with dependency independence.
216 * Create a set of tools that modifies how the pkgsrc packages are installed, allowing for the ability to upgrade individual packages, without stopping applications that depend on said packages from working. One method of achieving this is detailed at http://www.dragonflybsd.org/goals/#packages but other methods may be possible. PC-BSD have written a tool called PBI Builder which modifies FreeBSD ports for their dependency independence PBI system, this could be used as a starting point for the DragonFly BSD tools.
217
218 Meta information:
219
220 * Prerequisites: C
221 * Difficulty: ?
222 * Contact point: kernel@crater.dragonflybsd.org
223
224 ---
225
226 ##### Implement virtio drivers on DragonFly to speed up DragonFly as a KVM guest
227
228 As virtualization is coming more and more and KVM will be a strong player in that field,
229 we want DragonFly to have top-notch support for this virtualization platform. For this
230 purpose, we'd like to have a virtio-based implementation of a paravirtualized disk and
231 network driver. [virtio](http://www.ibm.com/developerworks/linux/library/l-virtio/index.html)
232 is an abstraction to a ring buffer that is shared between the host and the guest. On top of this
233 abstraction, one can build a variety of paravirtualized devices, as specified in
234 [virtio-spec](http://ozlabs.org/~rusty/virtio-spec/virtio-spec-0.8.6.pdf).
235
236 The goal of this project is to create a virtio-ring implementation and then to implement drivers
237 for the network and block devices described in the specification linked to above. This is a great
238 project for a student who wants to get experience writing (real-world, high-performance) device
239 drivers without having to deal with the quirks of real hardware.
240
241 Meta information:
242
243 * Prerequisites: C, elementary OS internals
244 * Difficulty: Easy
245 * Contact point: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>, kernel@crater.dragonflybsd.org
246
247 ---
248
249 ##### Port FUSE or PUFFS from FreeBSD/NetBSD
250
251 * http://www.netbsd.org/docs/puffs/
252 * This would make many userspace filesystems available to DragonFly, e.g. sshfs to mention only one.
253
254 Meta information:
255
256 * Prerequisites: C, elementary OS internals
257 * Difficulty: Medium
258 * Contact point: Michael Neumann <mneumann@ntecs.de>
259
260 ---
261
262 ##### Make vkernels checkpointable
263
264 * See checkpt(1).
265 * Teach the checkpt syscall how to checkpoint multiple vmspaces.
266 * Add code to the vkernel which gets triggered on SIGCKPT to dump/load e.g. the current state of network drivers.
267 * This would allow us to save and restore or even migrate a complete DragonFly operating system running on the vkernel platform.
268 This could be especially handy on laptops (if we'd get X11 operating in vkernels).
269 * See also: http://www.dragonflybsd.org/docs/developer/CheckpointFeatures/
270
271 Meta information:
272
273 * Prerequisites: C, OS internals
274 * Difficulty: Medium
275 * Contact point: Michael Neumann <mneumann@ntecs.de>
276
277 ---
278
279 ##### HAMMER compression
280
281 * Compress blocks as they get written to disk.
282 * Only file data (rec_type == DATA) should be compressed, not meta-data.
283 * the CRC should be that of the uncompressed data.
284 * ideally you'd need to associate the uncompressed data with the buffer cache buffer somehow, so that decompression is only performed once.
285 * compression could be turned on a per-file or per-pfs basis.
286 * gzip compression would be just fine at first.
287
288 Meta information:
289
290 * Prerequisites: C, filesystem internals
291 * Difficulty: Medium
292 * Contact point: Michael Neumann <mneumann@ntecs.de>
293
294 ---
295
296
297 ##### Port usb4bsd
298 * Port the whole usb4bsd stuff to DragonFly, as our own usb stack is too outdated.
299
300 * The usb4bsd branch of hselasky (?) has several userland wrappers and quite good abstraction to simplify the porting.
301
302 * (is polachok doing this or not?)
303
304 Meta information:
305
306 * Prerequisites: C, OS internals
307 * Difficulty: Moderate
308 * Contact point: kernel@crater.dragonflybsd.org
309
310 ---
311
312 ##### Userland System V Shared Memory / Semaphore / Message Queue implementation
313 * Implement some or all of these subsystems in their entirety, or as completely as possible in userland using a daemon, mmap and the DragonFly umtx_sleep(2)/umtx_wakeup(2) or other userland facilities.
314 * Any security or other major hurdles to this approach that would likely have to be implemented in-kernel should be noted in the students application.
315 * Test and benchmark the new facilities with heavy SysV consumers such as PostgreSQL
316 * Identify performance tradeoffs made in the userland implementation versus the existing kernel implementation. If time permits identify and apply solutions to these tradeoffs so that the userland implementation performs on par with or better than the kernel implementation.
317
318 Meta information:
319
320 * Prerequisites: C, x86 assembly
321 * Difficulty: Moderate
322 * Contact point: Samuel J. Greear <sjg@thesjg.com>
323
324 ---
325
326
327 ##### Update our interrupt routing and PCI code
328 * Update our interrupt routing to MSI (Message Signalled Interrupts)
329 * Update the PCI code to take advantage of MSI and also of newer power-saving features (see FreeBSD's work in this area)
330
331 Meta information:
332
333 * Prerequisites: C, OS internals 
334 * Difficulty: Hard
335 * Contact point: kernel@crater.dragonflybsd.org
336
337 ---
338
339 ##### Proportional RSS
340
341 The Resident Stack Size displayed by top keeps track of the number of resident pages in
342 a certain process's adress space. It is very useful to locate memory hogs, but doesn't take
343 into account page sharing. For example, if N processes map library L and L's resident pages
344 are 1G, this 1G is added to the RSS of all N processes. A more useful number would be the
345 Proportional (or Effective) RSS, for which we divide the number of mapped shared pages by
346 the number of processes sharing each page. So in the previous example we would add 1GB/N
347 to each process that has L mapped.
348
349 The goal of this project is to hack the kernel to allow for effective calculation of the
350 Proportional RSS and modify top to use it in addition to the RSS (i.e. it should display it by
351 default and be able to sort based on it).
352
353 Meta information:
354
355 * Prerequisites: C, Elementary OS internals
356 * Difficulty: Easy
357 * Contact point: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
358
359 ---
360
361  (please add)