Skip to content
Nick edited this page Sep 15, 2021 · 43 revisions

Zoned NameSpace (ZNS)

Resources

1. Zoned Storage Documentation. https://zonedstorage.io/
<a id="2">2.</a>
ZNS: Avoiding the Block Interface Tax for Flash-based SSDs. https://www.usenix.org/conference/atc21/presentation/bjorling

Overview

  • Address space is divided into zones, and zones need to be written sequentially with a write pointer that keeps track of the position for the next write. Data in a zone cannot be overwritten (zone must first be erased using zone reset)
  • SSDs implement zoned namespaces to reduce write amplification, reduce its onboard DRAM needs and improve QoS, with NVMe Zoned NameSpace (ZNS) protocol it is added to the NVMe interface standard. Shingled Magnetic Recording (SMR) can also implement zoned storage and uses the SCSI Zoned Block Commands (ZBC) and Zoned ATA Commands (ZAC) interfaces.
  • Zoned storage device added to Linux with 4.10.0 and supports (disk driver, file system, device mapper drivers), based on Zoned Block Device (ZBD) abstraction.
  • Ways of using zoned storage for applications:
    1. If the user has no need for OS or fs to manage the zoned storage, can directly issue zone management commands using a passthrough interface (with libzbz library).
    2. Can rely on Kernel ZBD support to handle device, it then provides regular POSIX system calls. (still keeps zoned access constraints application must handle, sequential and erase before rewrite).
    3. User more advanced Kernel ZBD compliant file system which hides all the constraints from the application (manages them itself), or by using a device mapper driver that will expose the device as a regular block device.

Small notes on Storage protocols:

  • SCSI (Small Computer System Interface) is the standards for data transfer between computer and peripherals, however it was designed for older devices such as HDDs therefore isn't optimal for flash based devices as it assumes those are HDDs (will follow certain access patterns). Therefore it is a legacy protocol. It is broader than ATA, as it can handle many storage devices (CD, DVD, Tape, etc.)
  • ATA (Advanced Technology Attachment) is the standards for connection storage devices to the computer, and was designed for HDDs.
  • SATA (Serial ATA) is the bus interface for connecting host bus adapters to storage devices. This is the connection interface and ATA is the protocol.
  • NVMe (Non-Volatile Memory Express) is the specification for accessing non-volatile memories (typically attached on PCIe). Eliminates the SCSI bottleneck of only having one command queue as it has up to 64K queues that can each hold 64K requests simultaneously.

SMR

  • SMR is used in HDDs to areal density. With it there are no gaps between the tracks on HDD tracks (as opposed to conventional magnetic recording, CMR which needs gaps to account for track miss registrations). Tracks are than written in an overlapping manner (think of it like roof shingles), data is written sequentially then overlapped with another track to shingle it, resulting in more data that can be placed on each magnetic surface. Recording head is only partially moved after writing, as the next track is partially overlapping with the previous one, then reading can be done on the partial view of the track that is "visible" (the part not overlapping), this is what saves the space as not the entire track needs to be visible to read it. Overlapping tracks are called bands.
  • Data therefore needs to be written sequentially, for overwriting the entire band needs to be rewritten. Random reads still perform as with CMR, making it good for large data storage and sequential workloads.
  • There are different command interface models:
    1. Host managed allows only for sequential write workloads, and gives control to host. No backwards compatibility with legacy storage stacks, host must handle write constraints. Device is split into many zones with most sequential zones and a few conventional zones (can be written random but are typically for metadata). Recovery of out of order writes (write pointer on device keeps track of next write location and throws error if invalid) must be handled by the host.
    2. Drive managed handles sequential write constraints, application can do sequential and random writes. Device deals with sequential write constraints internally.
    3. Host aware offers backward compatibility with regular HDDs but with same control as host managed model.
  • With SCSI and ATA standards, there are ZBC and ZAC, respectively, with the following zone management commands:
    • REPORT ZONES for discovery of zone organization, returning list of zone descriptors with starting LBA (logical block address), size, type and condition, as well the current position of the write pointer (in host managed/aware model).
    • RESET ZONE WRITE POINTER after this all data in zone is gone and the zone can be written to from the beginning again.
    • OPEN ZONE indicate to drive that resources should be available to write to this zone until it is closed or fully written to.
    • CLOSE ZONE closes a zone.
    • FINISH ZONE move the write pointer of a zone to the end to prevent any more writing in the zone.

ZNS SSDs

  • The SSD is groupred into zones, can be read out of order but must be written sequentially. With the zone abstraction the host can align the writes to sequential writes, improving performance and optimizing data placement on the storage medium. Media reliability is still managed by the device, as with conventional devices.
  • ZNS does not support the random write zones (as ZBC and ZAC do), since NVMe supports multiple namespaces and can then expose another namespace that provides the I/O access.
  • It also includes a ZONE CAPACITY attribute that indicates the number of usable blocks within a zone.
  • It may define a limit on the number of active zones (open or currently being written to or partially written). This is so an application cannot take all the zones, and once it reaches its limit it must reset or finish its active zones.
  • Since NVMe can reorder write operations (that the host issued sequentially) from all the queues, which would result in errors because then it would be a random write, therefore there is a ZONE APPEND operation that will specify the first logical block of a zone as the write position and the device controller will write the data within the specified zone but at the current zone write pointer. This allows for submitting simultaneous append operations that the device can process in any order. (Write position of the request will be returned by the append operation, so you will always know the location.)

Paper notes [2], more detailed:

Setup Commands

Commands for setting up emulation of ZNS SSD with qemu.

Clone this wiki locally