{
  "slug": "zone-write-locking",
  "term": "Zone write locking",
  "aliases": [],
  "definition": "A Linux mechanism that serializes covered write requests to the same sequential zone using a per-zone lock.",
  "note": "The upstream Linux 4.16-6.9 implementation resides in deadline or mq-deadline. Zone write plugging replaces it from Linux 6.10. This is not a global I/O order, a device ownership lock or a persistence guarantee, and callers still supply valid offsets. [linux-ordering-docs]\n\nIn Linux 6.9 the block layer keeps one lock bit per sequential zone. The scheduler sets the bit with a test-and-set when it dispatches a write and clears it on completion, so a second write to that zone waits while reads are not serialized. [blk-zoned-69] [linux69-deadline]\n\nThe first version, in kernel 4.10, lived in the SCSI disk driver, where a locked write stalled the whole dispatch queue including reads and an asynchronous sequential write stream ran at queue depth one. Kernel 4.16 moved it into the deadline and mq-deadline schedulers, which also brought multi-queue support. [linux-ordering-docs]",
  "status": "shipping",
  "advantages": [
    {
      "text": "Writers that issue in order avoid unaligned write failures without relying on host adapter command ordering.",
      "citationIds": [
        "linux-ordering-docs"
      ]
    }
  ],
  "limitations": [
    {
      "text": "Enforcement depended on the deadline and mq-deadline schedulers rather than on the block layer as a whole.",
      "citationIds": [
        "linux-ordering-docs"
      ]
    },
    {
      "text": "Each zone has at most one write in flight, which caps per-zone write concurrency.",
      "citationIds": [
        "blk-zoned-69"
      ]
    }
  ],
  "related": [
    "zone-write-plugging",
    "zoned-block-device",
    "zone-write-pointer"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-22",
  "citations": [
    {
      "id": "linux-ordering-docs",
      "title": "Western Digital, Zoned Storage: Write Ordering Control; locking through Linux 6.9 and plugging from Linux 6.10.",
      "url": "https://zonedstorage.io/docs/linux/sched",
      "accessed": "2026-10-22"
    },
    {
      "id": "linux69-deadline",
      "title": "Linux v6.9, block/mq-deadline.c: deadline_fifo_request, deadline_next_request and request dispatch.",
      "url": "https://github.com/torvalds/linux/blob/v6.9/block/mq-deadline.c",
      "accessed": "2026-10-22"
    },
    {
      "id": "hesela-zns",
      "title": "Hesela: ZNS resource limits and worked examples",
      "url": "https://hesela.com/analyses/zns-open-active-zone-limits/",
      "accessed": "2026-10-16"
    },
    {
      "id": "blk-zoned-69",
      "title": "Linux v6.9 block/blk-zoned.c: per-zone write lock bitmap helpers",
      "url": "https://github.com/torvalds/linux/blob/v6.9/block/blk-zoned.c",
      "accessed": "2026-10-22"
    }
  ],
  "provenance": [
    "linux-ordering-docs is the Write Ordering Control page of the zoned storage documentation, reread on the access date.",
    "blk-zoned-69 is block/blk-zoned.c at tag v6.9, read in the blk_req_zone_write_* helpers and the seq_zones_wlock bitmap.",
    "linux69-deadline is block/mq-deadline.c at tag v6.9, read where dispatch calls blk_req_zone_write_lock.",
    "4.10, 4.16, 6.9, 6.10 and queue depth one come from linux-ordering-docs. One bit per zone comes from blk-zoned-69."
  ]
}
