{
  "slug": "xfs-delayed-logging",
  "term": "XFS delayed logging",
  "aliases": [],
  "definition": "XFS delayed logging tracks changed metadata in memory and writes only the latest aggregated copy of each item to the journal at checkpoints.",
  "note": "Without delayed logging, every relogged object is formatted into the log buffers again, so repeated changes to the same objects can make stale copies take over 90% of the space used there. Delayed logging keeps changed items in memory, in the committed item list or CIL, and formats only the current state of each item when a checkpoint is written. [design]\n\nThe cited v6.16 source pushes the CIL in the background once it reaches the smaller of 12.5% of the log or 16 times the log buffer window, 32 MB by its comment, and throttles new commits at twice that size. Per-CPU counters and item lists are merged when the CIL is pushed. [limits] [code]\n\nDo not equate an in-memory commit with persistence. Older logging left at most about 2 MB of changes unwritten, while delayed logging can hold far more, so a crash may lose many thousands of committed transactions even though recovery still yields a consistent filesystem. [design] The FAST 2022 study measured kernel 5.8.5, not the cited v6.16 source. [paper]",
  "status": "shipping",
  "advantages": [
    {
      "text": "Repeated changes to the same metadata objects cost far less log bandwidth, because stale intermediate copies are never written.",
      "citationIds": [
        "design"
      ]
    }
  ],
  "limitations": [
    {
      "text": "Applications that need their changes durable must still force the log, for example with fsync(), since a commit alone stays in memory.",
      "citationIds": [
        "design"
      ]
    },
    {
      "text": "At high concurrency, CIL lock contention was found to be the main scalability bottleneck in the measured kernel.",
      "citationIds": [
        "paper"
      ]
    }
  ],
  "related": [
    "xfs-cil",
    "xfs-ail",
    "journal-checkpoint",
    "logical-journaling",
    "xfs-relogging",
    "xfs-deferred-operation",
    "xfs"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "design",
      "title": "Linux v6.16: XFS Logging Design, asynchronous transactions, checkpoints and item lifecycle",
      "url": "https://github.com/torvalds/linux/blob/v6.16/Documentation/filesystems/xfs/xfs-delayed-logging-design.rst",
      "accessed": "2026-10-22"
    },
    {
      "id": "code",
      "title": "Linux v6.16: xfs_log_cil.c, per-CPU insertion, aggregation and asynchronous flush",
      "url": "https://github.com/torvalds/linux/blob/v6.16/fs/xfs/xfs_log_cil.c",
      "accessed": "2026-10-22"
    },
    {
      "id": "hesela-xfs",
      "title": "Hesela: XFS delayed logging and commit boundaries",
      "url": "https://hesela.com/analyses/xfs-delayed-logging-commit-boundaries/",
      "accessed": "2026-10-15"
    },
    {
      "id": "paper",
      "title": "Kim, Min, Oh and Won. ScaleXFS: Getting scalability of XFS back on the ring. FAST 2022, pp. 329-344.",
      "url": "https://www.usenix.org/system/files/fast22-kim.pdf",
      "accessed": "2026-10-22"
    },
    {
      "id": "limits",
      "title": "Linux v6.16: xfs_log_priv.h, CIL background push and blocking space limits",
      "url": "https://github.com/torvalds/linux/blob/v6.16/fs/xfs/xfs_log_priv.h",
      "accessed": "2026-10-22"
    }
  ],
  "updated": "2026-10-24",
  "provenance": [
    "design is the Linux v6.16 XFS Logging Design document, read in the sections on relogging, delayed logging concepts, log space accounting and concurrency.",
    "limits is xfs_log_priv.h at v6.16, read in the CIL space limit comment and macros. code is xfs_log_cil.c at v6.16, read in the per-CPU aggregation and push functions.",
    "paper is the FAST 2022 ScaleXFS paper by Kim, Min, Oh and Won, read in its introduction and lock-contention analysis.",
    "90%, about 2 MB and the crash consequence come from design. 12.5%, 16 times, 32 MB and the 2x throttle come from limits. Kernel 5.8.5 and the lock finding come from paper."
  ]
}
