storage revision 1.23 1 1.23 jdolecek $NetBSD: storage,v 1.23 2017/10/31 19:03:32 jdolecek Exp $
2 1.1 agc
3 1.1 agc NetBSD Storage Roadmap
4 1.1 agc ======================
5 1.1 agc
6 1.1 agc This is a small roadmap document, and deals with the storage and file
7 1.10 dholland systems side of the operating system. It discusses elements, projects,
8 1.10 dholland and goals that are under development or under discussion; and it is
9 1.10 dholland divided into three categories based on perceived priority.
10 1.10 dholland
11 1.10 dholland The following elements, projects, and goals are considered strategic
12 1.10 dholland priorities for the project:
13 1.10 dholland
14 1.10 dholland 1. Improving iscsi
15 1.10 dholland 2. nfsv4 support
16 1.10 dholland 3. A better journaling file system solution
17 1.10 dholland 4. Getting zfs working for real
18 1.10 dholland 5. Seamless full-disk encryption
19 1.11 dholland 6. Finish tls-maxphys
20 1.10 dholland
21 1.10 dholland The following elements, projects, and goals are not strategic
22 1.10 dholland priorities but are still important undertakings worth doing:
23 1.10 dholland
24 1.11 dholland 7. nvme support
25 1.11 dholland 8. lfs64
26 1.11 dholland 9. Per-process namespaces
27 1.11 dholland 10. lvm tidyup
28 1.11 dholland 11. Flash translation layer
29 1.11 dholland 12. Shingled disk support
30 1.11 dholland 13. ext3/ext4 support
31 1.11 dholland 14. Port hammer from Dragonfly
32 1.11 dholland 15. afs maintenance
33 1.11 dholland 16. execute-in-place
34 1.15 christos 17. extended attributes for acl and capability storage
35 1.10 dholland
36 1.10 dholland The following elements, projects, and goals are perhaps less pressing;
37 1.10 dholland this doesn't mean one shouldn't work on them but the expected payoff
38 1.10 dholland is perhaps less than for other things:
39 1.1 agc
40 1.15 christos 18. coda maintenance
41 1.1 agc
42 1.8 agc
43 1.10 dholland Explanations
44 1.10 dholland ============
45 1.1 agc
46 1.10 dholland 1. Improving iscsi
47 1.10 dholland ------------------
48 1.1 agc
49 1.10 dholland Both the existing iscsi target and initiator are fairly bad code, and
50 1.10 dholland neither works terribly well. Fixing this is fairly important as iscsi
51 1.10 dholland is where it's at for remote block devices. Note that there appears to
52 1.10 dholland be no compelling reason to move the target to the kernel or otherwise
53 1.10 dholland make major architectural changes.
54 1.10 dholland
55 1.21 dholland - As of January 2017 nobody is known to be working on this.
56 1.10 dholland - There is currently no clear timeframe or release target.
57 1.10 dholland - Contact agc for further information.
58 1.10 dholland
59 1.10 dholland
60 1.10 dholland 2. nfsv4 support
61 1.10 dholland ----------------
62 1.10 dholland
63 1.10 dholland nfsv4 is at this point the de facto standard for FS-level (as opposed
64 1.10 dholland to block-level) network volumes in production settings. The legacy nfs
65 1.10 dholland code currently in NetBSD only supports nfsv2 and nfsv3.
66 1.10 dholland
67 1.10 dholland The intended plan is to port FreeBSD's nfsv4 code, which also includes
68 1.10 dholland nfsv2 and nfsv3 support, and eventually transition to it completely,
69 1.10 dholland dropping our current nfs code. (Which is kind of a mess.) So far the
70 1.10 dholland only step that has been taken is to import the code from FreeBSD. The
71 1.10 dholland next step is to update that import (since it was done a while ago now)
72 1.10 dholland and then work on getting it to configure and compile.
73 1.10 dholland
74 1.21 dholland - As of January 2017 pgoyette has done a bit of prodding of the code
75 1.21 dholland recently, but otherwise nobody is working on this, and a volunteer to
76 1.21 dholland take charge and move it forward rapidly is urgently needed.
77 1.10 dholland - There is no clear timeframe or release target, although having an
78 1.10 dholland experimental version ready for -8 would be great.
79 1.10 dholland - Contact dholland for further information.
80 1.10 dholland
81 1.10 dholland
82 1.10 dholland 3. A better journaling file system solution
83 1.10 dholland -------------------------------------------
84 1.10 dholland
85 1.10 dholland WAPBL, the journaling FFS that NetBSD rolled out some time back, has a
86 1.10 dholland critical problem: it does not address the historic ffs behavior of
87 1.10 dholland allowing stale on-disk data to leak into user files in crashes. And
88 1.10 dholland because it runs faster, this happens more often and with more data.
89 1.10 dholland This situation is both a correctness and a security liability. Fixing
90 1.10 dholland it has turned out to be difficult. It is not really clear what the
91 1.10 dholland best option at this point is:
92 1.10 dholland
93 1.10 dholland + Fixing WAPBL (e.g. to flush newly allocated/newly written blocks to
94 1.10 dholland disk early) has been examined by several people who know the code base
95 1.13 dholland and judged difficult. Also, some other problems have come to light
96 1.20 jdolecek more recently; e.g. PR 50725, and 45676. Still, it might be the best
97 1.23 jdolecek way forward. Some performance and stability issues were resolved
98 1.23 jdolecek in netbsd-8, and more work is planned.
99 1.10 dholland
100 1.10 dholland + There is another journaling FFS; the Harvard one done by Margo
101 1.10 dholland Seltzer's group some years back. We have a copy of this, but as it was
102 1.10 dholland written in BSD/OS circa 1999 it needs a lot of merging, and then will
103 1.10 dholland undoubtedly also need a certain amount of polishing to be ready for
104 1.10 dholland production use. It does record-based rather than block-based
105 1.10 dholland journaling and does not share the stale data problem.
106 1.10 dholland
107 1.10 dholland + We could bring back softupdates (in the softupdates-with-journaling
108 1.10 dholland form found today in FreeBSD) -- this code is even more complicated
109 1.10 dholland than the softupdates code we removed back in 2009, and it's not clear
110 1.10 dholland that it's any more robust either. However, it would solve the stale
111 1.10 dholland data problem if someone wanted to port it over. It isn't clear that
112 1.10 dholland this would be any less work than getting the Harvard journaling FFS
113 1.10 dholland running... or than writing a whole new file system either.
114 1.10 dholland
115 1.10 dholland + We could write a whole new journaling file system. (That is, not
116 1.10 dholland FFS. Doing a new journaling FFS implementation is probably not
117 1.10 dholland sensible relative to merging the Harvard journaling FFS.) This is a
118 1.10 dholland big project.
119 1.10 dholland
120 1.10 dholland Right now it is not clear which of these avenues is the best way
121 1.10 dholland forward. Given the general manpower shortage, it may be that the best
122 1.10 dholland way is whatever looks best to someone who wants to work on the
123 1.10 dholland problem.
124 1.10 dholland
125 1.23 jdolecek - There is no clear timeframe or release target; but given that WAPBL
126 1.23 jdolecek has been disabled by default for new installs in -7 this problem
127 1.23 jdolecek can reasonably be said to have become critical.
128 1.23 jdolecek - jdolecek fixed some WAPBL stability issues, that work is included
129 1.23 jdolecek in netbsd-8, could be possibly enough for making it default for new
130 1.23 jdolecek installs again; there is kern/47030 which seems to be triggered by WAPBL
131 1.23 jdolecek however
132 1.16 jdolecek - There has been some interest in the Harvard journaling FFS but no
133 1.16 jdolecek significant progress. Nobody is known to be working on or particularly
134 1.10 dholland interested in porting softupdates-with-journaling. And, while
135 1.10 dholland dholland has been mumbling for some time about a plan for a
136 1.10 dholland specific new file system to solve this problem, there isn't any
137 1.10 dholland realistic prospect of significant progress on that in the
138 1.10 dholland foreseeable future, and nobody else is known to have or be working
139 1.10 dholland on even that much.
140 1.23 jdolecek - Contact joerg, martin, or jdolecek regarding WAPBL; contact dholland
141 1.23 jdolecek regarding the Harvard journaling FFS.
142 1.10 dholland
143 1.10 dholland
144 1.10 dholland 4. Getting zfs working for real
145 1.10 dholland -------------------------------
146 1.10 dholland
147 1.10 dholland ZFS has been almost working for years now. It is high time we got it
148 1.10 dholland really working. One of the things this entails is updating the ZFS
149 1.10 dholland code, as what we have is rather old. The Illumos version is probably
150 1.10 dholland what we want for this.
151 1.10 dholland
152 1.21 dholland - There has been intermittent work on zfs, but as of January 2017
153 1.10 dholland nobody is known to be actively working on it
154 1.10 dholland - There is no clear timeframe or release target.
155 1.10 dholland - Contact riastradh or ?? for further information.
156 1.1 agc
157 1.1 agc
158 1.10 dholland 5. Seamless full-disk encryption
159 1.10 dholland --------------------------------
160 1.1 agc
161 1.10 dholland (This is only sort of a storage issue.) We have cgd, and it is
162 1.10 dholland believed to still be cryptographically suitable, at least for the time
163 1.10 dholland being. However, we don't have any of the following things:
164 1.1 agc
165 1.10 dholland + An easy way to install a machine with full-disk encryption. It
166 1.10 dholland should really just be a checkbox item in sysinst, or not much more
167 1.10 dholland than that.
168 1.5 agc
169 1.10 dholland + Ideally, also an easy way to turn on full-disk encryption for a
170 1.10 dholland machine that's already been installed, though this is harder.
171 1.1 agc
172 1.10 dholland + A good story for booting off a disk that is otherwise encrypted;
173 1.10 dholland obviously one cannot encrypt the bootblocks, but it isn't clear where
174 1.10 dholland in boot the encrypted volume should take over, or how to make a best
175 1.10 dholland effort at protecting the unencrypted elements needed to boot. (At
176 1.10 dholland least, in the absence of something like UEFI secure boot combined with
177 1.10 dholland an cryptographic oracle to sign your bootloader image so UEFI will
178 1.10 dholland accept it.) There's also the question of how one runs cgdconfig(8) and
179 1.10 dholland where the cgdconfig binary comes from.
180 1.1 agc
181 1.10 dholland + A reasonable way to handle volume passphrases. MacOS apparently uses
182 1.10 dholland login passwords for this (or as passphrases for secondary keys, or
183 1.10 dholland something) and this seems to work well enough apart from the somewhat
184 1.10 dholland surreal experience of sometimes having to log in twice. However, it
185 1.10 dholland will complicate the bootup story.
186 1.1 agc
187 1.10 dholland Given the increasing regulatory-level importance of full-disk
188 1.10 dholland encryption, this is at least a de facto requirement for using NetBSD
189 1.10 dholland on laptops in many circumstances.
190 1.1 agc
191 1.21 dholland - As of January 2017 nobody is known to be working on this.
192 1.10 dholland - There is no clear timeframe or release target.
193 1.10 dholland - Contact dholland for further information.
194 1.5 agc
195 1.5 agc
196 1.11 dholland 6. Finish tls-maxphys
197 1.11 dholland ---------------------
198 1.11 dholland
199 1.11 dholland The tls-maxphys branch changes MAXPHYS (the maximum size of a single
200 1.11 dholland I/O request) from a global fixed constant to a value that's probed
201 1.11 dholland separately for each particular I/O channel based on its
202 1.11 dholland capabilities. Large values are highly desirable for e.g. feeding large
203 1.21 dholland disk arrays and SSDs, but do not work with all hardware.
204 1.11 dholland
205 1.11 dholland The code is nearly done and just needs more testing and support in
206 1.11 dholland more drivers.
207 1.11 dholland
208 1.21 dholland - As of January 2017 nobody is known to be working on this.
209 1.11 dholland - There is no clear timeframe or release target.
210 1.11 dholland - Contact tls for further information.
211 1.11 dholland
212 1.11 dholland
213 1.11 dholland 7. nvme suppport
214 1.11 dholland ----------------
215 1.11 dholland
216 1.11 dholland nvme ("NVM Express") is a hardware interface standard for PCI-attached
217 1.18 jdolecek SSDs. NetBSD now has a driver for these.
218 1.18 jdolecek
219 1.18 jdolecek Driver is now MPSAFE and uses bufq fcfs (i.e. no disksort()) already,
220 1.18 jdolecek so the most obvious software bottlenecks were treated. It still needs
221 1.18 jdolecek more testing on real hardware, and it may be good to investigate some further
222 1.18 jdolecek optimizations, such as DragonFly pbuf(9) or something similar.
223 1.11 dholland
224 1.11 dholland Semi-relatedly, it is also time for scsipi to become MPSAFE.
225 1.11 dholland
226 1.12 dholland - As of May 2016 a port of OpenBSD's driver has been commited. This
227 1.12 dholland will be in -8.
228 1.14 mlelstv - The nvme driver is a backend to ld(4) which is MPSAFE, but we still
229 1.14 mlelstv need to attend to I/O path bottlenecks. Better instrumentation
230 1.14 mlelstv is needed.
231 1.19 jdolecek - Flush cache commands via DIOCCACHESYNC currently doesn't wait for completion;
232 1.19 jdolecek it must not poll since that corrupts command queue, but it should use
233 1.19 jdolecek a condition variable to wait for the flush to actually finish
234 1.12 dholland - There is no clear timeframe or release target for these points.
235 1.11 dholland - Contact msaitoh or agc for further information.
236 1.11 dholland
237 1.11 dholland
238 1.11 dholland 8. lfs64
239 1.10 dholland --------
240 1.5 agc
241 1.10 dholland LFS currently only supports volumes up to 2 TB. As LFS is of interest
242 1.10 dholland for use on shingled disks (which are larger than 2 TB) and also for
243 1.10 dholland use on disk arrays (ditto) this is something of a problem. A 64-bit
244 1.10 dholland version of LFS for large volumes is in the works.
245 1.5 agc
246 1.21 dholland - dholland was working on this in fall 2015 but time to finish it
247 1.21 dholland dried up.
248 1.21 dholland - The goal now is to get a few remaining things done in time for 8.0
249 1.21 dholland so it will at least be ready for experimental use there.
250 1.10 dholland - Responsible: dholland
251 1.5 agc
252 1.8 agc
253 1.11 dholland 9. Per-process namespaces
254 1.10 dholland -------------------------
255 1.5 agc
256 1.10 dholland Support for per-process variation of the file system namespace enables
257 1.10 dholland a number of things; more flexible chroots, for example, and also
258 1.10 dholland potentially more efficient pkgsrc builds. dholland thought up a
259 1.21 dholland somewhat hackish but low-footprint way to implement this, and has a
260 1.21 dholland preliminary implementation, but concluded the scheme was too fragile
261 1.21 dholland for production. A different approach is probably needed, although the
262 1.21 dholland existing code could be tidied up and committed if that seems desirable.
263 1.5 agc
264 1.21 dholland - As of January 2017 nobody is working on this.
265 1.21 dholland - Contact: dholland
266 1.5 agc
267 1.8 agc
268 1.11 dholland 10. lvm tidyup
269 1.11 dholland --------------
270 1.5 agc
271 1.10 dholland [agc says someone should look at our lvm stuff; XXX fill this in]
272 1.5 agc
273 1.21 dholland - As of January 2017 nobody is known to be working on this.
274 1.10 dholland - There is no clear timeframe or release target.
275 1.10 dholland - Contact agc for further information.
276 1.5 agc
277 1.1 agc
278 1.11 dholland 11. Flash translation layer
279 1.11 dholland ---------------------------
280 1.9 agc
281 1.10 dholland SSDs ship with firmware called a "flash translation layer" that
282 1.10 dholland arbitrates between the block device software expects to see and the
283 1.10 dholland raw flash chips. FTLs handle wear leveling, lifetime management, and
284 1.10 dholland also internal caching, striping, and other performance concerns. While
285 1.10 dholland NetBSD has a file system for raw flash (chfs), it seems that given
286 1.10 dholland things NetBSD is often used for it ought to come with a flash
287 1.10 dholland translation layer as well.
288 1.10 dholland
289 1.10 dholland Note that this is an area where writing your own is probably a bad
290 1.10 dholland plan; it is a complicated area with a lot of prior art that's also
291 1.10 dholland reportedly full of patent mines. There are a couple of open FTL
292 1.10 dholland implementations that we might be able to import.
293 1.10 dholland
294 1.21 dholland - As of January 2017 nobody is known to be working on this.
295 1.10 dholland - There is no clear timeframe or release target.
296 1.10 dholland - Contact dholland for further information.
297 1.10 dholland
298 1.10 dholland
299 1.11 dholland 12. Shingled disk support
300 1.10 dholland -------------------------
301 1.10 dholland
302 1.10 dholland Shingled disks (or more technically, disks with "shingled magnetic
303 1.10 dholland recording" or SMR) can only write whole tracks at once. Thus, to
304 1.10 dholland operate effectively they require translation support similar to the
305 1.10 dholland flash translation layers found in SSDs. The nature and structure of
306 1.10 dholland shingle translation layers is still being researched; however, at some
307 1.10 dholland point we will want to support these things in NetBSD.
308 1.10 dholland
309 1.21 dholland - As of 2016 one of dholland's coworkers was looking at this.
310 1.10 dholland - There is no clear timeframe or release target.
311 1.10 dholland - Contact dholland for further information.
312 1.10 dholland
313 1.10 dholland
314 1.11 dholland 13. ext3/ext4 support
315 1.10 dholland ---------------------
316 1.10 dholland
317 1.10 dholland We would like to be able to read and write Linux ext3fs and ext4fs
318 1.10 dholland volumes. (We can already read clean ext3fs volumes as they're the same
319 1.10 dholland as ext2fs, modulo volume features our ext2fs code does not support;
320 1.10 dholland but we can't write them.)
321 1.10 dholland
322 1.10 dholland Ideally someone would write ext3 and/or ext4 code, whether integrated
323 1.10 dholland with or separate from the ext2 code we already have. It might also
324 1.10 dholland make sense to port or wrap the Linux ext3 or ext4 code so it can be
325 1.10 dholland loaded as a GPL'd kernel module; it isn't clear if that would be more
326 1.10 dholland or less work than doing an implementation.
327 1.10 dholland
328 1.10 dholland Note however that implementing ext3 has already defeated several
329 1.10 dholland people; this is a harder project than it looks.
330 1.10 dholland
331 1.17 jdolecek - GSoc 2016 brought support for extents, and also ro support for dir
332 1.17 jdolecek hashes; jdolecek also implemented several frequently used ext4 features
333 1.17 jdolecek so most contemporary ext filesystems should be possible to mount
334 1.17 jdolecek read-write
335 1.17 jdolecek - still need rw dir_nhash and xattr (semi-easy), and eventually journalling
336 1.17 jdolecek (hard)
337 1.10 dholland - There is no clear timeframe or release target.
338 1.17 jdolecek - jdolecek is working on improving ext3/ext4 support (particularily
339 1.17 jdolecek journalling)
340 1.10 dholland
341 1.10 dholland
342 1.11 dholland 14. Port hammer from Dragonfly
343 1.10 dholland ------------------------------
344 1.10 dholland
345 1.10 dholland While the motivation for and role of hammer isn't perhaps super
346 1.10 dholland persuasive, it would still be good to have it. Porting it from
347 1.10 dholland Dragonfly is probably not that painful (compared to, say, zfs) but as
348 1.10 dholland the Dragonfly and NetBSD VFS layers have diverged in different
349 1.10 dholland directions from the original 4.4BSD, may not be entirely trivial
350 1.10 dholland either.
351 1.10 dholland
352 1.21 dholland - As of January 2017 nobody is known to be working on this.
353 1.10 dholland - There is no clear timeframe or release target.
354 1.10 dholland - There probably isn't any particular person to contact; for VFS
355 1.10 dholland concerns contact dholland or hannken.
356 1.10 dholland
357 1.10 dholland
358 1.11 dholland 15. afs maintenance
359 1.10 dholland -------------------
360 1.10 dholland
361 1.10 dholland AFS needs periodic care and feeding to continue working as NetBSD
362 1.10 dholland changes, because the kernel-level bits aren't kept in the NetBSD tree
363 1.10 dholland and don't get updated with other things. This is an ongoing issue that
364 1.10 dholland always seems to need more manpower than it gets. It might make sense
365 1.10 dholland to import some of the kernel AFS code, or maybe even just some of the
366 1.10 dholland glue layer that it uses, in order to keep it more current.
367 1.10 dholland
368 1.10 dholland - jakllsch sometimes works on this.
369 1.10 dholland - We would like every release to have working AFS by the time it's
370 1.10 dholland released.
371 1.10 dholland - Contact jakllsch or gendalia about AFS; for VFS concerns contact
372 1.10 dholland dholland or hannken.
373 1.10 dholland
374 1.10 dholland
375 1.11 dholland 16. execute-in-place
376 1.10 dholland --------------------
377 1.10 dholland
378 1.10 dholland It is likely that the future includes non-volatile storage (so-called
379 1.10 dholland "nvram") that looks like RAM from the perspective of software. Most
380 1.10 dholland importantly: the storage is memory-mapped rather than looking like a
381 1.10 dholland disk controller. There are a number of things NetBSD ought to have to
382 1.10 dholland be ready for this, of which probably the most important is
383 1.10 dholland "execute-in-place": when an executable is run from such storage, and
384 1.10 dholland mapped into user memory with mmap, the storage hardware pages should
385 1.10 dholland be able to appear directly in user memory. Right now they get
386 1.10 dholland gratuitously copied into RAM, which is slow and wasteful. There are
387 1.10 dholland also other reasons (e.g. embedded device ROMs) to want execute-in-
388 1.10 dholland place support.
389 1.10 dholland
390 1.10 dholland Note that at the implementation level this is a UVM issue rather than
391 1.10 dholland strictly a storage issue.
392 1.10 dholland
393 1.10 dholland Also note that one does not need access to nvram hardware to work on
394 1.10 dholland this issue; given the performance profiles touted for nvram
395 1.10 dholland technologies, a plain RAM disk like md(4) is sufficient both
396 1.10 dholland structurally and for performance analysis.
397 1.10 dholland
398 1.21 dholland - As of January 2017 nobody is known to be working on this. Some
399 1.10 dholland time back, uebayasi wrote some preliminary patches, but they were
400 1.10 dholland rejected by the UVM maintainers.
401 1.10 dholland - There is no clear timeframe or release target.
402 1.10 dholland - Contact dholland for further information.
403 1.10 dholland
404 1.10 dholland
405 1.15 christos 17. use extended attributes for ACL and capability storage
406 1.15 christos ----------------------------------------------------------
407 1.15 christos
408 1.15 christos Currently there is some support for extended attributes in ffs,
409 1.15 christos but nothing really uses it. I would be nice if we came up with
410 1.15 christos a standard format to store ACL's and capabilities like Linux has.
411 1.15 christos The various tools must be modified to understand this and be able
412 1.15 christos to copy them if requested. Also tools to manipulate the data will
413 1.15 christos need to be written.
414 1.15 christos
415 1.21 dholland
416 1.15 christos 18. coda maintenance
417 1.10 dholland --------------------
418 1.10 dholland
419 1.10 dholland Coda only sort of works. [And I think it's behind relative to
420 1.10 dholland upstream, or something of the sort; XXX fill this in.] Also the code
421 1.10 dholland appears to have an ugly incestuous relationship with FFS. This should
422 1.10 dholland really be cleaned up. That or maybe it's time to remove Coda.
423 1.10 dholland
424 1.21 dholland - As of January 2017 nobody is known to be working on this.
425 1.10 dholland - There is no clear timeframe or release target.
426 1.10 dholland - There isn't anyone in particular to contact.
427 1.15 christos - Circa 2012 christos made it work read-write and split it
428 1.15 christos into modules. Since then christos has not tested it.
429 1.9 agc
430 1.21 dholland
431 1.9 agc Alistair Crooks, David Holland
432 1.10 dholland Fri Nov 20 02:17:53 EST 2015
433 1.12 dholland Sun May 1 16:50:42 EDT 2016 (some updates)
434 1.21 dholland Fri Jan 13 00:40:50 EST 2017 (some more updates)
435 1.12 dholland
436