Enhancing Zoned Storage Support On FreeBSD
Student: Sylvia Dumbrava (SylviaDumbrava)
Mentors: Alan Somers (AlanSomers), Robert Clausecker (RobertClausecker), Kenneth Merry (KenMerry)
Project description
This project aims at improving the Zoned Storage (ZS) landscape in FreeBSD by implementing (or extending) several features. Such features include emulation of ZS (similarly to Linux's null_blk driver) backed by a GEOM provider, ZNS support and extended utilities to account for ZS.
Approach to solving the problem
Implementing ZNS
The ZNS implementation would mostly follow Kenneth Merry's 2016 work on SMR storage, extending the existing zone model and implementing the new command sets. The nda(4) driver will be the main recipient of ZNS changes due to nvd(4)'s barebones nature.
Implementing emulated Zoned Storage
Emulation of Zoned Storage, backed by regular drives, is implemented thanks to a new gzoned(8) GEOM driver. The driver allows for the configuration of zones sizes (currently all of which sequential-only) spanning an entire drive.
Drives must be set-up for zoning through the geom zoned create command, whose workings resemble gstripe(8) (e.g. metadata set-up and making it persistent).
Extending existing tools
As of today, some tools like the GEOM class gpart(8) are not designed to handle ZS properly. An example of this is the inability of applying the GPT partitioning scheme to a zoned device, with gpart attempting to write the primary partition table in a non-strictly-ascending LBA order, along with the GPT backup partition table on sequential-write-required zones at the end of the drive (the write pointer would have to jump at the end of the drive).
Problems regarding such utilities can be handled based on existing bugs or possible use-cases related to ZS.
Deliverables
- Implementing ZNS support.
Emulating zoned drives backed by regular storage (gzoned(8)).
Extending existing tools e.g. gpart(8), gmirror(8) and gconcat(8) for better handling of Zoned Storage.
Milestones
- May 26st: Start of coding and further code exploration.
- July 4th: gzoned(8) driver implemented.
- July 9th: gpart(8) and gmirror(8) extended for ZS.
- July 20th: gconcat(8) extended for ZS.
- August 10th: ZNS implemented.
- August 15th: All tests pass w.r.t implemented features.
- August 20th: Documentation/manual pages complete.
- August 24th: End of coding (hard).
Test Plan
Testing is done through Kyua + ATF-sh(3) e.g. kyua test -k /usr/tests/sys/geom/class/zoned/Kyuafile; used to verify functionality and zone model conformance without affecting other tests.
Many thanks to AlanSomers for the test stubs and guidance!
The Code
GitHub: https://github.com/voidanix/freebsd-src.git
Notes
Current feature status:
Feature
Status
Notes
Implement gzoned(8)
Done
Extend gzoned(8) for conventional zones
Done
Extend gpart(8)
In-Progress
Extending for GPT only
Extend gmirror(8)
In-Progress
Extend gconcat(8)
Not started
ZNS support
In-Progress
Currently testing with QEMU's NVMe/ZNS emulator
Current tests status:
Test
Status
Notes
gzoned(8)
Done
gpart(8)
In-Progress
gmirror(8)
Not started
gconcat(8)
Not started
ZNS
Not started
Useful links
Linux null_blk zoning implementation
Introduction of SMR support in FreeBSD
GEOM BIO controlling functions
Introduction to writing GEOM classes