add ktrdump-via-shared-memory project
[ikiwiki.git] / docs / developer / gsocprojectspage / index.mdwn
1 [[!meta title="Google Summer of Code Project List"]]
2
3 [[!toc levels=0]]
4
5 Have a look at our SoC pages from [[2008|docs/developer/GoogleSoC2008/]], [[2009|docs/developer/gsoc2009]] and [[2010|docs/developer/gsoc2010]] to get an overview about prior year's projects.
6
7 For more details on Google's Summer of Code: [Google's SoC page](http://socghop.appspot.com/)
8
9 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 the proposals on this page to those that (based on our past experience) are appropriate for the GSoC program. This is by no means a comprehensive list, original ideas or proposals based on project ideas found on other pages are very welcome.
10
11 Note to everyone else: These proposals are by no means Summer of Code specific, anyone is welcome and encouraged to adopt any of these projects at any time (just please let us know, or make a note on this page).
12
13 Legend:
14
15 * 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.
16 * Difficulty: Estimated difficulty of the project, taking into account the complexity of the task and the time constraints of the GSoC program.
17 * Contact point: The person you should contact for any further information or clarifications. If the primary contact for a project does not respond in a reasonable amount of time (2-3 days), you should contact the appropriate DragonFly BSD mailing list, usually kernel@.
18
19 #### Project ideas
20
21 ##### VFS Quota System
22 * Create a new kernel subsystem to manage quota's in a filesystem agnostic manner by interfacing with the kernel VFS layer.
23 * 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), ...).
24 * 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.
25
26 Meta information:
27
28 * Prerequisites: C, introductory filesystems internals
29 * Difficulty: Moderate
30 * Contact point: Samuel J. Greear <sjg@thesjg.com>
31
32 ---
33
34 ##### Implement i386 32-bit ABI for x86_64 64-bit kernel
35 * Add a 32-bit syscall table which translates 32-bit
36   system calls to 64-bit.
37 * Add support for 32 bit compatibility mode operation
38   and ELF binary detection.
39
40 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.
41
42 There are several hundred system calls which translates to a great deal of 'grunt work' when it comes time to actually do all the translations.
43
44 Meta information:
45
46 * Prerequisites: C
47 * Difficulty: Difficult (lots of moving parts, particularly the trapframes)
48 * Contact point: dillon
49
50 ---
51
52 ##### Implement ARC algorithm extension for the vnode free list
53 * Vnode recycling is LRU and can't efficiently handle data sets which
54   exceed the maxvnode limit.  When the maxvnode limit is reached the kernel
55   starts throwing away cached vnodes along with their VM objects (and thus
56   all related cached file data).
57
58 * What we would like to do is implement an ARC algorithm for the free
59   vnodes to determine which ones to throw away and potentially combine
60   this with further caching of the related VM object even after the vnode
61   is thrown away by associating it with a mount point and inode number,
62   until memory pressure forces all of its pages out.
63
64 * For this project the student can choose to just implement the VM object
65   retention portion and not try to implement an ARC algorithm (which can
66   be considerably more complex).
67
68 Meta information:
69
70 * Prerequisites: C, OS internals
71 * Difficulty: Modest without ARC (Very difficult with ARC)
72 * Contact point: dillon
73
74 ---
75
76 ##### Make DragonFly NUMA-aware 
77
78 * Parse related ACPI tables 
79 * NUMA-aware memory allocation
80 * References:
81 [ACPI SLIT parser](http://mail-index.netbsd.org/tech-kern/2009/11/23/msg006518.html)
82 [ACPI SRAT parser](http://mail-index.netbsd.org/tech-kern/2009/11/23/msg006517.html)
83 [NetBSD NUMA diff](http://www.netbsd.org/~cegger/numa2.diff)
84 [NetBSD NUMA x86 diff](http://www.netbsd.org/~cegger/numa_x86.diff) (These patches now in NetBSD tree)
85
86 Meta information:
87
88 * Prerequisites: C, introductory computer architecture
89 * Difficulty: Easy
90 * Contact point: kernel@crater.dragonflybsd.org
91
92 ---
93
94
95 ##### Port valgrind to DragonFlyBSD
96
97 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.
98
99 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.
100
101 Meta information:
102
103 * Prerequisites: C, x86 assembly, low-level OS internals
104 * Difficulty: Hard
105 * Contact point: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
106
107 ---
108
109 ##### Adapt pkgsrc to create a package system with dependency independence.
110 * 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.
111
112 Meta information:
113
114 * Prerequisites: C
115 * Difficulty: ?
116 * Contact point: kernel@crater.dragonflybsd.org
117
118 ---
119
120 ##### Implement virtio drivers on DragonFly to speed up DragonFly as a KVM guest
121
122 As virtualization is coming more and more and KVM will be a strong player in that field,
123 we want DragonFly to have top-notch support for this virtualization platform. For this
124 purpose, we'd like to have a virtio-based implementation of a paravirtualized disk and
125 network driver. [virtio](http://www.ibm.com/developerworks/linux/library/l-virtio/index.html)
126 is an abstraction to a ring buffer that is shared between the host and the guest. On top of this
127 abstraction, one can build a variety of paravirtualized devices, as specified in
128 [virtio-spec](http://ozlabs.org/~rusty/virtio-spec/virtio-spec-0.8.6.pdf).
129
130 The goal of this project is to create a virtio-ring implementation and then to implement drivers
131 for the network and block devices described in the specification linked to above. This is a great
132 project for a student who wants to get experience writing (real-world, high-performance) device
133 drivers without having to deal with the quirks of real hardware.
134
135 Meta information:
136
137 * Prerequisites: C, elementary OS internals
138 * Difficulty: Easy
139 * Contact point: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>, kernel@crater.dragonflybsd.org
140
141 ---
142
143 ##### Port PUFFS from FreeBSD/NetBSD
144
145 * http://www.netbsd.org/docs/puffs/
146 * This would make many userspace filesystems available to DragonFly, e.g. sshfs to mention only one.
147
148 Meta information:
149
150 * Prerequisites: C, elementary OS internals
151 * Difficulty: Medium
152 * Contact point: Michael Neumann <mneumann@ntecs.de>
153
154 ---
155
156 ##### Make vkernels checkpointable
157
158 * See checkpt(1).
159 * Implement save and restore of segment registers so that threaded applications may be checkpointed. The segment registers support TLS. There are potential security concerns here.
160 * Teach the checkpt system call how to checkpoint multiple vmspaces.
161 * Add code to the vkernel which gets triggered upon reception of a SIGCKPT signal to dump/load e.g. the current state of network drivers.
162 * This would allow us to save and restore or even migrate a complete DragonFly operating system running on the vkernel platform.
163 This could be especially handy on laptops (if we'd get X11 operating in vkernels).
164 * See also: http://www.dragonflybsd.org/docs/developer/CheckpointFeatures/
165
166 Meta information:
167
168 * Prerequisites: C, OS internals
169 * Difficulty: Medium
170 * Contact point: Michael Neumann <mneumann@ntecs.de>
171 * References: [1](http://leaf.dragonflybsd.org/mailarchive/kernel/2007-02/msg00073.html) [2](http://leaf.dragonflybsd.org/mailarchive/users/2007-02/msg00034.html)
172
173 ---
174
175 ##### HAMMER compression
176
177 * Compress blocks as they get written to disk.
178 * Only file data (rec_type == DATA) should be compressed, not meta-data.
179 * the CRC should be that of the uncompressed data.
180 * ideally you'd need to associate the uncompressed data with the buffer cache buffer somehow, so that decompression is only performed once.
181 * compression could be turned on a per-file or per-pfs basis.
182 * gzip compression would be just fine at first.
183
184 Doing compression would require flagging the data record as being compressed and also require double-buffering since
185 the buffer cache buffer associated with the uncompressed data might have holes in it and otherwise referenced by user
186 programs and cannot serve as a buffer for in-place compression or decompression.
187
188 The direct read / direct write mechanic would almost certainly have to be disabled for compressed buffers and the
189 small-data zone would probably have to be used (the large-data zone is designed only for use with 16K or 64K buffers).
190
191 Meta information:
192
193 * Prerequisites: C, filesystem internals
194 * Difficulty: Difficult
195 * Contact point: Michael Neumann <mneumann@ntecs.de>
196
197 ---
198
199
200 ##### Port usb4bsd
201 * Port the whole usb4bsd stuff to DragonFly, as our own usb stack is too outdated.
202
203 * The usb4bsd branch of hselasky (?) has several userland wrappers and quite good abstraction to simplify the porting.
204
205 Meta information:
206
207 * Prerequisites: C, OS internals
208 * Difficulty: Moderate
209 * Contact point: kernel@crater.dragonflybsd.org
210
211 ---
212
213 ##### Userland System V Shared Memory / Semaphore / Message Queue implementation
214 * 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.
215 * 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.
216 * Test and benchmark the new facilities with heavy SysV consumers such as PostgreSQL
217 * 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.
218
219 Meta information:
220
221 * Prerequisites: C, x86 assembly
222 * Difficulty: Moderate
223 * Contact point: Samuel J. Greear <sjg@thesjg.com>
224
225 ---
226
227
228 ##### Update our interrupt routing and PCI code
229 * Update our interrupt routing to ACPI interrupt routing instead of relying on the mptable exclusively
230 * Update the PCI code to take advantage of MSI (Message Signalled Interrupts)
231
232 Meta information:
233
234 * Prerequisites: C, OS internals 
235 * Difficulty: Hard
236 * Contact point: kernel@crater.dragonflybsd.org
237 * References: [1](http://people.freebsd.org/~jhb/papers/bsdcan/2007/article/article.html) [2](http://www.bsdcan.org/2007/schedule/events/2.en.html) [3](http://www.acpi.info/DOWNLOADS/ACPIspec40a.pdf) [4](http://tldp.org/LDP/tlk/dd/interrupts.html) [5](http://wiki.osdev.org/Category:Interrupts)
238
239 ---
240
241 ##### DragonFly history access for Gnome/KDE
242 * Write a Dolphin (KDE) plugin or Gnome file manager plugin that creates a 'time slider' when working with HAMMER filesystems.
243 * If time remains investigate additional features and/or methods of display and possibly a HAMMER configuration utility for managing history retention, etc.
244
245 Meta information:
246
247 * Prerequisites: C, Gnome or KDE familiarity
248 * Difficulty: Hard
249 * Contact point: kernel@crater.dragonflybsd.org
250 * References: [A similar idea for ZFS](http://blogs.sun.com/erwann/entry/zfs_on_the_desktop_zfs)
251
252 ---
253
254 ##### Create a Samba VFS plugin to expose Hammer history
255 * Give access to Hammer snapshots/fine-grained history to anyone able to access the Hammer volume over Samba
256 * This would involve writing a Samba3 VFS module to expose historical versions of files as "shadow copies". VFS module implementations supporting more traditional snapshot hierarchies do already exist.
257
258 Meta information:
259
260 * Prerequisites: C
261 * Difficulty: Moderate
262 * Contact point: kernel@crater.dragonflybsd.org
263
264 ---
265
266 ##### Port Hyper-V Linux Integration components to DragonFly
267 * Microsoft released a dual BSD/GPL version of their para-virtualized drivers (SCSI and Networking) for Linux.
268 * This work would require porting the Linux VMBus (Microsoft's equivlalent to XenBus) and the corresponding SCSI (StorVSC) and networking (NetVSC) drivers to DragonFly.
269 * References: [Sources](http://www.microsoft.com/downloads/en/details.aspx?FamilyID=eee39325-898b-4522-9b4c-f4b5b9b64551) [Architecture Overview](http://port25.technet.com/archive/2009/07/22/introduction-to-the-linux-integration-components.aspx)
270
271 Meta information:
272
273 * Prerequisites: C, OS internals
274 * Difficulty: Hard
275 * Contact point: kernel@crater.dragonflybsd.org
276
277 ---
278
279 ##### Implement more dm targets
280 * Since we now have dm (device mapper) in DragonFly, it would be nice to make better use of it. Currently we have a relatively small number of useful targets (crypt, linear and striped).
281 * Other targets should be implemented, in particular the mirror target would be of interest. Other ideas are welcome, too. Before applying for this please discuss the target of interest on the mailing list or with me directly.
282 * There is a start of a journalled mirror target, if you want to attack soft mirroring; the problem is a lot more difficult than it seems at first, so talking on the mailing list or on IRC would be definitely worthwhile!
283
284 Meta information:
285
286 * Prerequisites: C, OS internals
287 * Difficulty: Medium
288 * Contact point: kernel@crater.dragonflybsd.org , Alex Hornung <alexh@dragonflybsd.org>, Venkatesh Srinivas <vsrinivas@dragonflybsd.org>
289
290 ---
291
292 ##### Implement a new unionfs
293 * unionfs is a particularly useful pseudo-fs which allows to have an upper and a lower filesystem on a single mountpoint. The upper mountpoint is mostly transparent, so that the lower mountpoint is accessible.
294 * A typical use case is mounting a tmpfs filesystem as the upper and a read-only FS as the lower mp. This way files can be edited transparently even on a RO filesystem without actually modifying it.
295 * The current unionfs is completely broken as it relies on the whiteout VFS technique which is not supported by HAMMER.
296
297 Meta information:
298
299 * Prerequisites: C, OS internals, ideally some knowledge of the FreeBSD/DragonFly VFS
300 * Difficulty: Medium
301 * Contact point: kernel@crater.dragonflybsd.org
302
303 ---
304
305 ##### Improve compatibility of libdevattr with Linux' libudev
306 * Our libdevattr has an API which is mostly compatible with Linux' libudev, but it is doubtful that any Linux application making use of libudev would run out of the box on DragonFly with libdevattr.
307 * The aim of this project is to identify the shortcomings of libdevattr and fix them so that some common libudev applications work with our libdevattr.
308 * This might involve some kernel hacking to improve our kern_udev and definitely includes some grunt work of "tagging" subsystems with the kern_udev API.
309 * Most of the work will be in userland, though, working on udevd and libdevattr.
310
311 Meta information:
312
313 * Prerequisites: C, familiarity with Linux' libudev would be a plus
314 * Difficulty: Medium
315 * Contact point: kernel@crater.dragonflybsd.org , Alex Hornung <alexh@dragonflybsd.org>
316
317
318
319 ---
320
321 ##### Implement further dsched disk scheduling policies
322 * dsched is a highly flexible disk scheduling framework which greatly minimizes the effort of writing disk scheduling policies.
323 * Currently only dsched_fq, a fairly simple fair-queuing policy, and noop policies are implemented.
324 * The aim of this project would be to implement at least another useful disk scheduling policy, preferably one that improves interactivity.
325 * Other ideas are welcome.
326 * This is a great opportunity for CS students interested in scheduling problems to apply their theoretical knowledge.
327
328 Meta information:
329
330 * Prerequisites: C, OS internals, familiarity with disk scheduling
331 * Difficulty: Medium
332 * Contact point: kernel@crater.dragonflybsd.org , Alex Hornung <alexh@dragonflybsd.org>
333
334 ---
335
336 ##### Implement hardware nested page table support for vkernels
337 * Various modern hardware supports virtualization extensions, including nested pagetables.
338 * The DragonFly BSD vmspaces API, used to support vkernels, is effectively a software implementation of nested pagetables.
339 * The goal of this project would be to add support for detection of the hardware features on AMD and Intel cpu's and alter the vmspace implementation to use hardware support when available.
340
341 Meta information:
342
343 * Prerequisites: C, x86 assembly, OS internals
344 * Difficulty: Hard
345 * Contact point: kernel@crater.dragonflybsd.org
346
347 ---
348
349 ##### ATA TRIM and filesystem/swap support
350 * Some devices support an ATA command, 'TRIM', which marks disk blocks as 'not in use'; on SSDs, for example, not-in-use blocks can be used to support better wear leveling and to prevent performance degradation over time with fragmentation of the free block set.
351 * DFly's BIO system supports BIO_DELETE commands; these commands are not tied to device level TRIM commands, however
352 * Once BIO_DELETE commands are possible, it'd be very nice for DragonFly's swap code to generate BIO_DELETE commands for unused swap blocks (batch them!); this would would work well with SSDs and swapcache
353 * HAMMER should also send BIO_DELETE commands to mark unused blocks unused. Running HAMMER on an SSD would be more pleasant then.
354 * FreeBSD implemented this support on Jan 29th for UFS; it may serve as a good reference.
355
356 Meta information:
357
358 * Prerequisites: C, OS internals, a touch of file systems
359 * Difficult: Not too hard
360 * Contact point: kernel@crater.dragonflybsd.org
361
362 ---
363
364 ##### Access to ktr(4) buffers via shared memory
365 Our event tracing system, ktr(4), records interesting events in per-cpu buffers that are printed out with ktrdump(8). Currently, ktrdump uses libkvm to access these buffers, which is suboptimal. One can allow a sufficiently-privileged userspace process to map those buffers read-only and access them directly. For bonus points, design an extensible, discoverable (think reflection) mechanism that provides fast access via shared memory to data structures that the kernel chooses to expose to userland.
366
367 Meta information:
368
369 * Prerequisites: C, OS internals
370 * Difficulty: Medium
371 * Contact point: kernel@crater.dragonflybsd.org, Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
372
373 ---
374
375  (please add)