linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v9 00/15] large atomic writes for xfs
@ 2025-04-25 16:44 John Garry
  2025-04-25 16:44 ` [PATCH v9 01/15] fs: add atomic write unit max opt to statx John Garry
                   ` (15 more replies)
  0 siblings, 16 replies; 32+ messages in thread
From: John Garry @ 2025-04-25 16:44 UTC (permalink / raw)
  To: brauner, djwong, hch, viro, jack, cem
  Cc: linux-fsdevel, dchinner, linux-xfs, linux-kernel, ojaswin,
	ritesh.list, martin.petersen, linux-ext4, linux-block,
	catherine.hoang, linux-api, John Garry

Currently atomic write support for xfs is limited to writing a single
block as we have no way to guarantee alignment and that the write covers
a single extent.

This series introduces a method to issue atomic writes via a
software-based method.

The software-based method is used as a fallback for when attempting to
issue an atomic write over misaligned or multiple extents.

For xfs, this support is based on reflink CoW support.

The basic idea of this CoW method is to alloc a range in the CoW fork,
write the data, and atomically update the mapping.

Initial mysql performance testing has shown this method to perform ok.
However, there we are only using 16K atomic writes (and 4K block size),
so typically - and thankfully - this software fallback method won't be
used often.

For other FSes which want large atomics writes and don't support CoW, I
think that they can follow the example in [0].

Catherine is currently working on further xfstests for this feature,
which we hope to share soon.

Based on f0447f80aec8 (xfs/next-rc, xfs/for-next) xfs: remove
duplicate Zoned Filesystems sections in admin-guide

[0] https://lore.kernel.org/linux-xfs/20250310183946.932054-1-john.g.garry@oracle.com/

Differences to v8:
- Darrick reworked patch for mount option
- Darrick reworked patch to ignore HW
- Minor changes and cleanups from Darrick
- Rework some commit messages (Christoph)
- Pick up RB tags from Christoph (thanks!)

Differences to v7:
- Add patch for mp hw awu max and min
- Fixed for awu max mount option (Darrick)

Differences to v6:
- log item sizes updates (Darrick)
- rtvol support (Darrick)
- mount option for atomic writes (Darrick)
- Add RB tags from Darrick and Christoph (Thanks!)

Darrick J. Wong (4):
  xfs: add helpers to compute log item overhead
  xfs: add helpers to compute transaction reservation for finishing
    intent items
  xfs: ignore HW which cannot atomic write a single block
  xfs: allow sysadmins to specify a maximum atomic write limit at mount
    time

John Garry (11):
  fs: add atomic write unit max opt to statx
  xfs: rename xfs_inode_can_atomicwrite() ->
    xfs_inode_can_hw_atomic_write()
  xfs: allow block allocator to take an alignment hint
  xfs: refactor xfs_reflink_end_cow_extent()
  xfs: refine atomic write size check in xfs_file_write_iter()
  xfs: add xfs_atomic_write_cow_iomap_begin()
  xfs: add large atomic writes checks in xfs_direct_write_iomap_begin()
  xfs: commit CoW-based atomic writes atomically
  xfs: add xfs_file_dio_write_atomic()
  xfs: add xfs_compute_atomic_write_unit_max()
  xfs: update atomic write limits

 Documentation/admin-guide/xfs.rst |  11 +
 block/bdev.c                      |   3 +-
 fs/ext4/inode.c                   |   2 +-
 fs/stat.c                         |   6 +-
 fs/xfs/libxfs/xfs_bmap.c          |   5 +
 fs/xfs/libxfs/xfs_bmap.h          |   6 +-
 fs/xfs/libxfs/xfs_log_rlimit.c    |   4 +
 fs/xfs/libxfs/xfs_trans_resv.c    | 343 +++++++++++++++++++++++++++---
 fs/xfs/libxfs/xfs_trans_resv.h    |  25 +++
 fs/xfs/xfs_bmap_item.c            |  10 +
 fs/xfs/xfs_bmap_item.h            |   3 +
 fs/xfs/xfs_buf.c                  |  41 +++-
 fs/xfs/xfs_buf.h                  |   3 +-
 fs/xfs/xfs_buf_item.c             |  19 ++
 fs/xfs/xfs_buf_item.h             |   3 +
 fs/xfs/xfs_extfree_item.c         |  10 +
 fs/xfs/xfs_extfree_item.h         |   3 +
 fs/xfs/xfs_file.c                 |  87 +++++++-
 fs/xfs/xfs_inode.h                |  14 +-
 fs/xfs/xfs_iomap.c                | 190 ++++++++++++++++-
 fs/xfs/xfs_iomap.h                |   1 +
 fs/xfs/xfs_iops.c                 |  76 ++++++-
 fs/xfs/xfs_iops.h                 |   3 +
 fs/xfs/xfs_log_cil.c              |   4 +-
 fs/xfs/xfs_log_priv.h             |  13 ++
 fs/xfs/xfs_mount.c                | 166 +++++++++++++++
 fs/xfs/xfs_mount.h                |  17 ++
 fs/xfs/xfs_refcount_item.c        |  10 +
 fs/xfs/xfs_refcount_item.h        |   3 +
 fs/xfs/xfs_reflink.c              | 146 ++++++++++---
 fs/xfs/xfs_reflink.h              |   6 +
 fs/xfs/xfs_rmap_item.c            |  10 +
 fs/xfs/xfs_rmap_item.h            |   3 +
 fs/xfs/xfs_super.c                |  58 ++++-
 fs/xfs/xfs_trace.h                | 115 ++++++++++
 include/linux/fs.h                |   3 +-
 include/linux/stat.h              |   1 +
 include/uapi/linux/stat.h         |   8 +-
 38 files changed, 1322 insertions(+), 109 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2025-05-01 19:53 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25 16:44 [PATCH v9 00/15] large atomic writes for xfs John Garry
2025-04-25 16:44 ` [PATCH v9 01/15] fs: add atomic write unit max opt to statx John Garry
2025-04-25 16:44 ` [PATCH v9 02/15] xfs: add helpers to compute log item overhead John Garry
2025-04-25 16:44 ` [PATCH v9 03/15] xfs: add helpers to compute transaction reservation for finishing intent items John Garry
2025-04-25 16:44 ` [PATCH v9 04/15] xfs: rename xfs_inode_can_atomicwrite() -> xfs_inode_can_hw_atomic_write() John Garry
2025-04-25 16:44 ` [PATCH v9 05/15] xfs: ignore HW which cannot atomic write a single block John Garry
2025-04-29 12:21   ` Christoph Hellwig
2025-04-29 14:44     ` Darrick J. Wong
2025-04-30 12:59       ` Christoph Hellwig
2025-05-01 16:22         ` Darrick J. Wong
2025-05-01 19:53           ` Darrick J. Wong
2025-04-30  5:18   ` [PATCH v9.1 " Darrick J. Wong
2025-04-25 16:44 ` [PATCH v9 06/15] xfs: allow block allocator to take an alignment hint John Garry
2025-04-25 16:44 ` [PATCH v9 07/15] xfs: refactor xfs_reflink_end_cow_extent() John Garry
2025-04-25 16:44 ` [PATCH v9 08/15] xfs: refine atomic write size check in xfs_file_write_iter() John Garry
2025-04-25 16:44 ` [PATCH v9 09/15] xfs: add xfs_atomic_write_cow_iomap_begin() John Garry
2025-04-25 16:44 ` [PATCH v9 10/15] xfs: add large atomic writes checks in xfs_direct_write_iomap_begin() John Garry
2025-04-25 16:45 ` [PATCH v9 11/15] xfs: commit CoW-based atomic writes atomically John Garry
2025-04-25 16:45 ` [PATCH v9 12/15] xfs: add xfs_file_dio_write_atomic() John Garry
2025-04-25 16:45 ` [PATCH v9 13/15] xfs: add xfs_compute_atomic_write_unit_max() John Garry
2025-04-30  7:52   ` John Garry
2025-05-01  4:30     ` Darrick J. Wong
2025-05-01  5:00       ` John Garry
2025-05-01 16:23         ` Darrick J. Wong
2025-04-25 16:45 ` [PATCH v9 14/15] xfs: update atomic write limits John Garry
2025-04-25 16:45 ` [PATCH v9 15/15] xfs: allow sysadmins to specify a maximum atomic write limit at mount time John Garry
2025-04-29 12:22   ` Christoph Hellwig
2025-04-29 14:38     ` Darrick J. Wong
2025-04-30 14:14 ` [PATCH v9 00/15] large atomic writes for xfs John Garry
2025-05-01  4:31   ` Darrick J. Wong
2025-05-01  5:04     ` John Garry
2025-05-01 13:44   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).