Donation from Maigurs Stalidzans. Thanks!
[ikiwiki.git] / docs / developer / alexh_todo / index.mdwn
1 ## Note: this is my personal todo and ideas list (alexh@)
2
3 * Add a simple (regression) test framework
4   - Add the hundreds of test cases from our bugtracker
5   - Run nightly/weekly or at least before a release
6
7 * Callout overhaul
8   - add a callout_init_mtx/lock, etc
9   - add callout_drain
10
11 * Improve installer crypto support
12   - add tcplay/TrueCrypt support
13   - let user choose crypto algorithm, IV generation, etc
14
15 * Add support for hyperthreading / other SMT to our scheduler
16   - distinguish between real cores and threads on the same core
17   - Linux' work in the area: http://lwn.net/Articles/8553/
18
19 * Take advantage of nested paging/EPT in vkernels
20
21 * add a non-persistent unionfs VFS
22   - while this does not fully replace unionfs, it would deal with a few of the situations where unionfs is useful
23   - additionally the complexity is much lower, since everything can be kept in memory
24
25 * bring the samba3 hammer shadow copy foo to maturity
26
27 * extend dm's message feature to be two-way? what's the benefit?
28
29 * make the whole system deal correctly with non-512-byte blocksize for disks. (DEV_BSIZE)
30
31 * add another optimized bcopy/memcpy/memset/bzero version, using the AVX instructions
32
33 * cryptdisks: multiple keyfile support
34
35 * Add geli (without integrity verification) support using dm_target_crypt?
36   - a bit like the recent TrueCrypt implementation (tcplay)
37
38 * Update cryptsetup
39
40 * Keep opencrypto up-to-date
41   - http://www.openbsd.org/cgi-bin/cvsweb/src/sys/crypto/
42
43 * Port hwpmc & dig into (boot-up) performance
44
45 * linuxulator
46   - port to x86_64
47   - separate out common arch parts (linprocfs, for example)
48
49 * Fix the crash analysis script (or rather the programs it calls [some segfault])
50
51 * Take a look at updating lvm/dm/libdevicemapper
52
53 * Take a look at importing dmctl from NetBSD
54   - would require a bunch of modifications to work with the proper device-mapper API
55   - also some extensions? missing lots of features
56   
57 * rip out the disk partitioning from the disk subsystem and implement it in a more general fashion
58   - crazy idea: as dm targets with an auto-configuration option!
59     - would require to be able to create dm targets with an arbitrary name and not in /dev/mapper
60
61 * ATA (automatic) spindown (see FreeBSD current)
62   
63 * Update callout
64    http://svn.freebsd.org/viewvc/base?view=revision&revision=127969
65
66 * inv ctxsw rusage
67   - see irc logs
68   - some incorrect accounting going on, don't remember details :)
69
70 * unionfs update
71   - make it work without whiteout
72
73
74
75 ###Boring:
76
77 * Fix ipsec, get rid of old ipsec
78
79 * sync up vr
80     - Added VT6105M specific register definitions. VT6105M has the following hardware capabilities.
81     - Tx/Rx IP/TCP/UDP checksum offload.
82     - VLAN hardware tag insertion/extraction. Due to lack of information
83        for getting extracted VLAN tag in Rx path, VLAN hardware support
84        was not implemented yet.
85     - CAM(Content Addressable Memory) based 32 entry perfect multicast/
86       VLAN filtering.
87     - 8 priority queues.
88  o Implemented CAM based 32 entry perfect multicast filtering for
89    VT6105M. If number of multicast entry is greater than 32, vr(4)
90    uses traditional hash based filtering.
91
92 * RedZone, a buffer corruption protection for the kernel malloc(9) facility has been implemented.
93   - This detects both buffer underflows and overflows at runtime on free(9) and realloc(9),
94     and prints backtraces from where memory was allocated and from where it was freed.
95   - see irc log below.
96     
97 * port uart driver (?)
98
99 * port wscons (?) or update syscons
100   - probably way too much effort (wscons)
101
102
103 * port usb4bsd
104   - wrapper is included for userland; should be easy to port
105   - http://svn.freebsd.org/viewvc/base?view=revision&revision=184610
106   - http://turbocat.net/~hselasky/usb4bsd/
107   - http://gitweb.dragonflybsd.org/~polachok/dragonfly.git/shortlog/refs/heads/usb2
108
109 * suspend/resume for SMP x86
110   - http://lists.freebsd.org/pipermail/freebsd-acpi/2008-May/004879.html
111   
112 * AMD64 suspend/resume
113   - http://svn.freebsd.org/viewvc/base?view=revision&revision=189903
114
115
116 * text dumps
117
118     
119     
120 [alexh@leaf:~/home] $ roundup-server -p 8080 bt=bugtracker
121
122 <pre>
123 -05:48- :        dillon@: no, double frees to the object cache are nasty.  It can't detect them.  the object 
124                           winds up in the magazine array twice
125 -05:48- :        dillon@: (and possibly different magazines, too)
126 -05:49- :         alexh@: can't I just write some magic to a free object on the first objcache_put and check 
127                           if it's there on objcache_put?
128 -05:49- :         alexh@: and clear it on objcache_get, anyways
129 -05:50- :        dillon@: no, because the object is still may have live-initialized fields
130 -05:50- :        dillon@: because it hasn't been dtor'ed yet (one of the features of the objcache, to avoid 
131                           having to reinitialize objects every time)
132 -05:50- :        dillon@: the mbuf code uses that feature I think, probably other bits too
133 -05:51- :        dillon@: theoretically we could allocate slightly larger objects and store a magic number at 
134                           offset [-1] or something like that, but it gets a little iffy doing that
135 -05:52- :        dillon@: the objcache with the objcache malloc default could probably do something like that 
136                           I guess.
137 -05:52- :        dillon@: I don't consider memory tracking to be a huge issue w/ dragonfly, though I like the 
138                           idea of being able to do it.  It is a much bigger problem in FreeBSD due to the 
139                           large number of committers 
140
141
142 -05:55- :        dillon@: For the slab allocator you may be able to do something using the Zone header.
143 -05:55- :        dillon@: the slab allocator in fact I think already has optional code to allocate a tracking 
144                           bitmap to detect double-frees
145 -05:56- :        dillon@: sorry, I just remembered the bit about the power-of-2 allocations
146 -05:56- :        dillon@: for example, power-of-2-sized allocations are guaranteed not only to be aligned on 
147                           that particular size boundary, but also to not cross a PAGE_BOUNDARY (unless the 
148                           size is > PAGE_SIZE)
149 -05:57- :        dillon@: various subsystems such as AHCI depend on that behavior to allocate system 
150                           structures for which the chipsets only allow one DMA descriptor.
151 -05:59- :         alexh@: http://svn.freebsd.org/viewvc/base/head/sys/vm/redzone.c?view=markup&pathrev=155086 
152                           < this is redzone. it basically calls redzone_addr_ntor() to increase the size in 
153                           malloc(), and then redzone_setup() just before returning the chunk
154 -06:02- :        dillon@: jeeze. that looks horrible.
155 -06:03- :         alexh@: I don't quite get that nsize + redzone_roundup(nsize)
156 -06:03- :        dillon@: I don't get it either.  It would completely break power-of-2-sized alignments in the 
157                           original request
158 -06:04- :        dillon@: hmmm.  well, no it won't break them, but the results are oging to be weird
159 -06:04- :        dillon@: ick.
160
161 -06:15- :        dillon@: if the original request is a power of 2 the redzone adjusted request must be a power 
162                           of 2
163 -06:15- :        dillon@: basically
164 -06:16- :        dillon@: so original request 64, redzone request must be 128, 256, 512, 1024, etc.
165 -06:16- :         alexh@: yah, k
166 -06:16- :        dillon@: original request 32, current redzone code would be 32+128 which is WRONG.
167 -06:16- :         alexh@: how big is PAGE_SIZE ?
168 -06:16- :        dillon@: 4096 on i386 and amd64
169 -06:17- :         alexh@: and one single malloc can't be bigger than that?
170 -06:17- :        dillon@: I'm fairly sure our kmalloc does not guarantee alignment past PAGE_SIZE (that is, 
171                           the alignment will be only PAGE_SIZE eve if you allocate PAGE_SIZE*2)
172 -06:17- :        dillon@: a single kmalloc can be larger then PAGE_SIZe
173 -06:18- :        dillon@: it will use the zone up to around 1/2 the zone size (~64KB I think), after which it 
174                           allocates pages directly with the kernel kvm allocator
175 -06:18- :        dillon@: if you look at the kmalloc code you will see the check for oversized allocations
176 -06:18- :         alexh@: yah, saw that
177 -06:18- :         alexh@: "handle large allocations directly"
178 -06:19- :         alexh@: not sure how to do this, really, as the size is obviously also changed in 
179                           kmem_slab_alloc
180 -06:20- :         alexh@: but kmem_slab_alloc isn't called always, is it?
181 -06:20- :         alexh@: only if the req doesn't fit into an existant zone
182 -06:20- :        dillon@: right
183 -06:20- :        dillon@: you don't want to redzone the zone allocation itself
184
185 </pre>