storage revision 1.27
11.27Smsaitoh$NetBSD: storage,v 1.27 2019/05/29 02:34:19 msaitoh Exp $ 21.1Sagc 31.1SagcNetBSD Storage Roadmap 41.1Sagc====================== 51.1Sagc 61.1SagcThis is a small roadmap document, and deals with the storage and file 71.10Sdhollandsystems side of the operating system. It discusses elements, projects, 81.10Sdhollandand goals that are under development or under discussion; and it is 91.10Sdhollanddivided into three categories based on perceived priority. 101.10Sdholland 111.10SdhollandThe following elements, projects, and goals are considered strategic 121.10Sdhollandpriorities for the project: 131.10Sdholland 141.10Sdholland 1. Improving iscsi 151.10Sdholland 2. nfsv4 support 161.10Sdholland 3. A better journaling file system solution 171.10Sdholland 4. Getting zfs working for real 181.10Sdholland 5. Seamless full-disk encryption 191.11Sdholland 6. Finish tls-maxphys 201.10Sdholland 211.10SdhollandThe following elements, projects, and goals are not strategic 221.10Sdhollandpriorities but are still important undertakings worth doing: 231.10Sdholland 241.11Sdholland 7. nvme support 251.11Sdholland 8. lfs64 261.11Sdholland 9. Per-process namespaces 271.11Sdholland 10. lvm tidyup 281.11Sdholland 11. Flash translation layer 291.11Sdholland 12. Shingled disk support 301.11Sdholland 13. ext3/ext4 support 311.11Sdholland 14. Port hammer from Dragonfly 321.11Sdholland 15. afs maintenance 331.11Sdholland 16. execute-in-place 341.15Schristos 17. extended attributes for acl and capability storage 351.10Sdholland 361.10SdhollandThe following elements, projects, and goals are perhaps less pressing; 371.10Sdhollandthis doesn't mean one shouldn't work on them but the expected payoff 381.10Sdhollandis perhaps less than for other things: 391.1Sagc 401.15Schristos 18. coda maintenance 411.1Sagc 421.8Sagc 431.10SdhollandExplanations 441.10Sdholland============ 451.1Sagc 461.10Sdholland1. Improving iscsi 471.10Sdholland------------------ 481.1Sagc 491.10SdhollandBoth the existing iscsi target and initiator are fairly bad code, and 501.10Sdhollandneither works terribly well. Fixing this is fairly important as iscsi 511.10Sdhollandis where it's at for remote block devices. Note that there appears to 521.10Sdhollandbe no compelling reason to move the target to the kernel or otherwise 531.10Sdhollandmake major architectural changes. 541.10Sdholland 551.21Sdholland - As of January 2017 nobody is known to be working on this. 561.10Sdholland - There is currently no clear timeframe or release target. 571.10Sdholland - Contact agc for further information. 581.10Sdholland 591.10Sdholland 601.10Sdholland2. nfsv4 support 611.10Sdholland---------------- 621.10Sdholland 631.10Sdhollandnfsv4 is at this point the de facto standard for FS-level (as opposed 641.10Sdhollandto block-level) network volumes in production settings. The legacy nfs 651.10Sdhollandcode currently in NetBSD only supports nfsv2 and nfsv3. 661.10Sdholland 671.10SdhollandThe intended plan is to port FreeBSD's nfsv4 code, which also includes 681.10Sdhollandnfsv2 and nfsv3 support, and eventually transition to it completely, 691.10Sdhollanddropping our current nfs code. (Which is kind of a mess.) So far the 701.10Sdhollandonly step that has been taken is to import the code from FreeBSD. The 711.10Sdhollandnext step is to update that import (since it was done a while ago now) 721.10Sdhollandand then work on getting it to configure and compile. 731.10Sdholland 741.21Sdholland - As of January 2017 pgoyette has done a bit of prodding of the code 751.21Sdholland recently, but otherwise nobody is working on this, and a volunteer to 761.21Sdholland take charge and move it forward rapidly is urgently needed. 771.10Sdholland - There is no clear timeframe or release target, although having an 781.10Sdholland experimental version ready for -8 would be great. 791.10Sdholland - Contact dholland for further information. 801.10Sdholland 811.10Sdholland 821.10Sdholland3. A better journaling file system solution 831.10Sdholland------------------------------------------- 841.10Sdholland 851.10SdhollandWAPBL, the journaling FFS that NetBSD rolled out some time back, has a 861.10Sdhollandcritical problem: it does not address the historic ffs behavior of 871.10Sdhollandallowing stale on-disk data to leak into user files in crashes. And 881.10Sdhollandbecause it runs faster, this happens more often and with more data. 891.10SdhollandThis situation is both a correctness and a security liability. Fixing 901.10Sdhollandit has turned out to be difficult. It is not really clear what the 911.10Sdhollandbest option at this point is: 921.10Sdholland 931.10Sdholland+ Fixing WAPBL (e.g. to flush newly allocated/newly written blocks to 941.10Sdhollanddisk early) has been examined by several people who know the code base 951.13Sdhollandand judged difficult. Also, some other problems have come to light 961.20Sjdolecekmore recently; e.g. PR 50725, and 45676. Still, it might be the best 971.23Sjdolecekway forward. Some performance and stability issues were resolved 981.23Sjdolecekin netbsd-8, and more work is planned. 991.10Sdholland 1001.10Sdholland+ There is another journaling FFS; the Harvard one done by Margo 1011.10SdhollandSeltzer's group some years back. We have a copy of this, but as it was 1021.10Sdhollandwritten in BSD/OS circa 1999 it needs a lot of merging, and then will 1031.10Sdhollandundoubtedly also need a certain amount of polishing to be ready for 1041.10Sdhollandproduction use. It does record-based rather than block-based 1051.10Sdhollandjournaling and does not share the stale data problem. 1061.10Sdholland 1071.10Sdholland+ We could bring back softupdates (in the softupdates-with-journaling 1081.10Sdhollandform found today in FreeBSD) -- this code is even more complicated 1091.10Sdhollandthan the softupdates code we removed back in 2009, and it's not clear 1101.10Sdhollandthat it's any more robust either. However, it would solve the stale 1111.10Sdhollanddata problem if someone wanted to port it over. It isn't clear that 1121.10Sdhollandthis would be any less work than getting the Harvard journaling FFS 1131.10Sdhollandrunning... or than writing a whole new file system either. 1141.10Sdholland 1151.10Sdholland+ We could write a whole new journaling file system. (That is, not 1161.10SdhollandFFS. Doing a new journaling FFS implementation is probably not 1171.10Sdhollandsensible relative to merging the Harvard journaling FFS.) This is a 1181.10Sdhollandbig project. 1191.10Sdholland 1201.10SdhollandRight now it is not clear which of these avenues is the best way 1211.10Sdhollandforward. Given the general manpower shortage, it may be that the best 1221.10Sdhollandway is whatever looks best to someone who wants to work on the 1231.10Sdhollandproblem. 1241.10Sdholland 1251.23Sjdolecek - There is no clear timeframe or release target; but given that WAPBL 1261.23Sjdolecek has been disabled by default for new installs in -7 this problem 1271.23Sjdolecek can reasonably be said to have become critical. 1281.23Sjdolecek - jdolecek fixed some WAPBL stability issues, that work is included 1291.23Sjdolecek in netbsd-8, could be possibly enough for making it default for new 1301.23Sjdolecek installs again; there is kern/47030 which seems to be triggered by WAPBL 1311.23Sjdolecek however 1321.16Sjdolecek - There has been some interest in the Harvard journaling FFS but no 1331.16Sjdolecek significant progress. Nobody is known to be working on or particularly 1341.10Sdholland interested in porting softupdates-with-journaling. And, while 1351.10Sdholland dholland has been mumbling for some time about a plan for a 1361.10Sdholland specific new file system to solve this problem, there isn't any 1371.10Sdholland realistic prospect of significant progress on that in the 1381.10Sdholland foreseeable future, and nobody else is known to have or be working 1391.10Sdholland on even that much. 1401.23Sjdolecek - Contact joerg, martin, or jdolecek regarding WAPBL; contact dholland 1411.23Sjdolecek regarding the Harvard journaling FFS. 1421.10Sdholland 1431.10Sdholland 1441.10Sdholland4. Getting zfs working for real 1451.10Sdholland------------------------------- 1461.10Sdholland 1471.10SdhollandZFS has been almost working for years now. It is high time we got it 1481.10Sdhollandreally working. One of the things this entails is updating the ZFS 1491.10Sdhollandcode, as what we have is rather old. The Illumos version is probably 1501.10Sdhollandwhat we want for this. 1511.10Sdholland 1521.21Sdholland - There has been intermittent work on zfs, but as of January 2017 1531.10Sdholland nobody is known to be actively working on it 1541.10Sdholland - There is no clear timeframe or release target. 1551.10Sdholland - Contact riastradh or ?? for further information. 1561.1Sagc 1571.1Sagc 1581.10Sdholland5. Seamless full-disk encryption 1591.10Sdholland-------------------------------- 1601.1Sagc 1611.10Sdholland(This is only sort of a storage issue.) We have cgd, and it is 1621.10Sdhollandbelieved to still be cryptographically suitable, at least for the time 1631.10Sdhollandbeing. However, we don't have any of the following things: 1641.1Sagc 1651.10Sdholland+ An easy way to install a machine with full-disk encryption. It 1661.10Sdhollandshould really just be a checkbox item in sysinst, or not much more 1671.10Sdhollandthan that. 1681.5Sagc 1691.10Sdholland+ Ideally, also an easy way to turn on full-disk encryption for a 1701.10Sdhollandmachine that's already been installed, though this is harder. 1711.1Sagc 1721.10Sdholland+ A good story for booting off a disk that is otherwise encrypted; 1731.10Sdhollandobviously one cannot encrypt the bootblocks, but it isn't clear where 1741.10Sdhollandin boot the encrypted volume should take over, or how to make a best 1751.10Sdhollandeffort at protecting the unencrypted elements needed to boot. (At 1761.10Sdhollandleast, in the absence of something like UEFI secure boot combined with 1771.10Sdhollandan cryptographic oracle to sign your bootloader image so UEFI will 1781.10Sdhollandaccept it.) There's also the question of how one runs cgdconfig(8) and 1791.10Sdhollandwhere the cgdconfig binary comes from. 1801.1Sagc 1811.10Sdholland+ A reasonable way to handle volume passphrases. MacOS apparently uses 1821.10Sdhollandlogin passwords for this (or as passphrases for secondary keys, or 1831.10Sdhollandsomething) and this seems to work well enough apart from the somewhat 1841.10Sdhollandsurreal experience of sometimes having to log in twice. However, it 1851.10Sdhollandwill complicate the bootup story. 1861.1Sagc 1871.10SdhollandGiven the increasing regulatory-level importance of full-disk 1881.10Sdhollandencryption, this is at least a de facto requirement for using NetBSD 1891.10Sdhollandon laptops in many circumstances. 1901.1Sagc 1911.21Sdholland - As of January 2017 nobody is known to be working on this. 1921.10Sdholland - There is no clear timeframe or release target. 1931.10Sdholland - Contact dholland for further information. 1941.5Sagc 1951.5Sagc 1961.11Sdholland6. Finish tls-maxphys 1971.11Sdholland--------------------- 1981.11Sdholland 1991.11SdhollandThe tls-maxphys branch changes MAXPHYS (the maximum size of a single 2001.11SdhollandI/O request) from a global fixed constant to a value that's probed 2011.11Sdhollandseparately for each particular I/O channel based on its 2021.11Sdhollandcapabilities. Large values are highly desirable for e.g. feeding large 2031.21Sdhollanddisk arrays and SSDs, but do not work with all hardware. 2041.11Sdholland 2051.11SdhollandThe code is nearly done and just needs more testing and support in 2061.11Sdhollandmore drivers. 2071.11Sdholland 2081.26Sjdolecek - On October 2017 jdolecek re-synced the branch, intention is to wrap 2091.25Sjdolecek this up for future netbsd-9 2101.25Sjdolecek - Contact jdolecek or tls for further information. 2111.11Sdholland 2121.11Sdholland 2131.27Smsaitoh7. nvme support 2141.11Sdholland---------------- 2151.11Sdholland 2161.11Sdhollandnvme ("NVM Express") is a hardware interface standard for PCI-attached 2171.18SjdolecekSSDs. NetBSD now has a driver for these. 2181.18Sjdolecek 2191.18SjdolecekDriver is now MPSAFE and uses bufq fcfs (i.e. no disksort()) already, 2201.18Sjdolecekso the most obvious software bottlenecks were treated. It still needs 2211.18Sjdolecekmore testing on real hardware, and it may be good to investigate some further 2221.18Sjdolecekoptimizations, such as DragonFly pbuf(9) or something similar. 2231.11Sdholland 2241.11SdhollandSemi-relatedly, it is also time for scsipi to become MPSAFE. 2251.11Sdholland 2261.12Sdholland - As of May 2016 a port of OpenBSD's driver has been commited. This 2271.12Sdholland will be in -8. 2281.24Sjdolecek - The nvme driver is a backend to ld(4) and is fully is MPSAFE, but we 2291.24Sjdolecek still need to attend to I/O path bottlenecks like kern/53124. 2301.24Sjdolecek Better instrumentation is needed. 2311.24Sjdolecek - Contact msaitoh, agc, or jdolecek for further information. 2321.11Sdholland 2331.11Sdholland 2341.11Sdholland8. lfs64 2351.10Sdholland-------- 2361.5Sagc 2371.10SdhollandLFS currently only supports volumes up to 2 TB. As LFS is of interest 2381.10Sdhollandfor use on shingled disks (which are larger than 2 TB) and also for 2391.10Sdhollanduse on disk arrays (ditto) this is something of a problem. A 64-bit 2401.10Sdhollandversion of LFS for large volumes is in the works. 2411.5Sagc 2421.21Sdholland - dholland was working on this in fall 2015 but time to finish it 2431.21Sdholland dried up. 2441.21Sdholland - The goal now is to get a few remaining things done in time for 8.0 2451.21Sdholland so it will at least be ready for experimental use there. 2461.10Sdholland - Responsible: dholland 2471.5Sagc 2481.8Sagc 2491.11Sdholland9. Per-process namespaces 2501.10Sdholland------------------------- 2511.5Sagc 2521.10SdhollandSupport for per-process variation of the file system namespace enables 2531.10Sdhollanda number of things; more flexible chroots, for example, and also 2541.10Sdhollandpotentially more efficient pkgsrc builds. dholland thought up a 2551.21Sdhollandsomewhat hackish but low-footprint way to implement this, and has a 2561.21Sdhollandpreliminary implementation, but concluded the scheme was too fragile 2571.21Sdhollandfor production. A different approach is probably needed, although the 2581.21Sdhollandexisting code could be tidied up and committed if that seems desirable. 2591.5Sagc 2601.21Sdholland - As of January 2017 nobody is working on this. 2611.21Sdholland - Contact: dholland 2621.5Sagc 2631.8Sagc 2641.11Sdholland10. lvm tidyup 2651.11Sdholland-------------- 2661.5Sagc 2671.10Sdholland[agc says someone should look at our lvm stuff; XXX fill this in] 2681.5Sagc 2691.21Sdholland - As of January 2017 nobody is known to be working on this. 2701.10Sdholland - There is no clear timeframe or release target. 2711.10Sdholland - Contact agc for further information. 2721.5Sagc 2731.1Sagc 2741.11Sdholland11. Flash translation layer 2751.11Sdholland--------------------------- 2761.9Sagc 2771.10SdhollandSSDs ship with firmware called a "flash translation layer" that 2781.10Sdhollandarbitrates between the block device software expects to see and the 2791.10Sdhollandraw flash chips. FTLs handle wear leveling, lifetime management, and 2801.10Sdhollandalso internal caching, striping, and other performance concerns. While 2811.10SdhollandNetBSD has a file system for raw flash (chfs), it seems that given 2821.10Sdhollandthings NetBSD is often used for it ought to come with a flash 2831.10Sdhollandtranslation layer as well. 2841.10Sdholland 2851.10SdhollandNote that this is an area where writing your own is probably a bad 2861.10Sdhollandplan; it is a complicated area with a lot of prior art that's also 2871.10Sdhollandreportedly full of patent mines. There are a couple of open FTL 2881.10Sdhollandimplementations that we might be able to import. 2891.10Sdholland 2901.21Sdholland - As of January 2017 nobody is known to be working on this. 2911.10Sdholland - There is no clear timeframe or release target. 2921.10Sdholland - Contact dholland for further information. 2931.10Sdholland 2941.10Sdholland 2951.11Sdholland12. Shingled disk support 2961.10Sdholland------------------------- 2971.10Sdholland 2981.10SdhollandShingled disks (or more technically, disks with "shingled magnetic 2991.10Sdhollandrecording" or SMR) can only write whole tracks at once. Thus, to 3001.10Sdhollandoperate effectively they require translation support similar to the 3011.10Sdhollandflash translation layers found in SSDs. The nature and structure of 3021.10Sdhollandshingle translation layers is still being researched; however, at some 3031.10Sdhollandpoint we will want to support these things in NetBSD. 3041.10Sdholland 3051.21Sdholland - As of 2016 one of dholland's coworkers was looking at this. 3061.10Sdholland - There is no clear timeframe or release target. 3071.10Sdholland - Contact dholland for further information. 3081.10Sdholland 3091.10Sdholland 3101.11Sdholland13. ext3/ext4 support 3111.10Sdholland--------------------- 3121.10Sdholland 3131.10SdhollandWe would like to be able to read and write Linux ext3fs and ext4fs 3141.10Sdhollandvolumes. (We can already read clean ext3fs volumes as they're the same 3151.10Sdhollandas ext2fs, modulo volume features our ext2fs code does not support; 3161.10Sdhollandbut we can't write them.) 3171.10Sdholland 3181.10SdhollandIdeally someone would write ext3 and/or ext4 code, whether integrated 3191.10Sdhollandwith or separate from the ext2 code we already have. It might also 3201.10Sdhollandmake sense to port or wrap the Linux ext3 or ext4 code so it can be 3211.10Sdhollandloaded as a GPL'd kernel module; it isn't clear if that would be more 3221.10Sdhollandor less work than doing an implementation. 3231.10Sdholland 3241.10SdhollandNote however that implementing ext3 has already defeated several 3251.10Sdhollandpeople; this is a harder project than it looks. 3261.10Sdholland 3271.17Sjdolecek - GSoc 2016 brought support for extents, and also ro support for dir 3281.17Sjdolecek hashes; jdolecek also implemented several frequently used ext4 features 3291.17Sjdolecek so most contemporary ext filesystems should be possible to mount 3301.17Sjdolecek read-write 3311.17Sjdolecek - still need rw dir_nhash and xattr (semi-easy), and eventually journalling 3321.17Sjdolecek (hard) 3331.10Sdholland - There is no clear timeframe or release target. 3341.17Sjdolecek - jdolecek is working on improving ext3/ext4 support (particularily 3351.17Sjdolecek journalling) 3361.10Sdholland 3371.10Sdholland 3381.11Sdholland14. Port hammer from Dragonfly 3391.10Sdholland------------------------------ 3401.10Sdholland 3411.10SdhollandWhile the motivation for and role of hammer isn't perhaps super 3421.10Sdhollandpersuasive, it would still be good to have it. Porting it from 3431.10SdhollandDragonfly is probably not that painful (compared to, say, zfs) but as 3441.10Sdhollandthe Dragonfly and NetBSD VFS layers have diverged in different 3451.10Sdhollanddirections from the original 4.4BSD, may not be entirely trivial 3461.10Sdhollandeither. 3471.10Sdholland 3481.21Sdholland - As of January 2017 nobody is known to be working on this. 3491.10Sdholland - There is no clear timeframe or release target. 3501.10Sdholland - There probably isn't any particular person to contact; for VFS 3511.10Sdholland concerns contact dholland or hannken. 3521.10Sdholland 3531.10Sdholland 3541.11Sdholland15. afs maintenance 3551.10Sdholland------------------- 3561.10Sdholland 3571.10SdhollandAFS needs periodic care and feeding to continue working as NetBSD 3581.10Sdhollandchanges, because the kernel-level bits aren't kept in the NetBSD tree 3591.10Sdhollandand don't get updated with other things. This is an ongoing issue that 3601.10Sdhollandalways seems to need more manpower than it gets. It might make sense 3611.10Sdhollandto import some of the kernel AFS code, or maybe even just some of the 3621.10Sdhollandglue layer that it uses, in order to keep it more current. 3631.10Sdholland 3641.10Sdholland - jakllsch sometimes works on this. 3651.10Sdholland - We would like every release to have working AFS by the time it's 3661.10Sdholland released. 3671.10Sdholland - Contact jakllsch or gendalia about AFS; for VFS concerns contact 3681.10Sdholland dholland or hannken. 3691.10Sdholland 3701.10Sdholland 3711.11Sdholland16. execute-in-place 3721.10Sdholland-------------------- 3731.10Sdholland 3741.10SdhollandIt is likely that the future includes non-volatile storage (so-called 3751.10Sdholland"nvram") that looks like RAM from the perspective of software. Most 3761.10Sdhollandimportantly: the storage is memory-mapped rather than looking like a 3771.10Sdhollanddisk controller. There are a number of things NetBSD ought to have to 3781.10Sdhollandbe ready for this, of which probably the most important is 3791.10Sdholland"execute-in-place": when an executable is run from such storage, and 3801.10Sdhollandmapped into user memory with mmap, the storage hardware pages should 3811.10Sdhollandbe able to appear directly in user memory. Right now they get 3821.10Sdhollandgratuitously copied into RAM, which is slow and wasteful. There are 3831.10Sdhollandalso other reasons (e.g. embedded device ROMs) to want execute-in- 3841.10Sdhollandplace support. 3851.10Sdholland 3861.10SdhollandNote that at the implementation level this is a UVM issue rather than 3871.10Sdhollandstrictly a storage issue. 3881.10Sdholland 3891.10SdhollandAlso note that one does not need access to nvram hardware to work on 3901.10Sdhollandthis issue; given the performance profiles touted for nvram 3911.10Sdhollandtechnologies, a plain RAM disk like md(4) is sufficient both 3921.10Sdhollandstructurally and for performance analysis. 3931.10Sdholland 3941.21Sdholland - As of January 2017 nobody is known to be working on this. Some 3951.10Sdholland time back, uebayasi wrote some preliminary patches, but they were 3961.10Sdholland rejected by the UVM maintainers. 3971.10Sdholland - There is no clear timeframe or release target. 3981.10Sdholland - Contact dholland for further information. 3991.10Sdholland 4001.10Sdholland 4011.15Schristos17. use extended attributes for ACL and capability storage 4021.15Schristos---------------------------------------------------------- 4031.15Schristos 4041.15SchristosCurrently there is some support for extended attributes in ffs, 4051.15Schristosbut nothing really uses it. I would be nice if we came up with 4061.15Schristosa standard format to store ACL's and capabilities like Linux has. 4071.15SchristosThe various tools must be modified to understand this and be able 4081.15Schristosto copy them if requested. Also tools to manipulate the data will 4091.15Schristosneed to be written. 4101.15Schristos 4111.21Sdholland 4121.15Schristos18. coda maintenance 4131.10Sdholland-------------------- 4141.10Sdholland 4151.10SdhollandCoda only sort of works. [And I think it's behind relative to 4161.10Sdhollandupstream, or something of the sort; XXX fill this in.] Also the code 4171.10Sdhollandappears to have an ugly incestuous relationship with FFS. This should 4181.10Sdhollandreally be cleaned up. That or maybe it's time to remove Coda. 4191.10Sdholland 4201.21Sdholland - As of January 2017 nobody is known to be working on this. 4211.10Sdholland - There is no clear timeframe or release target. 4221.10Sdholland - There isn't anyone in particular to contact. 4231.15Schristos - Circa 2012 christos made it work read-write and split it 4241.15Schristos into modules. Since then christos has not tested it. 4251.9Sagc 4261.21Sdholland 4271.9SagcAlistair Crooks, David Holland 4281.10SdhollandFri Nov 20 02:17:53 EST 2015 4291.12SdhollandSun May 1 16:50:42 EDT 2016 (some updates) 4301.21SdhollandFri Jan 13 00:40:50 EST 2017 (some more updates) 4311.12Sdholland 432