46828ddb85ce29ca908f4193032835e2198de441
[ikiwiki.git] / docs / developer / alexh_todo / index.mdwn
1 ### Note this is my personal todo and ideas list, don't jump on me if you don't like something or think that it isn't important enough.
2
3 * linuxulator
4   - get ltp working
5   - update it part by part!
6
7
8 * kbd
9   - port this: http://svn.freebsd.org/viewvc/base/head/sys/dev/kbd/kbd.c?revision=112050&view=markup
10   - remove kbd_reinit_struct
11   - unicode?
12   - remove need for mplock
13   
14
15 * sync syscons as far as possible
16   - tty changes not possible...
17   
18
19 * port wscons (?)
20   - probably way too much effort.
21
22 * port the mpsafe tty stuff from FreeBSD - or mpsafe ours.
23   - http://svn.freebsd.org/viewvc/base?view=revision&revision=181905 and quite a few later ones
24   - http://p4db.freebsd.org/changeList.cgi?FSPC=%2F%2Fdepot%2Fprojects%2Fmpsafetty%2F...&ignore=GO%21
25   - all related drivers, listed in UPDATING in the above revision, and others
26   - DON'T port pts driver, rather stick to ours but modify it to work with new ttys
27   - http://svn.freebsd.org/viewvc/base/head/sys/dev/snp/snp.c?view=log
28   - http://svn.freebsd.org/viewvc/base/head/sys/dev/si/si.c?view=log
29
30 * port usb4bsd
31   - wrapper is included for userland; should be easy to port
32   - http://svn.freebsd.org/viewvc/base?view=revision&revision=184610
33   - http://turbocat.net/~hselasky/usb4bsd/
34
35 * sync up vr
36  o Added VT6105M specific register definitions. VT6105M has the
37    following hardware capabilities.
38     - Tx/Rx IP/TCP/UDP checksum offload.
39     - VLAN hardware tag insertion/extraction. Due to lack of information
40        for getting extracted VLAN tag in Rx path, VLAN hardware support
41        was not implemented yet.
42     - CAM(Content Addressable Memory) based 32 entry perfect multicast/
43       VLAN filtering.
44     - 8 priority queues.
45  o Implemented CAM based 32 entry perfect multicast filtering for
46    VT6105M. If number of multicast entry is greater than 32, vr(4)
47    uses traditional hash based filtering.
48
49 * do something similar to geom (maybe with compat layer for geom?)
50   - http://svn.freebsd.org/viewvc/base?view=revision&revision=92108
51   - while here, "layerize" the disk subsystem
52
53 * continue work on disk scheduler
54   - focus on initial fair queueing policy as proof of concept
55   - see branch.
56
57 * ATA (automatic) spindown (see FreeBSD current)
58
59 * The ata(4) driver now supports a loader variable hw.ata.ata_dma_check_80pin.
60   - This can be used to disable the 80pin cable check on broken systems such as
61     certain laptops and Soekris boards. The default value is 1.
62
63 * RedZone, a buffer corruption protection for the kernel malloc(9) facility has been implemented.
64   - This detects both buffer underflows and overflows at runtime on free(9) and realloc(9),
65     and prints backtraces from where memory was allocated and from where it was freed.
66   - see irc log below.
67     
68 * port uart driver (?)
69
70 * simplify/improve i386
71   - http://svn.freebsd.org/viewvc/base?view=revision&revision=173592
72   - http://svn.freebsd.org/viewvc/base/head/sys/i386/i386/i686_mem.c?view=log
73   - http://svn.freebsd.org/viewvc/base/head/sys/i386/i386/initcpu.c?view=log
74   - http://svn.freebsd.org/viewvc/base/head/sys/i386/i386/pmap.c?view=log
75   - http://svn.freebsd.org/viewvc/base/head/sys/i386/i386/locore.s?view=log
76
77 * suspend/resume for SMP x86
78   - http://lists.freebsd.org/pipermail/freebsd-acpi/2008-May/004879.html
79   
80 * route show
81   
82 * AMD64 suspend/resume
83   - http://svn.freebsd.org/viewvc/base?view=revision&revision=189903
84   
85 * code simplification (Introduce cpu_vendor_id and replace a lot of strcmp(cpu_vendor, "...")
86   - http://svn.freebsd.org/viewvc/base?view=revision&revision=185341
87   
88 * APIC stuff
89   - http://svn.freebsd.org/viewvc/base/head/sys/i386/i386/mptable.c?view=log
90   - http://svn.freebsd.org/viewvc/base/head/sys/i386/i386/mptable_pci.c?view=log
91   - http://svn.freebsd.org/viewvc/base/head/sys/i386/i386/io_apic.c?view=log
92   - MOST IMPORTANTLY: http://svn.freebsd.org/viewvc/base?view=revision&revision=121986
93   - AND: http://svn.freebsd.org/viewvc/base?view=revision&revision=121991
94
95 * crash analysis tool
96   - http://svn.freebsd.org/viewvc/base?view=revision&revision=181335
97
98 * utmpx
99   - CFLAGS="-DUTMPX_USE_LIBRARY -DHAVE_UTMPX_H -DUSE_UTMPX"
100   - see branch, but still missing update to pam! (proper update)
101     
102 * Update callout
103    http://svn.freebsd.org/viewvc/base?view=revision&revision=127969
104   
105 * unionfs update
106   - use namecache tricks as nullfs does
107   - make it work without whiteout
108
109 * inv ctxsw rusage
110   - see irc logs
111
112 * synchronization routines documentation page (compare all the following, highlight differences)
113   - mtx
114   - spinlock
115   - lockmgr
116   - critical section
117   - lwkt serialization tokens
118   - lwkt messages
119     
120
121
122
123
124
125 devclass_find_internal(const char *classname, const char *parentname,
126     543                        int create)
127
128
129     
130     
131     
132     
133     
134     
135     
136     
137     
138     
139     
140 [alexh@leaf:~/home] $ roundup-server -p 8080 bt=bugtracker
141
142 <pre>
143 -05:48- :        dillon@: no, double frees to the object cache are nasty.  It can't detect them.  the object 
144                           winds up in the magazine array twice
145 -05:48- :        dillon@: (and possibly different magazines, too)
146 -05:49- :         alexh@: can't I just write some magic to a free object on the first objcache_put and check 
147                           if it's there on objcache_put?
148 -05:49- :         alexh@: and clear it on objcache_get, anyways
149 -05:50- :        dillon@: no, because the object is still may have live-initialized fields
150 -05:50- :        dillon@: because it hasn't been dtor'ed yet (one of the features of the objcache, to avoid 
151                           having to reinitialize objects every time)
152 -05:50- :        dillon@: the mbuf code uses that feature I think, probably other bits too
153 -05:51- :        dillon@: theoretically we could allocate slightly larger objects and store a magic number at 
154                           offset [-1] or something like that, but it gets a little iffy doing that
155 -05:52- :        dillon@: the objcache with the objcache malloc default could probably do something like that 
156                           I guess.
157 -05:52- :        dillon@: I don't consider memory tracking to be a huge issue w/ dragonfly, though I like the 
158                           idea of being able to do it.  It is a much bigger problem in FreeBSD due to the 
159                           large number of committers 
160
161
162 -05:55- :        dillon@: For the slab allocator you may be able to do something using the Zone header.
163 -05:55- :        dillon@: the slab allocator in fact I think already has optional code to allocate a tracking 
164                           bitmap to detect double-frees
165 -05:56- :        dillon@: sorry, I just remembered the bit about the power-of-2 allocations
166 -05:56- :        dillon@: for example, power-of-2-sized allocations are guaranteed not only to be aligned on 
167                           that particular size boundary, but also to not cross a PAGE_BOUNDARY (unless the 
168                           size is > PAGE_SIZE)
169 -05:57- :        dillon@: various subsystems such as AHCI depend on that behavior to allocate system 
170                           structures for which the chipsets only allow one DMA descriptor.
171 -05:59- :         alexh@: http://svn.freebsd.org/viewvc/base/head/sys/vm/redzone.c?view=markup&pathrev=155086 
172                           < this is redzone. it basically calls redzone_addr_ntor() to increase the size in 
173                           malloc(), and then redzone_setup() just before returning the chunk
174 -06:02- :        dillon@: jeeze. that looks horrible.
175 -06:03- :         alexh@: I don't quite get that nsize + redzone_roundup(nsize)
176 -06:03- :        dillon@: I don't get it either.  It would completely break power-of-2-sized alignments in the 
177                           original request
178 -06:04- :        dillon@: hmmm.  well, no it won't break them, but the results are oging to be weird
179 -06:04- :        dillon@: ick.
180
181 -06:15- :        dillon@: if the original request is a power of 2 the redzone adjusted request must be a power 
182                           of 2
183 -06:15- :        dillon@: basically
184 -06:16- :        dillon@: so original request 64, redzone request must be 128, 256, 512, 1024, etc.
185 -06:16- :         alexh@: yah, k
186 -06:16- :        dillon@: original request 32, current redzone code would be 32+128 which is WRONG.
187 -06:16- :         alexh@: how big is PAGE_SIZE ?
188 -06:16- :        dillon@: 4096 on i386 and amd64
189 -06:17- :         alexh@: and one single malloc can't be bigger than that?
190 -06:17- :        dillon@: I'm fairly sure our kmalloc does not guarantee alignment past PAGE_SIZE (that is, 
191                           the alignment will be only PAGE_SIZE eve if you allocate PAGE_SIZE*2)
192 -06:17- :        dillon@: a single kmalloc can be larger then PAGE_SIZe
193 -06:18- :        dillon@: it will use the zone up to around 1/2 the zone size (~64KB I think), after which it 
194                           allocates pages directly with the kernel kvm allocator
195 -06:18- :        dillon@: if you look at the kmalloc code you will see the check for oversized allocations
196 -06:18- :         alexh@: yah, saw that
197 -06:18- :         alexh@: "handle large allocations directly"
198 -06:19- :         alexh@: not sure how to do this, really, as the size is obviously also changed in 
199                           kmem_slab_alloc
200 -06:20- :         alexh@: but kmem_slab_alloc isn't called always, is it?
201 -06:20- :         alexh@: only if the req doesn't fit into an existant zone
202 -06:20- :        dillon@: right
203 -06:20- :        dillon@: you don't want to redzone the zone allocation itself
204
205 </pre>