Zone Finish
Zone Finish is a zone management operation that moves a sequential zone to the Full state, so the zone accepts no further writes until it is reset.
In the NVMe Zoned Namespace command set, Finish Zone is Zone Send Action 02h of the Zone Management Send command. A zone in the Empty, Implicitly Opened, Explicitly Opened or Closed state moves to Full, a Full zone stays unchanged, and a Read Only or Offline zone makes the command abort with Invalid Zone State Transition. With Select All set, every opened or closed zone is finished and Empty zones are left alone. [2]
Completion releases the Active and Open Resources the zone held. When the active zone limit is reached, host software must finish or reset some active zones before it can choose other zones for new data, and finishing is the option that keeps the written blocks readable. The blocks between the write pointer and the zone capacity stay unusable until a reset returns the whole zone to Empty. [2] [1]
A controller that plans background work on an open or closed zone may set the Finish Zone Recommended attribute with a time limit in seconds, and the namespace-wide Finish Recommended Limit occupies bytes 19:16 of the zoned Identify Namespace data. A separate Zone Active Excursion lets the controller finish a zone itself and set the Zone Finished by Controller bit. [2]
On Linux, the BLKFINISHZONE ioctl, available since kernel 5.5, finishes a zone-aligned range given in 512-byte sectors. One documented NVMe ZNS device reports 14 open and 14 active zones, and one host-managed SMR disk uses 256 MiB zones of 524,288 sectors. [4]
Relations
- related
- Zoned namespaces (ZNS), Zone capacity, Zone write pointer, Zone Reset, Active-zone limit, Open-zone limit, Zoned block device (ZBD), zonefs
Advantages
- Finish is accepted on an Empty zone, so a host can retire a zone to Full without writing data into it. [2]
Limitations
- Data that must survive has to be copied out of a finished zone before the reset that reclaims its unused tail, because a reset makes every block written to the zone inaccessible. [1]
- A reset clears the Finish Zone Recommended and Zone Finished by Controller attributes, so a host that wants to know why a zone became Full has to read the zone descriptor before resetting it. [2]
Citations
- Western Digital, Zoned Storage: zone management commands and state transitions.
- NVM Express, Zoned Namespace Command Set Specification, revision 1.1 (18 May 2021), sections 3.4.3.1.2, 5.5, 5.6 and Annex A.3.4.
- Zoned Storage documentation: Zoned Block Device User Interface, sysfs attributes and ioctl commands.
Further reading
Sources & caveats
- zns-spec is NVM Express Zoned Namespace Command Set revision 1.1, Copyright 2007-2021 NVM Express, Inc., read in sections 3.4.3.1.2, 3.4.3.1.4, 5.5, 5.6, Figure 48 and Annex A.3.4.
- zoned-overview and zbd-api are pages of the zonedstorage.io documentation site published by Western Digital, read in full.
- The 14-zone limits and the 256 MiB zone size are example outputs for single devices in zbd-api, not values required by any standard.
- ZBC and ZAC define a FINISH ZONE command for SMR disks, and their section numbers were not checked because those standards are not openly published.