linux-stable/fs/ceph
David Howells 100ccd18bb netfs: Optimise away reads above the point at which there can be no data
Track the file position above which the server is not expected to have any
data (the "zero point") and preemptively assume that we can satisfy
requests by filling them with zeroes locally rather than attempting to
download them if they're over that line - even if we've written data back
to the server.  Assume that any data that was written back above that
position is held in the local cache.  Note that we have to split requests
that straddle the line.

Make use of this to optimise away some reads from the server.  We need to
set the zero point in the following circumstances:

 (1) When we see an extant remote inode and have no cache for it, we set
     the zero_point to i_size.

 (2) On local inode creation, we set zero_point to 0.

 (3) On local truncation down, we reduce zero_point to the new i_size if
     the new i_size is lower.

 (4) On local truncation up, we don't change zero_point.

 (5) On local modification, we don't change zero_point.

 (6) On remote invalidation, we set zero_point to the new i_size.

 (7) If stored data is discarded from the pagecache or culled from fscache,
     we must set zero_point above that if the data also got written to the
     server.

 (8) If dirty data is written back to the server, but not fscache, we must
     set zero_point above that.

 (9) If a direct I/O write is made, set zero_point above that.

Assuming the above, any read from the server at or above the zero_point
position will return all zeroes.

The zero_point value can be stored in the cache, provided the above rules
are applied to it by any code that culls part of the local cache.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
2023-12-28 09:45:27 +00:00
..
acl.c ceph: allow idmapped set_acl inode op 2023-11-03 23:28:34 +01:00
addr.c netfs: Provide invalidate_folio and release_folio calls 2023-12-24 15:08:51 +00:00
cache.c ceph: rename _to_client() to _to_fs_client() 2023-11-03 23:28:33 +01:00
cache.h netfs: Provide invalidate_folio and release_folio calls 2023-12-24 15:08:51 +00:00
caps.c Two items: 2023-11-10 09:52:56 -08:00
ceph_frag.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
crypto.c Two items: 2023-11-10 09:52:56 -08:00
crypto.h ceph: add support for encrypted snapshot names 2023-08-24 11:24:36 +02:00
debugfs.c ceph: print cluster fsid and client global_id in all debug logs 2023-11-03 23:28:33 +01:00
dir.c ceph: pass an idmapping to mknod/symlink/mkdir 2023-11-03 23:28:34 +01:00
export.c ceph: print cluster fsid and client global_id in all debug logs 2023-11-03 23:28:33 +01:00
file.c Two items: 2023-11-10 09:52:56 -08:00
inode.c netfs: Optimise away reads above the point at which there can be no data 2023-12-28 09:45:27 +00:00
io.c ceph: fix kerneldoc copypasta over ceph_start_io_direct 2021-04-27 23:52:23 +02:00
io.h ceph: add buffered/direct exclusionary locking for reads and writes 2019-09-16 12:06:25 +02:00
ioctl.c ceph: print cluster fsid and client global_id in all debug logs 2023-11-03 23:28:33 +01:00
ioctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig ceph: conversion to new fscache API 2022-01-11 22:13:01 +00:00
locks.c ceph: print cluster fsid and client global_id in all debug logs 2023-11-03 23:28:33 +01:00
Makefile ceph: fscrypt_auth handling for ceph 2023-08-22 09:01:48 +02:00
mds_client.c Two items: 2023-11-10 09:52:56 -08:00
mds_client.h ceph: add enable_unsafe_idmap module parameter 2023-11-03 23:28:33 +01:00
mdsmap.c libceph, ceph: move mdsmap.h to fs/ceph 2023-11-03 23:28:33 +01:00
mdsmap.h libceph, ceph: move mdsmap.h to fs/ceph 2023-11-03 23:28:33 +01:00
metric.c ceph: print cluster fsid and client global_id in all debug logs 2023-11-03 23:28:33 +01:00
metric.h ceph: include average/stdev r/w/m latency in mds metrics 2022-03-21 13:35:16 +01:00
quota.c ceph: print cluster fsid and client global_id in all debug logs 2023-11-03 23:28:33 +01:00
snap.c Two items: 2023-11-10 09:52:56 -08:00
strings.c ceph: add getvxattr op 2022-03-01 18:26:37 +01:00
super.c ceph: allow idmapped mounts 2023-11-03 23:28:34 +01:00
super.h Two items: 2023-11-10 09:52:56 -08:00
util.c ceph: move net/ceph/ceph_fs.c to fs/ceph/util.c 2020-01-27 16:53:40 +01:00
xattr.c Two items: 2023-11-10 09:52:56 -08:00