[PATCH v2 0/2] ceph: lazy I/O write and LAZYIO revoke fixes

From: Xiubo Li via B4 Relay

Date: Tue Nov 10 2026 - 07:21:29 EST


Two lazy I/O changes on top of the lazy I/O series already in testing.

Patch 1 stops a buffered lazy I/O write into part of a folio that is
not uptodate from reading the folio in first. That read is done
synchronously under i_rwsem and serialises every writer of a shared
file on the client; with lazy I/O only the dirty range of the folio
goes out, so the read buys nothing. 16 writers on 4 clients writing
47008-byte records into one shared file go from 0.27 to 0.71 GiB/s.

Patch 2 makes ceph_adjust_caps_used_for_lazyio() move a use to LAZYIO
only when that use is in the used set and its cap is not issued.
Otherwise a file with only clean cached pages holds a LAZYIO revoke
until the delayed cap check, up to 60 s, and a getattr from another
client waits that long.

Signed-off-by: Xiubo Li <xiubo.li@xxxxxxxxx>
---
Changes in v2:
- Patch 1: always install the dirty range on a folio that was not read
in, even if folio_maybe_dma_pinned() reports a pin; a folio that was
never mapped cannot be pinned, and a refcount false positive sent its
unread bytes to the OSD (Alex).
- Patch 1: accept and report a short copy into such a folio instead of
returning 0; the copied bytes could already have replaced bytes of an
earlier write in the dirty range, and a failing retry wrote them back
without reporting them (Alex).
- Link to v1: https://patch.msgid.link/20261107-ceph-lazyio-noread-v1-0-d04369c70ab7@xxxxxxxxx

To: Ilya Dryomov <idryomov@xxxxxxxxx>
To: Alex Markuze <amarkuze@xxxxxxxxxx>
To: Xiubo Li <xiubo.li@xxxxxxxxx>
To: Viacheslav Dubeyko <slava@xxxxxxxxxxx>
Cc: ceph-devel@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx

---
Xiubo Li (2):
ceph: don't read a folio in for a partial lazy I/O write
ceph: do not hold a LAZYIO revoke for pages that CACHE covers

fs/ceph/addr.c | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
fs/ceph/caps.c | 11 +++-
2 files changed, 174 insertions(+), 16 deletions(-)
---
base-commit: 5dcec86cc31f8144857c0d9bf2a7fa13b6e6f531
change-id: 20261107-ceph-lazyio-noread-087d6b8ccc9d

Best regards,
--
Xiubo Li <xiubo.li@xxxxxxxxx>