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