linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 00/10] large atomic writes for xfs with CoW
@ 2025-03-10 18:39 John Garry
  2025-03-10 18:39 ` [PATCH v5 01/10] xfs: Pass flags to xfs_reflink_allocate_cow() John Garry
                   ` (9 more replies)
  0 siblings, 10 replies; 63+ messages in thread
From: John Garry @ 2025-03-10 18:39 UTC (permalink / raw)
  To: brauner, djwong, cem
  Cc: linux-xfs, linux-fsdevel, linux-kernel, ojaswin, ritesh.list,
	martin.petersen, 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
emulated method.

The software emulated 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 CoW.

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].

Based on 32f6987f9384 (xfs/for-next) Merge branch 'xfs-6.15-merge' into for-next

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

Differences to v4:
- Omit iomap patches which have already been queued
- Add () in xfs_bmap_compute_alignments() (Dave)
- Rename awu_max -> m_awu_max (Carlos)
- Add RFC to change IOMAP flag names
- Rebase

Differences to v3:
- Error !reflink in xfs_atomic_write_sw_iomap_begin() (Darrick)
- Fix unused variable (kbuild bot)
- Add RB tags from Darrick (Thanks!)

Differences to v2:
(all from Darrick)
- Add dedicated function for xfs iomap sw-based atomic write
- Don't ignore xfs_reflink_end_atomic_cow() -> xfs_trans_commit() return
  value
- Pass flags for reflink alloc functions
- Rename IOMAP_ATOMIC_COW -> IOMAP_ATOMIC_SW
- Coding style corrections and comment improvements
- Add RB tags (thanks!)

John Garry (10):
  xfs: Pass flags to xfs_reflink_allocate_cow()
  xfs: Switch atomic write size check in xfs_file_write_iter()
  xfs: Refactor xfs_reflink_end_cow_extent()
  xfs: Reflink CoW-based atomic write support
  xfs: Iomap SW-based atomic write support
  xfs: Add xfs_file_dio_write_atomic()
  xfs: Commit CoW-based atomic writes atomically
  xfs: Update atomic write max size
  xfs: Allow block allocator to take an alignment hint
  iomap: Rename ATOMIC flags again

 .../filesystems/iomap/operations.rst          |   6 +-
 fs/ext4/inode.c                               |   2 +-
 fs/iomap/direct-io.c                          |  18 +--
 fs/iomap/trace.h                              |   3 +-
 fs/xfs/libxfs/xfs_bmap.c                      |   4 +
 fs/xfs/libxfs/xfs_bmap.h                      |   6 +-
 fs/xfs/xfs_file.c                             |  61 +++++++-
 fs/xfs/xfs_iomap.c                            | 144 ++++++++++++++++-
 fs/xfs/xfs_iomap.h                            |   1 +
 fs/xfs/xfs_iops.c                             |  32 +++-
 fs/xfs/xfs_iops.h                             |   2 +
 fs/xfs/xfs_mount.c                            |  28 ++++
 fs/xfs/xfs_mount.h                            |   1 +
 fs/xfs/xfs_reflink.c                          | 145 +++++++++++++-----
 fs/xfs/xfs_reflink.h                          |  11 +-
 include/linux/iomap.h                         |  10 +-
 16 files changed, 400 insertions(+), 74 deletions(-)

-- 
2.31.1


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

end of thread, other threads:[~2025-03-22  5:19 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-10 18:39 [PATCH v5 00/10] large atomic writes for xfs with CoW John Garry
2025-03-10 18:39 ` [PATCH v5 01/10] xfs: Pass flags to xfs_reflink_allocate_cow() John Garry
2025-03-12  7:15   ` Christoph Hellwig
2025-03-12  8:19     ` John Garry
2025-03-10 18:39 ` [PATCH v5 02/10] xfs: Switch atomic write size check in xfs_file_write_iter() John Garry
2025-03-12  7:17   ` Christoph Hellwig
2025-03-12  8:21     ` John Garry
2025-03-10 18:39 ` [PATCH v5 03/10] xfs: Refactor xfs_reflink_end_cow_extent() John Garry
2025-03-12  7:24   ` Christoph Hellwig
2025-03-12  8:27     ` John Garry
2025-03-12  8:35       ` Christoph Hellwig
2025-03-12 15:46         ` Darrick J. Wong
2025-03-12 22:06           ` John Garry
2025-03-12 23:22             ` Darrick J. Wong
2025-03-13  1:25           ` Dave Chinner
2025-03-13  4:51             ` Darrick J. Wong
2025-03-13  6:11               ` John Garry
2025-03-18  0:43                 ` Dave Chinner
2025-03-13  7:21               ` Dave Chinner
2025-03-22  5:19                 ` Darrick J. Wong
2025-03-10 18:39 ` [PATCH v5 04/10] xfs: Reflink CoW-based atomic write support John Garry
2025-03-12  7:27   ` Christoph Hellwig
2025-03-12  9:13     ` John Garry
2025-03-12 13:45       ` Christoph Hellwig
2025-03-12 14:48         ` John Garry
2025-03-10 18:39 ` [PATCH v5 05/10] xfs: Iomap SW-based " John Garry
2025-03-12  7:37   ` Christoph Hellwig
2025-03-12  9:00     ` John Garry
2025-03-12 13:52       ` Christoph Hellwig
2025-03-12 14:57         ` John Garry
2025-03-12 15:55           ` Christoph Hellwig
2025-03-12 16:11             ` John Garry
2025-03-10 18:39 ` [PATCH v5 06/10] xfs: Add xfs_file_dio_write_atomic() John Garry
2025-03-10 18:39 ` [PATCH v5 07/10] xfs: Commit CoW-based atomic writes atomically John Garry
2025-03-12  7:39   ` Christoph Hellwig
2025-03-12  9:04     ` John Garry
2025-03-12 13:54       ` Christoph Hellwig
2025-03-12 15:01         ` John Garry
2025-03-10 18:39 ` [PATCH v5 08/10] xfs: Update atomic write max size John Garry
2025-03-11 14:40   ` Carlos Maiolino
2025-03-12  7:41   ` Christoph Hellwig
2025-03-12  8:09     ` John Garry
2025-03-12  8:13       ` Christoph Hellwig
2025-03-12  8:14         ` John Garry
2025-03-10 18:39 ` [PATCH v5 09/10] xfs: Allow block allocator to take an alignment hint John Garry
2025-03-12  7:42   ` Christoph Hellwig
2025-03-12  8:05     ` John Garry
2025-03-12 13:45       ` Christoph Hellwig
2025-03-12 14:47         ` John Garry
2025-03-12 16:00         ` Darrick J. Wong
2025-03-12 16:28           ` John Garry
2025-03-10 18:39 ` [PATCH RFC v5 10/10] iomap: Rename ATOMIC flags again John Garry
2025-03-12  7:13   ` Christoph Hellwig
2025-03-12 23:59     ` Dave Chinner
2025-03-13  6:28       ` John Garry
2025-03-13  7:02         ` Christoph Hellwig
2025-03-13  7:41           ` John Garry
2025-03-13  7:49             ` Christoph Hellwig
2025-03-13  7:53               ` John Garry
2025-03-13  8:09                 ` Christoph Hellwig
2025-03-13  8:18                   ` Christoph Hellwig
2025-03-13  8:24                     ` John Garry
2025-03-13  8:28                     ` 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).